message id types

master
Jordan Orelli 8 years ago
parent da66321fec
commit 19c7e820bf

@ -36,7 +36,7 @@ func (g *dataGram) check(dump bool) error {
br := bit.NewBytesReader(packet.GetData()) br := bit.NewBytesReader(packet.GetData())
for { for {
t := br.ReadUBitVar() t := entityType(br.ReadUBitVar())
s := br.ReadVarInt() s := br.ReadVarInt()
b := make([]byte, s) b := make([]byte, s)
br.Read(b) br.Read(b)
@ -49,9 +49,9 @@ func (g *dataGram) check(dump bool) error {
return err return err
} }
if dump { if dump {
fmt.Printf("\t%v\n", entity{t: entityType(t), size: uint32(s), body: b}) fmt.Printf("\t%v\n", entity{t: t, size: uint32(s), body: b})
} }
e := entFactory.BuildMessage(int(t)) e := messages.BuildEntity(t)
if e == nil { if e == nil {
fmt.Printf("\tno known entity for type id %d size: %d\n", int(t), len(b)) fmt.Printf("\tno known entity for type id %d size: %d\n", int(t), len(b))
continue continue

@ -115,26 +115,41 @@ func (e entityType) String() string {
} }
} }
type protoFactory map[int]func() proto.Message type datagramFactory map[datagramType]func() proto.Message
type entityFactory map[entityType]func() proto.Message
func (p protoFactory) BuildMessage(id int) proto.Message { type messageFactory struct {
fn, ok := p[id] datagrams datagramFactory
entities entityFactory
}
func (m *messageFactory) BuildDatagram(id datagramType) proto.Message {
fn, ok := m.datagrams[id]
if !ok { if !ok {
return nil return nil
} }
return fn() return fn()
} }
var cmdFactory = protoFactory{ func (m *messageFactory) BuildEntity(id entityType) proto.Message {
{{- range $id, $spec := .Commands }} fn, ok := m.entities[id]
{{$id}}: func() proto.Message { return new(dota.{{$spec.TypeName}}) }, if !ok {
{{- end }} return nil
}
return fn()
} }
var entFactory = protoFactory{ var messages = messageFactory{
datagramFactory{
{{- range $id, $spec := .Commands }}
{{$spec.EnumName}}: func() proto.Message { return new(dota.{{$spec.TypeName}}) },
{{- end }}
},
entityFactory{
{{- range $id, $spec := .Entities }} {{- range $id, $spec := .Entities }}
{{$id}}: func() proto.Message { return new(dota.{{$spec.TypeName}}) }, {{$spec.EnumName}}: func() proto.Message { return new(dota.{{$spec.TypeName}}) },
{{- end }} {{- end }}
},
} }
` `
) )

@ -128,7 +128,6 @@ const (
EBaseUserMessages_UM_CloseCaptionPlaceholder entityType = 142 EBaseUserMessages_UM_CloseCaptionPlaceholder entityType = 142
EBaseUserMessages_UM_CameraTransition entityType = 143 EBaseUserMessages_UM_CameraTransition entityType = 143
EBaseUserMessages_UM_AudioParameter entityType = 144 EBaseUserMessages_UM_AudioParameter entityType = 144
EBaseGameEvents_GE_VDebugGameSessionIDEvent entityType = 200
EBaseGameEvents_GE_PlaceDecalEvent entityType = 201 EBaseGameEvents_GE_PlaceDecalEvent entityType = 201
EBaseGameEvents_GE_ClearWorldDecalsEvent entityType = 202 EBaseGameEvents_GE_ClearWorldDecalsEvent entityType = 202
EBaseGameEvents_GE_ClearEntityDecalsEvent entityType = 203 EBaseGameEvents_GE_ClearEntityDecalsEvent entityType = 203
@ -432,8 +431,6 @@ func (e entityType) String() string {
return "EBaseUserMessages_UM_CameraTransition" return "EBaseUserMessages_UM_CameraTransition"
case EBaseUserMessages_UM_AudioParameter: case EBaseUserMessages_UM_AudioParameter:
return "EBaseUserMessages_UM_AudioParameter" return "EBaseUserMessages_UM_AudioParameter"
case EBaseGameEvents_GE_VDebugGameSessionIDEvent:
return "EBaseGameEvents_GE_VDebugGameSessionIDEvent"
case EBaseGameEvents_GE_PlaceDecalEvent: case EBaseGameEvents_GE_PlaceDecalEvent:
return "EBaseGameEvents_GE_PlaceDecalEvent" return "EBaseGameEvents_GE_PlaceDecalEvent"
case EBaseGameEvents_GE_ClearWorldDecalsEvent: case EBaseGameEvents_GE_ClearWorldDecalsEvent:
@ -647,217 +644,231 @@ func (e entityType) String() string {
} }
} }
type protoFactory map[int]func() proto.Message type datagramFactory map[datagramType]func() proto.Message
type entityFactory map[entityType]func() proto.Message
func (p protoFactory) BuildMessage(id int) proto.Message { type messageFactory struct {
fn, ok := p[id] datagrams datagramFactory
entities entityFactory
}
func (m *messageFactory) BuildDatagram(id datagramType) proto.Message {
fn, ok := m.datagrams[id]
if !ok { if !ok {
return nil return nil
} }
return fn() return fn()
} }
var cmdFactory = protoFactory{ func (m *messageFactory) BuildEntity(id entityType) proto.Message {
0: func() proto.Message { return new(dota.CDemoStop) }, fn, ok := m.entities[id]
1: func() proto.Message { return new(dota.CDemoFileHeader) }, if !ok {
2: func() proto.Message { return new(dota.CDemoFileInfo) }, return nil
3: func() proto.Message { return new(dota.CDemoSyncTick) }, }
4: func() proto.Message { return new(dota.CDemoSendTables) }, return fn()
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) },
12: func() proto.Message { return new(dota.CDemoUserCmd) },
13: func() proto.Message { return new(dota.CDemoFullPacket) },
14: func() proto.Message { return new(dota.CDemoSaveGame) },
15: func() proto.Message { return new(dota.CDemoSpawnGroups) },
} }
var entFactory = protoFactory{ var messages = messageFactory{
0: func() proto.Message { return new(dota.CNETMsg_NOP) }, datagramFactory{
1: func() proto.Message { return new(dota.CNETMsg_Disconnect) }, EDemoCommands_DEM_Stop: func() proto.Message { return new(dota.CDemoStop) },
3: func() proto.Message { return new(dota.CNETMsg_SplitScreenUser) }, EDemoCommands_DEM_FileHeader: func() proto.Message { return new(dota.CDemoFileHeader) },
4: func() proto.Message { return new(dota.CNETMsg_Tick) }, EDemoCommands_DEM_FileInfo: func() proto.Message { return new(dota.CDemoFileInfo) },
5: func() proto.Message { return new(dota.CNETMsg_StringCmd) }, EDemoCommands_DEM_SyncTick: func() proto.Message { return new(dota.CDemoSyncTick) },
6: func() proto.Message { return new(dota.CNETMsg_SetConVar) }, EDemoCommands_DEM_SendTables: func() proto.Message { return new(dota.CDemoSendTables) },
7: func() proto.Message { return new(dota.CNETMsg_SignonState) }, EDemoCommands_DEM_ClassInfo: func() proto.Message { return new(dota.CDemoClassInfo) },
8: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_Load) }, EDemoCommands_DEM_StringTables: func() proto.Message { return new(dota.CDemoStringTables) },
9: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_ManifestUpdate) }, EDemoCommands_DEM_Packet: func() proto.Message { return new(dota.CDemoPacket) },
11: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_SetCreationTick) }, EDemoCommands_DEM_SignonPacket: func() proto.Message { return new(dota.CDemoPacket) },
12: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_Unload) }, EDemoCommands_DEM_ConsoleCmd: func() proto.Message { return new(dota.CDemoConsoleCmd) },
13: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_LoadCompleted) }, EDemoCommands_DEM_CustomData: func() proto.Message { return new(dota.CDemoCustomData) },
40: func() proto.Message { return new(dota.CSVCMsg_ServerInfo) }, EDemoCommands_DEM_CustomDataCallbacks: func() proto.Message { return new(dota.CDemoCustomDataCallbacks) },
41: func() proto.Message { return new(dota.CSVCMsg_FlattenedSerializer) }, EDemoCommands_DEM_UserCmd: func() proto.Message { return new(dota.CDemoUserCmd) },
42: func() proto.Message { return new(dota.CSVCMsg_ClassInfo) }, EDemoCommands_DEM_FullPacket: func() proto.Message { return new(dota.CDemoFullPacket) },
43: func() proto.Message { return new(dota.CSVCMsg_SetPause) }, EDemoCommands_DEM_SaveGame: func() proto.Message { return new(dota.CDemoSaveGame) },
44: func() proto.Message { return new(dota.CSVCMsg_CreateStringTable) }, EDemoCommands_DEM_SpawnGroups: func() proto.Message { return new(dota.CDemoSpawnGroups) },
45: func() proto.Message { return new(dota.CSVCMsg_UpdateStringTable) }, },
46: func() proto.Message { return new(dota.CSVCMsg_VoiceInit) }, entityFactory{
47: func() proto.Message { return new(dota.CSVCMsg_VoiceData) }, NET_Messages_net_NOP: func() proto.Message { return new(dota.CNETMsg_NOP) },
48: func() proto.Message { return new(dota.CSVCMsg_Print) }, NET_Messages_net_Disconnect: func() proto.Message { return new(dota.CNETMsg_Disconnect) },
49: func() proto.Message { return new(dota.CSVCMsg_Sounds) }, NET_Messages_net_SplitScreenUser: func() proto.Message { return new(dota.CNETMsg_SplitScreenUser) },
50: func() proto.Message { return new(dota.CSVCMsg_SetView) }, NET_Messages_net_Tick: func() proto.Message { return new(dota.CNETMsg_Tick) },
51: func() proto.Message { return new(dota.CSVCMsg_ClearAllStringTables) }, NET_Messages_net_StringCmd: func() proto.Message { return new(dota.CNETMsg_StringCmd) },
52: func() proto.Message { return new(dota.CSVCMsg_CmdKeyValues) }, NET_Messages_net_SetConVar: func() proto.Message { return new(dota.CNETMsg_SetConVar) },
53: func() proto.Message { return new(dota.CSVCMsg_BSPDecal) }, NET_Messages_net_SignonState: func() proto.Message { return new(dota.CNETMsg_SignonState) },
54: func() proto.Message { return new(dota.CSVCMsg_SplitScreen) }, NET_Messages_net_SpawnGroup_Load: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_Load) },
55: func() proto.Message { return new(dota.CSVCMsg_PacketEntities) }, NET_Messages_net_SpawnGroup_ManifestUpdate: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_ManifestUpdate) },
56: func() proto.Message { return new(dota.CSVCMsg_Prefetch) }, NET_Messages_net_SpawnGroup_SetCreationTick: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_SetCreationTick) },
57: func() proto.Message { return new(dota.CSVCMsg_Menu) }, NET_Messages_net_SpawnGroup_Unload: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_Unload) },
58: func() proto.Message { return new(dota.CSVCMsg_GetCvarValue) }, NET_Messages_net_SpawnGroup_LoadCompleted: func() proto.Message { return new(dota.CNETMsg_SpawnGroup_LoadCompleted) },
59: func() proto.Message { return new(dota.CSVCMsg_StopSound) }, SVC_Messages_svc_ServerInfo: func() proto.Message { return new(dota.CSVCMsg_ServerInfo) },
60: func() proto.Message { return new(dota.CSVCMsg_PeerList) }, SVC_Messages_svc_FlattenedSerializer: func() proto.Message { return new(dota.CSVCMsg_FlattenedSerializer) },
61: func() proto.Message { return new(dota.CSVCMsg_PacketReliable) }, SVC_Messages_svc_ClassInfo: func() proto.Message { return new(dota.CSVCMsg_ClassInfo) },
62: func() proto.Message { return new(dota.CSVCMsg_HLTVStatus) }, SVC_Messages_svc_SetPause: func() proto.Message { return new(dota.CSVCMsg_SetPause) },
63: func() proto.Message { return new(dota.CSVCMsg_ServerSteamID) }, SVC_Messages_svc_CreateStringTable: func() proto.Message { return new(dota.CSVCMsg_CreateStringTable) },
70: func() proto.Message { return new(dota.CSVCMsg_FullFrameSplit) }, SVC_Messages_svc_UpdateStringTable: func() proto.Message { return new(dota.CSVCMsg_UpdateStringTable) },
101: func() proto.Message { return new(dota.CUserMessageAchievementEvent) }, SVC_Messages_svc_VoiceInit: func() proto.Message { return new(dota.CSVCMsg_VoiceInit) },
102: func() proto.Message { return new(dota.CUserMessageCloseCaption) }, SVC_Messages_svc_VoiceData: func() proto.Message { return new(dota.CSVCMsg_VoiceData) },
103: func() proto.Message { return new(dota.CUserMessageCloseCaptionDirect) }, SVC_Messages_svc_Print: func() proto.Message { return new(dota.CSVCMsg_Print) },
104: func() proto.Message { return new(dota.CUserMessageCurrentTimescale) }, SVC_Messages_svc_Sounds: func() proto.Message { return new(dota.CSVCMsg_Sounds) },
105: func() proto.Message { return new(dota.CUserMessageDesiredTimescale) }, SVC_Messages_svc_SetView: func() proto.Message { return new(dota.CSVCMsg_SetView) },
106: func() proto.Message { return new(dota.CUserMessageFade) }, SVC_Messages_svc_ClearAllStringTables: func() proto.Message { return new(dota.CSVCMsg_ClearAllStringTables) },
107: func() proto.Message { return new(dota.CUserMessageGameTitle) }, SVC_Messages_svc_CmdKeyValues: func() proto.Message { return new(dota.CSVCMsg_CmdKeyValues) },
109: func() proto.Message { return new(dota.CUserMessageHintText) }, SVC_Messages_svc_BSPDecal: func() proto.Message { return new(dota.CSVCMsg_BSPDecal) },
110: func() proto.Message { return new(dota.CUserMessageHudMsg) }, SVC_Messages_svc_SplitScreen: func() proto.Message { return new(dota.CSVCMsg_SplitScreen) },
111: func() proto.Message { return new(dota.CUserMessageHudText) }, SVC_Messages_svc_PacketEntities: func() proto.Message { return new(dota.CSVCMsg_PacketEntities) },
112: func() proto.Message { return new(dota.CUserMessageKeyHintText) }, SVC_Messages_svc_Prefetch: func() proto.Message { return new(dota.CSVCMsg_Prefetch) },
113: func() proto.Message { return new(dota.CUserMessageColoredText) }, SVC_Messages_svc_Menu: func() proto.Message { return new(dota.CSVCMsg_Menu) },
114: func() proto.Message { return new(dota.CUserMessageRequestState) }, SVC_Messages_svc_GetCvarValue: func() proto.Message { return new(dota.CSVCMsg_GetCvarValue) },
115: func() proto.Message { return new(dota.CUserMessageResetHUD) }, SVC_Messages_svc_StopSound: func() proto.Message { return new(dota.CSVCMsg_StopSound) },
116: func() proto.Message { return new(dota.CUserMessageRumble) }, SVC_Messages_svc_PeerList: func() proto.Message { return new(dota.CSVCMsg_PeerList) },
117: func() proto.Message { return new(dota.CUserMessageSayText) }, SVC_Messages_svc_PacketReliable: func() proto.Message { return new(dota.CSVCMsg_PacketReliable) },
118: func() proto.Message { return new(dota.CUserMessageSayText2) }, SVC_Messages_svc_HLTVStatus: func() proto.Message { return new(dota.CSVCMsg_HLTVStatus) },
119: func() proto.Message { return new(dota.CUserMessageSayTextChannel) }, SVC_Messages_svc_ServerSteamID: func() proto.Message { return new(dota.CSVCMsg_ServerSteamID) },
120: func() proto.Message { return new(dota.CUserMessageShake) }, SVC_Messages_svc_FullFrameSplit: func() proto.Message { return new(dota.CSVCMsg_FullFrameSplit) },
121: func() proto.Message { return new(dota.CUserMessageShakeDir) }, EBaseUserMessages_UM_AchievementEvent: func() proto.Message { return new(dota.CUserMessageAchievementEvent) },
124: func() proto.Message { return new(dota.CUserMessageTextMsg) }, EBaseUserMessages_UM_CloseCaption: func() proto.Message { return new(dota.CUserMessageCloseCaption) },
125: func() proto.Message { return new(dota.CUserMessageScreenTilt) }, EBaseUserMessages_UM_CloseCaptionDirect: func() proto.Message { return new(dota.CUserMessageCloseCaptionDirect) },
126: func() proto.Message { return new(dota.CUserMessageTrain) }, EBaseUserMessages_UM_CurrentTimescale: func() proto.Message { return new(dota.CUserMessageCurrentTimescale) },
127: func() proto.Message { return new(dota.CUserMessageVGUIMenu) }, EBaseUserMessages_UM_DesiredTimescale: func() proto.Message { return new(dota.CUserMessageDesiredTimescale) },
128: func() proto.Message { return new(dota.CUserMessageVoiceMask) }, EBaseUserMessages_UM_Fade: func() proto.Message { return new(dota.CUserMessageFade) },
129: func() proto.Message { return new(dota.CUserMessageVoiceSubtitle) }, EBaseUserMessages_UM_GameTitle: func() proto.Message { return new(dota.CUserMessageGameTitle) },
130: func() proto.Message { return new(dota.CUserMessageSendAudio) }, EBaseUserMessages_UM_HintText: func() proto.Message { return new(dota.CUserMessageHintText) },
131: func() proto.Message { return new(dota.CUserMessageItemPickup) }, EBaseUserMessages_UM_HudMsg: func() proto.Message { return new(dota.CUserMessageHudMsg) },
132: func() proto.Message { return new(dota.CUserMessageAmmoDenied) }, EBaseUserMessages_UM_HudText: func() proto.Message { return new(dota.CUserMessageHudText) },
133: func() proto.Message { return new(dota.CUserMessageCrosshairAngle) }, EBaseUserMessages_UM_KeyHintText: func() proto.Message { return new(dota.CUserMessageKeyHintText) },
134: func() proto.Message { return new(dota.CUserMessageShowMenu) }, EBaseUserMessages_UM_ColoredText: func() proto.Message { return new(dota.CUserMessageColoredText) },
135: func() proto.Message { return new(dota.CUserMessageCreditsMsg) }, EBaseUserMessages_UM_RequestState: func() proto.Message { return new(dota.CUserMessageRequestState) },
136: func() proto.Message { return new(dota.CEntityMessagePlayJingle) }, EBaseUserMessages_UM_ResetHUD: func() proto.Message { return new(dota.CUserMessageResetHUD) },
137: func() proto.Message { return new(dota.CEntityMessageScreenOverlay) }, EBaseUserMessages_UM_Rumble: func() proto.Message { return new(dota.CUserMessageRumble) },
138: func() proto.Message { return new(dota.CEntityMessageRemoveAllDecals) }, EBaseUserMessages_UM_SayText: func() proto.Message { return new(dota.CUserMessageSayText) },
139: func() proto.Message { return new(dota.CEntityMessagePropagateForce) }, EBaseUserMessages_UM_SayText2: func() proto.Message { return new(dota.CUserMessageSayText2) },
140: func() proto.Message { return new(dota.CEntityMessageDoSpark) }, EBaseUserMessages_UM_SayTextChannel: func() proto.Message { return new(dota.CUserMessageSayTextChannel) },
141: func() proto.Message { return new(dota.CEntityMessageFixAngle) }, EBaseUserMessages_UM_Shake: func() proto.Message { return new(dota.CUserMessageShake) },
142: func() proto.Message { return new(dota.CUserMessageCloseCaptionPlaceholder) }, EBaseUserMessages_UM_ShakeDir: func() proto.Message { return new(dota.CUserMessageShakeDir) },
143: func() proto.Message { return new(dota.CUserMessageCameraTransition) }, EBaseUserMessages_UM_TextMsg: func() proto.Message { return new(dota.CUserMessageTextMsg) },
144: func() proto.Message { return new(dota.CUserMessageAudioParameter) }, EBaseUserMessages_UM_ScreenTilt: func() proto.Message { return new(dota.CUserMessageScreenTilt) },
200: func() proto.Message { return new(dota.CMsgVDebugGameSessionIDEvent) }, EBaseUserMessages_UM_Train: func() proto.Message { return new(dota.CUserMessageTrain) },
201: func() proto.Message { return new(dota.CMsgPlaceDecalEvent) }, EBaseUserMessages_UM_VGUIMenu: func() proto.Message { return new(dota.CUserMessageVGUIMenu) },
202: func() proto.Message { return new(dota.CMsgClearWorldDecalsEvent) }, EBaseUserMessages_UM_VoiceMask: func() proto.Message { return new(dota.CUserMessageVoiceMask) },
203: func() proto.Message { return new(dota.CMsgClearEntityDecalsEvent) }, EBaseUserMessages_UM_VoiceSubtitle: func() proto.Message { return new(dota.CUserMessageVoiceSubtitle) },
204: func() proto.Message { return new(dota.CMsgClearDecalsForSkeletonInstanceEvent) }, EBaseUserMessages_UM_SendAudio: func() proto.Message { return new(dota.CUserMessageSendAudio) },
205: func() proto.Message { return new(dota.CMsgSource1LegacyGameEventList) }, EBaseUserMessages_UM_ItemPickup: func() proto.Message { return new(dota.CUserMessageItemPickup) },
206: func() proto.Message { return new(dota.CMsgSource1LegacyListenEvents) }, EBaseUserMessages_UM_AmmoDenied: func() proto.Message { return new(dota.CUserMessageAmmoDenied) },
207: func() proto.Message { return new(dota.CMsgSource1LegacyGameEvent) }, EBaseUserMessages_UM_CrosshairAngle: func() proto.Message { return new(dota.CUserMessageCrosshairAngle) },
208: func() proto.Message { return new(dota.CMsgSosStartSoundEvent) }, EBaseUserMessages_UM_ShowMenu: func() proto.Message { return new(dota.CUserMessageShowMenu) },
209: func() proto.Message { return new(dota.CMsgSosStopSoundEvent) }, EBaseUserMessages_UM_CreditsMsg: func() proto.Message { return new(dota.CUserMessageCreditsMsg) },
210: func() proto.Message { return new(dota.CMsgSosSetSoundEventParams) }, EBaseEntityMessages_EM_PlayJingle: func() proto.Message { return new(dota.CEntityMessagePlayJingle) },
211: func() proto.Message { return new(dota.CMsgSosSetLibraryStackFields) }, EBaseEntityMessages_EM_ScreenOverlay: func() proto.Message { return new(dota.CEntityMessageScreenOverlay) },
212: func() proto.Message { return new(dota.CMsgSosStopSoundEventHash) }, EBaseEntityMessages_EM_RemoveAllDecals: func() proto.Message { return new(dota.CEntityMessageRemoveAllDecals) },
400: func() proto.Message { return new(dota.CMsgTEEffectDispatch) }, EBaseEntityMessages_EM_PropagateForce: func() proto.Message { return new(dota.CEntityMessagePropagateForce) },
465: func() proto.Message { return new(dota.CDOTAUserMsg_AIDebugLine) }, EBaseEntityMessages_EM_DoSpark: func() proto.Message { return new(dota.CEntityMessageDoSpark) },
466: func() proto.Message { return new(dota.CDOTAUserMsg_ChatEvent) }, EBaseEntityMessages_EM_FixAngle: func() proto.Message { return new(dota.CEntityMessageFixAngle) },
467: func() proto.Message { return new(dota.CDOTAUserMsg_CombatHeroPositions) }, EBaseUserMessages_UM_CloseCaptionPlaceholder: func() proto.Message { return new(dota.CUserMessageCloseCaptionPlaceholder) },
470: func() proto.Message { return new(dota.CDOTAUserMsg_CombatLogShowDeath) }, EBaseUserMessages_UM_CameraTransition: func() proto.Message { return new(dota.CUserMessageCameraTransition) },
471: func() proto.Message { return new(dota.CDOTAUserMsg_CreateLinearProjectile) }, EBaseUserMessages_UM_AudioParameter: func() proto.Message { return new(dota.CUserMessageAudioParameter) },
472: func() proto.Message { return new(dota.CDOTAUserMsg_DestroyLinearProjectile) }, EBaseGameEvents_GE_PlaceDecalEvent: func() proto.Message { return new(dota.CMsgPlaceDecalEvent) },
473: func() proto.Message { return new(dota.CDOTAUserMsg_DodgeTrackingProjectiles) }, EBaseGameEvents_GE_ClearWorldDecalsEvent: func() proto.Message { return new(dota.CMsgClearWorldDecalsEvent) },
474: func() proto.Message { return new(dota.CDOTAUserMsg_GlobalLightColor) }, EBaseGameEvents_GE_ClearEntityDecalsEvent: func() proto.Message { return new(dota.CMsgClearEntityDecalsEvent) },
475: func() proto.Message { return new(dota.CDOTAUserMsg_GlobalLightDirection) }, EBaseGameEvents_GE_ClearDecalsForSkeletonInstanceEvent: func() proto.Message { return new(dota.CMsgClearDecalsForSkeletonInstanceEvent) },
476: func() proto.Message { return new(dota.CDOTAUserMsg_InvalidCommand) }, EBaseGameEvents_GE_Source1LegacyGameEventList: func() proto.Message { return new(dota.CMsgSource1LegacyGameEventList) },
477: func() proto.Message { return new(dota.CDOTAUserMsg_LocationPing) }, EBaseGameEvents_GE_Source1LegacyListenEvents: func() proto.Message { return new(dota.CMsgSource1LegacyListenEvents) },
478: func() proto.Message { return new(dota.CDOTAUserMsg_MapLine) }, EBaseGameEvents_GE_Source1LegacyGameEvent: func() proto.Message { return new(dota.CMsgSource1LegacyGameEvent) },
479: func() proto.Message { return new(dota.CDOTAUserMsg_MiniKillCamInfo) }, EBaseGameEvents_GE_SosStartSoundEvent: func() proto.Message { return new(dota.CMsgSosStartSoundEvent) },
480: func() proto.Message { return new(dota.CDOTAUserMsg_MinimapDebugPoint) }, EBaseGameEvents_GE_SosStopSoundEvent: func() proto.Message { return new(dota.CMsgSosStopSoundEvent) },
481: func() proto.Message { return new(dota.CDOTAUserMsg_MinimapEvent) }, EBaseGameEvents_GE_SosSetSoundEventParams: func() proto.Message { return new(dota.CMsgSosSetSoundEventParams) },
482: func() proto.Message { return new(dota.CDOTAUserMsg_NevermoreRequiem) }, EBaseGameEvents_GE_SosSetLibraryStackFields: func() proto.Message { return new(dota.CMsgSosSetLibraryStackFields) },
483: func() proto.Message { return new(dota.CDOTAUserMsg_OverheadEvent) }, EBaseGameEvents_GE_SosStopSoundEventHash: func() proto.Message { return new(dota.CMsgSosStopSoundEventHash) },
484: func() proto.Message { return new(dota.CDOTAUserMsg_SetNextAutobuyItem) }, ETEProtobufIds_TE_EffectDispatchId: func() proto.Message { return new(dota.CMsgTEEffectDispatch) },
485: func() proto.Message { return new(dota.CDOTAUserMsg_SharedCooldown) }, EDotaUserMessages_DOTA_UM_AIDebugLine: func() proto.Message { return new(dota.CDOTAUserMsg_AIDebugLine) },
486: func() proto.Message { return new(dota.CDOTAUserMsg_SpectatorPlayerClick) }, EDotaUserMessages_DOTA_UM_ChatEvent: func() proto.Message { return new(dota.CDOTAUserMsg_ChatEvent) },
487: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialTipInfo) }, EDotaUserMessages_DOTA_UM_CombatHeroPositions: func() proto.Message { return new(dota.CDOTAUserMsg_CombatHeroPositions) },
488: func() proto.Message { return new(dota.CDOTAUserMsg_UnitEvent) }, EDotaUserMessages_DOTA_UM_CombatLogShowDeath: func() proto.Message { return new(dota.CDOTAUserMsg_CombatLogShowDeath) },
489: func() proto.Message { return new(dota.CDOTAUserMsg_ParticleManager) }, EDotaUserMessages_DOTA_UM_CreateLinearProjectile: func() proto.Message { return new(dota.CDOTAUserMsg_CreateLinearProjectile) },
490: func() proto.Message { return new(dota.CDOTAUserMsg_BotChat) }, EDotaUserMessages_DOTA_UM_DestroyLinearProjectile: func() proto.Message { return new(dota.CDOTAUserMsg_DestroyLinearProjectile) },
491: func() proto.Message { return new(dota.CDOTAUserMsg_HudError) }, EDotaUserMessages_DOTA_UM_DodgeTrackingProjectiles: func() proto.Message { return new(dota.CDOTAUserMsg_DodgeTrackingProjectiles) },
492: func() proto.Message { return new(dota.CDOTAUserMsg_ItemPurchased) }, EDotaUserMessages_DOTA_UM_GlobalLightColor: func() proto.Message { return new(dota.CDOTAUserMsg_GlobalLightColor) },
493: func() proto.Message { return new(dota.CDOTAUserMsg_Ping) }, EDotaUserMessages_DOTA_UM_GlobalLightDirection: func() proto.Message { return new(dota.CDOTAUserMsg_GlobalLightDirection) },
494: func() proto.Message { return new(dota.CDOTAUserMsg_ItemFound) }, EDotaUserMessages_DOTA_UM_InvalidCommand: func() proto.Message { return new(dota.CDOTAUserMsg_InvalidCommand) },
496: func() proto.Message { return new(dota.CDOTAUserMsg_SwapVerify) }, EDotaUserMessages_DOTA_UM_LocationPing: func() proto.Message { return new(dota.CDOTAUserMsg_LocationPing) },
497: func() proto.Message { return new(dota.CDOTAUserMsg_WorldLine) }, EDotaUserMessages_DOTA_UM_MapLine: func() proto.Message { return new(dota.CDOTAUserMsg_MapLine) },
498: func() proto.Message { return new(dota.CMsgGCToClientTournamentItemDrop) }, EDotaUserMessages_DOTA_UM_MiniKillCamInfo: func() proto.Message { return new(dota.CDOTAUserMsg_MiniKillCamInfo) },
499: func() proto.Message { return new(dota.CDOTAUserMsg_ItemAlert) }, EDotaUserMessages_DOTA_UM_MinimapDebugPoint: func() proto.Message { return new(dota.CDOTAUserMsg_MinimapDebugPoint) },
500: func() proto.Message { return new(dota.CDOTAUserMsg_HalloweenDrops) }, EDotaUserMessages_DOTA_UM_MinimapEvent: func() proto.Message { return new(dota.CDOTAUserMsg_MinimapEvent) },
501: func() proto.Message { return new(dota.CDOTAUserMsg_ChatWheel) }, EDotaUserMessages_DOTA_UM_NevermoreRequiem: func() proto.Message { return new(dota.CDOTAUserMsg_NevermoreRequiem) },
502: func() proto.Message { return new(dota.CDOTAUserMsg_ReceivedXmasGift) }, EDotaUserMessages_DOTA_UM_OverheadEvent: func() proto.Message { return new(dota.CDOTAUserMsg_OverheadEvent) },
503: func() proto.Message { return new(dota.CDOTAUserMsg_UpdateSharedContent) }, EDotaUserMessages_DOTA_UM_SetNextAutobuyItem: func() proto.Message { return new(dota.CDOTAUserMsg_SetNextAutobuyItem) },
504: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialRequestExp) }, EDotaUserMessages_DOTA_UM_SharedCooldown: func() proto.Message { return new(dota.CDOTAUserMsg_SharedCooldown) },
505: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialPingMinimap) }, EDotaUserMessages_DOTA_UM_SpectatorPlayerClick: func() proto.Message { return new(dota.CDOTAUserMsg_SpectatorPlayerClick) },
506: func() proto.Message { return new(dota.CDOTAUserMsg_GamerulesStateChanged) }, EDotaUserMessages_DOTA_UM_TutorialTipInfo: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialTipInfo) },
507: func() proto.Message { return new(dota.CDOTAUserMsg_ShowSurvey) }, EDotaUserMessages_DOTA_UM_UnitEvent: func() proto.Message { return new(dota.CDOTAUserMsg_UnitEvent) },
508: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialFade) }, EDotaUserMessages_DOTA_UM_ParticleManager: func() proto.Message { return new(dota.CDOTAUserMsg_ParticleManager) },
509: func() proto.Message { return new(dota.CDOTAUserMsg_AddQuestLogEntry) }, EDotaUserMessages_DOTA_UM_BotChat: func() proto.Message { return new(dota.CDOTAUserMsg_BotChat) },
510: func() proto.Message { return new(dota.CDOTAUserMsg_SendStatPopup) }, EDotaUserMessages_DOTA_UM_HudError: func() proto.Message { return new(dota.CDOTAUserMsg_HudError) },
511: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialFinish) }, EDotaUserMessages_DOTA_UM_ItemPurchased: func() proto.Message { return new(dota.CDOTAUserMsg_ItemPurchased) },
512: func() proto.Message { return new(dota.CDOTAUserMsg_SendRoshanPopup) }, EDotaUserMessages_DOTA_UM_Ping: func() proto.Message { return new(dota.CDOTAUserMsg_Ping) },
513: func() proto.Message { return new(dota.CDOTAUserMsg_SendGenericToolTip) }, EDotaUserMessages_DOTA_UM_ItemFound: func() proto.Message { return new(dota.CDOTAUserMsg_ItemFound) },
514: func() proto.Message { return new(dota.CDOTAUserMsg_SendFinalGold) }, EDotaUserMessages_DOTA_UM_SwapVerify: func() proto.Message { return new(dota.CDOTAUserMsg_SwapVerify) },
515: func() proto.Message { return new(dota.CDOTAUserMsg_CustomMsg) }, EDotaUserMessages_DOTA_UM_WorldLine: func() proto.Message { return new(dota.CDOTAUserMsg_WorldLine) },
516: func() proto.Message { return new(dota.CDOTAUserMsg_CoachHUDPing) }, EDotaUserMessages_DOTA_UM_TournamentDrop: func() proto.Message { return new(dota.CMsgGCToClientTournamentItemDrop) },
517: func() proto.Message { return new(dota.CDOTAUserMsg_ClientLoadGridNav) }, EDotaUserMessages_DOTA_UM_ItemAlert: func() proto.Message { return new(dota.CDOTAUserMsg_ItemAlert) },
518: func() proto.Message { return new(dota.CDOTAUserMsg_TE_Projectile) }, EDotaUserMessages_DOTA_UM_HalloweenDrops: func() proto.Message { return new(dota.CDOTAUserMsg_HalloweenDrops) },
519: func() proto.Message { return new(dota.CDOTAUserMsg_TE_ProjectileLoc) }, EDotaUserMessages_DOTA_UM_ChatWheel: func() proto.Message { return new(dota.CDOTAUserMsg_ChatWheel) },
520: func() proto.Message { return new(dota.CDOTAUserMsg_TE_DotaBloodImpact) }, EDotaUserMessages_DOTA_UM_ReceivedXmasGift: func() proto.Message { return new(dota.CDOTAUserMsg_ReceivedXmasGift) },
521: func() proto.Message { return new(dota.CDOTAUserMsg_TE_UnitAnimation) }, EDotaUserMessages_DOTA_UM_UpdateSharedContent: func() proto.Message { return new(dota.CDOTAUserMsg_UpdateSharedContent) },
522: func() proto.Message { return new(dota.CDOTAUserMsg_TE_UnitAnimationEnd) }, EDotaUserMessages_DOTA_UM_TutorialRequestExp: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialRequestExp) },
523: func() proto.Message { return new(dota.CDOTAUserMsg_AbilityPing) }, EDotaUserMessages_DOTA_UM_TutorialPingMinimap: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialPingMinimap) },
524: func() proto.Message { return new(dota.CDOTAUserMsg_ShowGenericPopup) }, EDotaUserMessages_DOTA_UM_GamerulesStateChanged: func() proto.Message { return new(dota.CDOTAUserMsg_GamerulesStateChanged) },
525: func() proto.Message { return new(dota.CDOTAUserMsg_VoteStart) }, EDotaUserMessages_DOTA_UM_ShowSurvey: func() proto.Message { return new(dota.CDOTAUserMsg_ShowSurvey) },
526: func() proto.Message { return new(dota.CDOTAUserMsg_VoteUpdate) }, EDotaUserMessages_DOTA_UM_TutorialFade: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialFade) },
527: func() proto.Message { return new(dota.CDOTAUserMsg_VoteEnd) }, EDotaUserMessages_DOTA_UM_AddQuestLogEntry: func() proto.Message { return new(dota.CDOTAUserMsg_AddQuestLogEntry) },
528: func() proto.Message { return new(dota.CDOTAUserMsg_BoosterState) }, EDotaUserMessages_DOTA_UM_SendStatPopup: func() proto.Message { return new(dota.CDOTAUserMsg_SendStatPopup) },
529: func() proto.Message { return new(dota.CDOTAUserMsg_WillPurchaseAlert) }, EDotaUserMessages_DOTA_UM_TutorialFinish: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialFinish) },
530: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialMinimapPosition) }, EDotaUserMessages_DOTA_UM_SendRoshanPopup: func() proto.Message { return new(dota.CDOTAUserMsg_SendRoshanPopup) },
531: func() proto.Message { return new(dota.CDOTAUserMsg_PlayerMMR) }, EDotaUserMessages_DOTA_UM_SendGenericToolTip: func() proto.Message { return new(dota.CDOTAUserMsg_SendGenericToolTip) },
532: func() proto.Message { return new(dota.CDOTAUserMsg_AbilitySteal) }, EDotaUserMessages_DOTA_UM_SendFinalGold: func() proto.Message { return new(dota.CDOTAUserMsg_SendFinalGold) },
533: func() proto.Message { return new(dota.CDOTAUserMsg_CourierKilledAlert) }, EDotaUserMessages_DOTA_UM_CustomMsg: func() proto.Message { return new(dota.CDOTAUserMsg_CustomMsg) },
534: func() proto.Message { return new(dota.CDOTAUserMsg_EnemyItemAlert) }, EDotaUserMessages_DOTA_UM_CoachHUDPing: func() proto.Message { return new(dota.CDOTAUserMsg_CoachHUDPing) },
535: func() proto.Message { return new(dota.CDOTAUserMsg_StatsMatchDetails) }, EDotaUserMessages_DOTA_UM_ClientLoadGridNav: func() proto.Message { return new(dota.CDOTAUserMsg_ClientLoadGridNav) },
536: func() proto.Message { return new(dota.CDOTAUserMsg_MiniTaunt) }, EDotaUserMessages_DOTA_UM_TE_Projectile: func() proto.Message { return new(dota.CDOTAUserMsg_TE_Projectile) },
537: func() proto.Message { return new(dota.CDOTAUserMsg_BuyBackStateAlert) }, EDotaUserMessages_DOTA_UM_TE_ProjectileLoc: func() proto.Message { return new(dota.CDOTAUserMsg_TE_ProjectileLoc) },
538: func() proto.Message { return new(dota.CDOTAUserMsg_SpeechBubble) }, EDotaUserMessages_DOTA_UM_TE_DotaBloodImpact: func() proto.Message { return new(dota.CDOTAUserMsg_TE_DotaBloodImpact) },
539: func() proto.Message { return new(dota.CDOTAUserMsg_CustomHeaderMessage) }, EDotaUserMessages_DOTA_UM_TE_UnitAnimation: func() proto.Message { return new(dota.CDOTAUserMsg_TE_UnitAnimation) },
540: func() proto.Message { return new(dota.CDOTAUserMsg_QuickBuyAlert) }, EDotaUserMessages_DOTA_UM_TE_UnitAnimationEnd: func() proto.Message { return new(dota.CDOTAUserMsg_TE_UnitAnimationEnd) },
541: func() proto.Message { return new(dota.CDOTAUserMsg_StatsHeroMinuteDetails) }, EDotaUserMessages_DOTA_UM_AbilityPing: func() proto.Message { return new(dota.CDOTAUserMsg_AbilityPing) },
542: func() proto.Message { return new(dota.CDOTAUserMsg_PredictionResult) }, EDotaUserMessages_DOTA_UM_ShowGenericPopup: func() proto.Message { return new(dota.CDOTAUserMsg_ShowGenericPopup) },
543: func() proto.Message { return new(dota.CDOTAUserMsg_ModifierAlert) }, EDotaUserMessages_DOTA_UM_VoteStart: func() proto.Message { return new(dota.CDOTAUserMsg_VoteStart) },
544: func() proto.Message { return new(dota.CDOTAUserMsg_HPManaAlert) }, EDotaUserMessages_DOTA_UM_VoteUpdate: func() proto.Message { return new(dota.CDOTAUserMsg_VoteUpdate) },
545: func() proto.Message { return new(dota.CDOTAUserMsg_GlyphAlert) }, EDotaUserMessages_DOTA_UM_VoteEnd: func() proto.Message { return new(dota.CDOTAUserMsg_VoteEnd) },
546: func() proto.Message { return new(dota.CDOTAUserMsg_BeastChat) }, EDotaUserMessages_DOTA_UM_BoosterState: func() proto.Message { return new(dota.CDOTAUserMsg_BoosterState) },
547: func() proto.Message { return new(dota.CDOTAUserMsg_SpectatorPlayerUnitOrders) }, EDotaUserMessages_DOTA_UM_WillPurchaseAlert: func() proto.Message { return new(dota.CDOTAUserMsg_WillPurchaseAlert) },
548: func() proto.Message { return new(dota.CDOTAUserMsg_CustomHudElement_Create) }, EDotaUserMessages_DOTA_UM_TutorialMinimapPosition: func() proto.Message { return new(dota.CDOTAUserMsg_TutorialMinimapPosition) },
549: func() proto.Message { return new(dota.CDOTAUserMsg_CustomHudElement_Modify) }, EDotaUserMessages_DOTA_UM_PlayerMMR: func() proto.Message { return new(dota.CDOTAUserMsg_PlayerMMR) },
550: func() proto.Message { return new(dota.CDOTAUserMsg_CustomHudElement_Destroy) }, EDotaUserMessages_DOTA_UM_AbilitySteal: func() proto.Message { return new(dota.CDOTAUserMsg_AbilitySteal) },
551: func() proto.Message { return new(dota.CDOTAUserMsg_CompendiumState) }, EDotaUserMessages_DOTA_UM_CourierKilledAlert: func() proto.Message { return new(dota.CDOTAUserMsg_CourierKilledAlert) },
552: func() proto.Message { return new(dota.CDOTAUserMsg_ProjectionAbility) }, EDotaUserMessages_DOTA_UM_EnemyItemAlert: func() proto.Message { return new(dota.CDOTAUserMsg_EnemyItemAlert) },
553: func() proto.Message { return new(dota.CDOTAUserMsg_ProjectionEvent) }, EDotaUserMessages_DOTA_UM_StatsMatchDetails: func() proto.Message { return new(dota.CDOTAUserMsg_StatsMatchDetails) },
554: func() proto.Message { return new(dota.CMsgDOTACombatLogEntry) }, EDotaUserMessages_DOTA_UM_MiniTaunt: func() proto.Message { return new(dota.CDOTAUserMsg_MiniTaunt) },
555: func() proto.Message { return new(dota.CDOTAUserMsg_XPAlert) }, EDotaUserMessages_DOTA_UM_BuyBackStateAlert: func() proto.Message { return new(dota.CDOTAUserMsg_BuyBackStateAlert) },
556: func() proto.Message { return new(dota.CDOTAUserMsg_UpdateQuestProgress) }, EDotaUserMessages_DOTA_UM_SpeechBubble: func() proto.Message { return new(dota.CDOTAUserMsg_SpeechBubble) },
557: func() proto.Message { return new(dota.CDOTAClientMsg_MatchMetadata) }, EDotaUserMessages_DOTA_UM_CustomHeaderMessage: func() proto.Message { return new(dota.CDOTAUserMsg_CustomHeaderMessage) },
559: func() proto.Message { return new(dota.CDOTAUserMsg_QuestStatus) }, EDotaUserMessages_DOTA_UM_QuickBuyAlert: func() proto.Message { return new(dota.CDOTAUserMsg_QuickBuyAlert) },
EDotaUserMessages_DOTA_UM_StatsHeroDetails: func() proto.Message { return new(dota.CDOTAUserMsg_StatsHeroMinuteDetails) },
EDotaUserMessages_DOTA_UM_PredictionResult: func() proto.Message { return new(dota.CDOTAUserMsg_PredictionResult) },
EDotaUserMessages_DOTA_UM_ModifierAlert: func() proto.Message { return new(dota.CDOTAUserMsg_ModifierAlert) },
EDotaUserMessages_DOTA_UM_HPManaAlert: func() proto.Message { return new(dota.CDOTAUserMsg_HPManaAlert) },
EDotaUserMessages_DOTA_UM_GlyphAlert: func() proto.Message { return new(dota.CDOTAUserMsg_GlyphAlert) },
EDotaUserMessages_DOTA_UM_BeastChat: func() proto.Message { return new(dota.CDOTAUserMsg_BeastChat) },
EDotaUserMessages_DOTA_UM_SpectatorPlayerUnitOrders: func() proto.Message { return new(dota.CDOTAUserMsg_SpectatorPlayerUnitOrders) },
EDotaUserMessages_DOTA_UM_CustomHudElement_Create: func() proto.Message { return new(dota.CDOTAUserMsg_CustomHudElement_Create) },
EDotaUserMessages_DOTA_UM_CustomHudElement_Modify: func() proto.Message { return new(dota.CDOTAUserMsg_CustomHudElement_Modify) },
EDotaUserMessages_DOTA_UM_CustomHudElement_Destroy: func() proto.Message { return new(dota.CDOTAUserMsg_CustomHudElement_Destroy) },
EDotaUserMessages_DOTA_UM_CompendiumState: func() proto.Message { return new(dota.CDOTAUserMsg_CompendiumState) },
EDotaUserMessages_DOTA_UM_ProjectionAbility: func() proto.Message { return new(dota.CDOTAUserMsg_ProjectionAbility) },
EDotaUserMessages_DOTA_UM_ProjectionEvent: func() proto.Message { return new(dota.CDOTAUserMsg_ProjectionEvent) },
EDotaUserMessages_DOTA_UM_CombatLogDataHLTV: func() proto.Message { return new(dota.CMsgDOTACombatLogEntry) },
EDotaUserMessages_DOTA_UM_XPAlert: func() proto.Message { return new(dota.CDOTAUserMsg_XPAlert) },
EDotaUserMessages_DOTA_UM_UpdateQuestProgress: func() proto.Message { return new(dota.CDOTAUserMsg_UpdateQuestProgress) },
EDotaUserMessages_DOTA_UM_MatchMetadata: func() proto.Message { return new(dota.CDOTAClientMsg_MatchMetadata) },
EDotaUserMessages_DOTA_UM_QuestStatus: func() proto.Message { return new(dota.CDOTAUserMsg_QuestStatus) },
},
} }

@ -57,7 +57,7 @@ func (p *parser) run() error {
fmt.Printf("error: %v\n", err) fmt.Printf("error: %v\n", err)
} }
default: default:
m := cmdFactory.BuildMessage(int(gram.cmd)) m := messages.BuildDatagram(gram.cmd)
if m != nil { if m != nil {
err := proto.Unmarshal(gram.body, m) err := proto.Unmarshal(gram.body, m)
if err != nil { if err != nil {
@ -123,10 +123,13 @@ func (p *parser) checkHeader() (bool, error) {
return string(buf) == replayHeader, nil return string(buf) == replayHeader, nil
} }
func (p *parser) readCommand() (datagramType, bool, error) { // reads the next datagram type indicator off the wire. Also looks for a
// compression flag, returning true if the contents to follow are snappy
// compressed, false otherwise.
func (p *parser) readDatagramType() (datagramType, bool, error) {
n, err := p.decodeVarint() n, err := p.decodeVarint()
if err != nil { if err != nil {
return EDemoCommands_DEM_Error, false, wrap(err, "readCommand couldn't read varint") return EDemoCommands_DEM_Error, false, wrap(err, "readDatagramType couldn't read varint")
} }
compressed := false compressed := false
@ -138,7 +141,7 @@ func (p *parser) readCommand() (datagramType, bool, error) {
} }
func (p *parser) readDatagram() (*dataGram, error) { func (p *parser) readDatagram() (*dataGram, error) {
cmd, compressed, err := p.readCommand() cmd, compressed, err := p.readDatagramType()
if err != nil { if err != nil {
return nil, wrap(err, "readDatagram couldn't get a command") return nil, wrap(err, "readDatagram couldn't get a command")
} }

Loading…
Cancel
Save