File tree 2 files changed +13
-1
lines changed 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -570,6 +570,7 @@ const (
570
570
WarnTypeBombsiteUnknown // may occur on de_grind for bombsite B as the bounding box of the bombsite is wrong
571
571
WarnTypeTeamSwapPlayerNil // TODO: figure out why this happens
572
572
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
573
574
574
575
// WarnTypeMissingNetMessageDecryptionKey occurs when encrypted net-messages are encountered and the decryption key is missing.
575
576
// See ParserConfig.NetMessageDecryptionKey
Original file line number Diff line number Diff line change @@ -339,6 +339,17 @@ func (p *parser) parseFrameS2() bool {
339
339
340
340
size := p .bitReader .ReadVarInt32 ()
341
341
342
+ msgCreator := demoCommandMsgsCreators [msgType ]
343
+ if msgCreator == nil {
344
+ p .eventDispatcher .Dispatch (events.ParserWarn {
345
+ Message : fmt .Sprintf ("skipping unknown demo commands message type with value %d" , msgType ),
346
+ Type : events .WarnUnknownDemoCommandMessageType ,
347
+ })
348
+ p .bitReader .Skip (int (size ) << 3 )
349
+
350
+ return true
351
+ }
352
+
342
353
buf := p .bitReader .ReadBytes (int (size ))
343
354
344
355
if msgCompressed {
@@ -356,7 +367,7 @@ func (p *parser) parseFrameS2() bool {
356
367
}
357
368
}
358
369
359
- msg := demoCommandMsgsCreators [ msgType ] ()
370
+ msg := msgCreator ()
360
371
361
372
if msg == nil {
362
373
panic (fmt .Sprintf ("Unknown demo command: %d" , msgType ))
You can’t perform that action at this time.
0 commit comments