File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -570,6 +570,7 @@ const (
570570 WarnTypeBombsiteUnknown // may occur on de_grind for bombsite B as the bounding box of the bombsite is wrong
571571 WarnTypeTeamSwapPlayerNil // TODO: figure out why this happens
572572 WarnTypeGameEventBeforeDescriptors // may occur in POV demos
573+ WarnUnknownDemoCommandMessageType // occur when we have an unknown EDemoCommands message type, the protobuf messages probably need to be updated
573574
574575 // WarnTypeMissingNetMessageDecryptionKey occurs when encrypted net-messages are encountered and the decryption key is missing.
575576 // See ParserConfig.NetMessageDecryptionKey
Original file line number Diff line number Diff line change @@ -340,6 +340,17 @@ func (p *parser) parseFrameS2() bool {
340340
341341 size := p .bitReader .ReadVarInt32 ()
342342
343+ msgCreator := demoCommandMsgsCreators [msgType ]
344+ if msgCreator == nil {
345+ p .eventDispatcher .Dispatch (events.ParserWarn {
346+ Message : fmt .Sprintf ("skipping unknown demo commands message type with value %d" , msgType ),
347+ Type : events .WarnUnknownDemoCommandMessageType ,
348+ })
349+ p .bitReader .Skip (int (size ) << 3 )
350+
351+ return true
352+ }
353+
343354 buf := p .bitReader .ReadBytes (int (size ))
344355
345356 if msgCompressed {
@@ -357,7 +368,7 @@ func (p *parser) parseFrameS2() bool {
357368 }
358369 }
359370
360- msg := demoCommandMsgsCreators [ msgType ] ()
371+ msg := msgCreator ()
361372
362373 if msg == nil {
363374 panic (fmt .Sprintf ("Unknown demo command: %d" , msgType ))
You can’t perform that action at this time.
0 commit comments