From adad9a2174006f5f22aff0a4cd40fe686349440e Mon Sep 17 00:00:00 2001 From: AkiVer Date: Thu, 10 Oct 2024 23:40:24 +0200 Subject: [PATCH] feat: game event list based on network protocol fix #566 --- pkg/demoinfocs/demoinfocs_test.go | 2 +- pkg/demoinfocs/event-list-dump/13990.bin | Bin 0 -> 15397 bytes .../13992.bin} | Bin pkg/demoinfocs/event-list-dump/14023.bin | Bin 0 -> 15351 bytes pkg/demoinfocs/parser.go | 8 ------ pkg/demoinfocs/s2_commands.go | 27 +++++++++++++++++- 6 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 pkg/demoinfocs/event-list-dump/13990.bin rename pkg/demoinfocs/{s2_CMsgSource1LegacyGameEventList.pb.bin => event-list-dump/13992.bin} (100%) create mode 100644 pkg/demoinfocs/event-list-dump/14023.bin diff --git a/pkg/demoinfocs/demoinfocs_test.go b/pkg/demoinfocs/demoinfocs_test.go index 2b016e88..9f62c2d0 100644 --- a/pkg/demoinfocs/demoinfocs_test.go +++ b/pkg/demoinfocs/demoinfocs_test.go @@ -219,7 +219,7 @@ func TestS2(t *testing.T) { if *update { p.RegisterNetMessageHandler(func(gel *msgs2.CMsgSource1LegacyGameEventList) { - lo.Must0(os.WriteFile("s2_CMsgSource1LegacyGameEventList.pb.bin", lo.Must(proto.Marshal(gel)), 0600)) + lo.Must0(os.WriteFile("event-list-dump/s2_CMsgSource1LegacyGameEventList.pb.bin", lo.Must(proto.Marshal(gel)), 0600)) }) } diff --git a/pkg/demoinfocs/event-list-dump/13990.bin b/pkg/demoinfocs/event-list-dump/13990.bin new file mode 100644 index 0000000000000000000000000000000000000000..da87bcc1dd7f21c19dc1074d683e38655176e498 GIT binary patch literal 15397 zcmchecYGvQeZV8#>F#M%?(|N&)5+%wgm%WhVq;^l4K}8PVlaVFhtclr?pV7s%gn6G zB_Z_QTSx*akluUmg^=Dm>Am+}$oKbqZ+2%Toh0+&!#~oz{(Hao>%ZRy@0c*3W@n2y zUyt*!=tmpr%B-2Nr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g/demoinfocs/parser.go @@ -373,9 +373,6 @@ var DefaultParserConfig = ParserConfig{ MsgQueueBufferSize: -1, } -//go:embed s2_CMsgSource1LegacyGameEventList.pb.bin -var defaultSource2FallbackGameEventListBin []byte - // NewParserWithConfig returns a new Parser with a custom configuration. // // See also: NewParser() & ParserConfig @@ -399,11 +396,6 @@ func NewParserWithConfig(demostream io.Reader, config ParserConfig) Parser { p.recordingPlayerSlot = -1 p.disableMimicSource1GameEvents = config.DisableMimicSource1Events p.source2FallbackGameEventListBin = config.Source2FallbackGameEventListBin - - if p.source2FallbackGameEventListBin == nil { - p.source2FallbackGameEventListBin = defaultSource2FallbackGameEventListBin - } - p.ignorePacketEntitiesPanic = config.IgnorePacketEntitiesPanic dispatcherCfg := dp.Config{ diff --git a/pkg/demoinfocs/s2_commands.go b/pkg/demoinfocs/s2_commands.go index 79cc683c..85c6ccda 100644 --- a/pkg/demoinfocs/s2_commands.go +++ b/pkg/demoinfocs/s2_commands.go @@ -2,6 +2,7 @@ package demoinfocs import ( "bytes" + "embed" "fmt" "sort" "time" @@ -372,12 +373,36 @@ func (p *parser) handleFileInfo(msg *msgs2.CDemoFileInfo) { p.header.PlaybackTime = time.Duration(*msg.PlaybackTime) * time.Second } +//go:embed event-list-dump/*.bin +var eventListFolder embed.FS + +func getGameEventListBinForProtocol(networkProtocol int) ([]byte, error) { + switch { + case networkProtocol < 13992: + return eventListFolder.ReadFile("event-list-dump/13990.bin") + case networkProtocol >= 13992 && networkProtocol < 14023: + return eventListFolder.ReadFile("event-list-dump/13992.bin") + default: + return eventListFolder.ReadFile("event-list-dump/14023.bin") + } +} + func (p *parser) handleDemoFileHeader(msg *msgs2.CDemoFileHeader) { p.header.ClientName = msg.GetClientName() p.header.ServerName = msg.GetServerName() p.header.GameDirectory = msg.GetGameDirectory() p.header.MapName = msg.GetMapName() - p.header.NetworkProtocol = int(msg.GetNetworkProtocol()) + networkProtocol := int(msg.GetNetworkProtocol()) + p.header.NetworkProtocol = networkProtocol + + if p.source2FallbackGameEventListBin == nil { + gameEventListBin, err := getGameEventListBinForProtocol(networkProtocol) + if err != nil { + panic(fmt.Sprintf("failed to load game event list for protocol %d: %v", networkProtocol, err)) + } + + p.source2FallbackGameEventListBin = gameEventListBin + } } func (p *parser) updatePlayersPreviousFramePosition() {