From d55cd19ccbb433c1cc3c2a2c48ca75cf70bdc9c9 Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Wed, 3 Aug 2016 23:12:41 -0400 Subject: [PATCH] seemsGood --- datagram.go | 2 +- gen/main.go | 17 +++-------------- generated.go | 1 + 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/datagram.go b/datagram.go index c94f4f3..4dbf088 100644 --- a/datagram.go +++ b/datagram.go @@ -53,7 +53,7 @@ func (g *dataGram) check(dump bool) error { } e := entFactory.BuildMessage(int(t)) if e == nil { - fmt.Printf("\tno known entity for type id %d\n", int(t)) + fmt.Printf("\tno known entity for type id %d size: %d\n", int(t), len(b)) continue } err := proto.Unmarshal(b, e) diff --git a/gen/main.go b/gen/main.go index f84831a..2d862eb 100644 --- a/gen/main.go +++ b/gen/main.go @@ -46,17 +46,7 @@ var ( "EDotaUserMessages_DOTA_UM_TournamentDrop": "CMsgGCToClientTournamentItemDrop", "EDotaUserMessages_DOTA_UM_MatchMetadata": "CDOTAClientMsg_MatchMetadata", "ETEProtobufIds_TE_EffectDispatchId": "CMsgTEEffectDispatch", - } - skipped = map[string]bool{ - "EDemoCommands_DEM_IsCompressed": true, - "EDemoCommands_DEM_Max": true, - "EDotaUserMessages_DOTA_UM_MatchDetails": true, - "EBaseUserMessages_UM_ParticleManager": true, - "EBaseUserMessages_UM_CustomGameEvent": true, - "EDotaUserMessages_DOTA_UM_AddUnitToSelection": true, - "EBaseUserMessages_UM_HudError": true, - "EDotaUserMessages_DOTA_UM_CombatLogData": true, - "EDotaUserMessages_DOTA_UM_CharacterSpeakConcept": true, + "EDemoCommands_DEM_SignonPacket": "CDemoPacket", } // EBaseUserMessages_UM_HandHapticPulse tpl = `package main @@ -240,9 +230,6 @@ func processPackage(name string, pkg *ast.Package) { // given an enum name, finds the appropriate message type func typeName(enumName string) string { - if skipped[enumName] { - return "" - } if name, ok := specials[enumName]; ok { return name } @@ -286,6 +273,7 @@ func main() { for id, name := range cmdTypes { realName := typeName(name) if realName == "" { + fmt.Printf("no typename known for command enum name %s (%d)\n", name, id) continue } ctx.Commands[id] = realName @@ -293,6 +281,7 @@ func main() { for id, name := range entityTypes { realName := typeName(name) if realName == "" { + fmt.Printf("no typename known for entity enum name %s (%d)\n", name, id) continue } ctx.Entities[id] = realName diff --git a/generated.go b/generated.go index 4b9f1d5..bb666ed 100644 --- a/generated.go +++ b/generated.go @@ -48,6 +48,7 @@ var cmdFactory = protoFactory{ 5: func() proto.Message { return new(dota.CDemoClassInfo) }, 6: func() proto.Message { return new(dota.CDemoStringTables) }, 7: func() proto.Message { return new(dota.CDemoPacket) }, + 8: func() proto.Message { return new(dota.CDemoPacket) }, 9: func() proto.Message { return new(dota.CDemoConsoleCmd) }, 10: func() proto.Message { return new(dota.CDemoCustomData) }, 11: func() proto.Message { return new(dota.CDemoCustomDataCallbacks) },