message id types

master
Jordan Orelli 9 years ago
parent da66321fec
commit 19c7e820bf

@ -36,7 +36,7 @@ func (g *dataGram) check(dump bool) error {
br := bit.NewBytesReader(packet.GetData())
for {
t := br.ReadUBitVar()
t := entityType(br.ReadUBitVar())
s := br.ReadVarInt()
b := make([]byte, s)
br.Read(b)
@ -49,9 +49,9 @@ func (g *dataGram) check(dump bool) error {
return err
}
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 {
fmt.Printf("\tno known entity for type id %d size: %d\n", int(t), len(b))
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 {
fn, ok := p[id]
type messageFactory struct {
datagrams datagramFactory
entities entityFactory
}
func (m *messageFactory) BuildDatagram(id datagramType) proto.Message {
fn, ok := m.datagrams[id]
if !ok {
return nil
}
return fn()
}
var cmdFactory = protoFactory{
{{- range $id, $spec := .Commands }}
{{$id}}: func() proto.Message { return new(dota.{{$spec.TypeName}}) },
{{- end }}
func (m *messageFactory) BuildEntity(id entityType) proto.Message {
fn, ok := m.entities[id]
if !ok {
return nil
}
return fn()
}
var entFactory = protoFactory{
{{- range $id, $spec := .Entities }}
{{$id}}: func() proto.Message { return new(dota.{{$spec.TypeName}}) },
{{- end }}
var messages = messageFactory{
datagramFactory{
{{- range $id, $spec := .Commands }}
{{$spec.EnumName}}: func() proto.Message { return new(dota.{{$spec.TypeName}}) },
{{- end }}
},
entityFactory{
{{- range $id, $spec := .Entities }}
{{$spec.EnumName}}: func() proto.Message { return new(dota.{{$spec.TypeName}}) },
{{- end }}
},
}
`
)

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

Loading…
Cancel
Save