NHA: Fix being unable to find the body type for CS:GO GC messages

This commit is contained in:
Netshroud
2014-11-11 21:25:55 +11:00
parent 440cc40648
commit 0ff80d2fc4
4 changed files with 19 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ namespace NetHookAnalyzer2
Type[] eMsgEnums =
{
typeof( SteamKit2.GC.Dota.Internal.EDOTAGCMsg ),
typeof( SteamKit2.GC.CSGO.Internal.ECsgoGCMsg ),
typeof( SteamKit2.GC.Internal.EGCBaseMsg ),
typeof( SteamKit2.GC.Internal.ESOMsg ),
typeof( SteamKit2.GC.Internal.EGCSystemMsg ),

View File

@@ -40,11 +40,11 @@ namespace NetHookAnalyzer2
var gcMsgName = EMsgExtensions.GetGCMessageName(rawEMsg);
var typeMsgName = gcMsgName
.Replace("GC", string.Empty)
.Replace("k_", string.Empty)
.Replace("ESOMsg", string.Empty)
.TrimStart('_')
.Replace("EMsg", string.Empty);
.Replace("EMsg", string.Empty)
.TrimStart("GC");
var possibleTypes = from type in typeof(CMClient).Assembly.GetTypes()
from typePrefix in GetPossibleGCTypePrefixes(gcAppid)

View File

@@ -67,6 +67,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ProtoBufFieldReader.cs" />
<Compile Include="SteamUtils.cs" />
<Compile Include="StringExtensions.cs" />
<Compile Include="TypeExtensions.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>

View File

@@ -0,0 +1,15 @@
namespace NetHookAnalyzer2
{
static class StringExtensions
{
public static string TrimStart(this string baseString, string startToTrim)
{
if (baseString.IndexOf(startToTrim) == 0)
{
return baseString.Substring(startToTrim.Length);
}
return baseString;
}
}
}