demoinfocs-golang
demoinfocs-golang copied to clipboard
Events are not firing in CS2 GOTV demo
Describe the bug
When parsing a demo that was automatically recorded with tv_autorecord
from a local server, events are not firing at all.
To Reproduce https://cloud.mway.club/s/AQDWyN6gr23GMfj
Code:
f, err := os.Open("...")
if err != nil {
log.Panic("failed to open demo file: ", err)
}
defer f.Close()
p := dem.NewParser(f)
defer p.Close()
p.RegisterEventHandler(func(event events.Kill) {
fmt.Println("kill")
})
_, err = p.ParseHeader()
if err != nil {
panic(err)
}
err = p.ParseToEnd()
if err != nil {
panic(err)
}
Expected behavior Expected events to fire for a specific enum value (Kill, PlayerJump, WeaponFire etc). This demo works in CS Demo Manager (outputs wrong info and includes warmup, but all the necessary events fire, including the ones that I specified) and it uses a default configuration for the parser, as do I.
Library version v4/v4.0.1
Additional context Developing and debugging using dlv and Visual Studio Code on latest MacOS.