demoinfocs-golang
demoinfocs-golang copied to clipboard
There is no kill events on Esportal demos but kills are there when demo is played with the game
Describe the bug There is no kill events on Esportal demos but kills are there when demo is played with the game func(e events.Kill) is never called when parsing those demos
To Reproduce Download link to an affected demo: https://pub-de8f82f716174101a8e11da069a07907.r2.dev/6001359.dem
Code:
package main
import (
"fmt"
"log"
"os"
dem "github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs"
events "github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/events"
)
func main() {
f, err := os.Open("C:\\demo_to_parse\\6001359.dem")
if err != nil {
log.Panic("failed to open demo file: ", err)
}
defer f.Close()
p := dem.NewParser(f)
defer p.Close()
// Register handler on kill events
p.RegisterEventHandler(func(e events.Kill) {
var hs string
if e.IsHeadshot {
hs = " (HS)"
}
var wallBang string
if e.PenetratedObjects > 0 {
wallBang = " (WB)"
}
fmt.Printf("%s <%v%s%s> %s\n", e.Killer, e.Weapon, hs, wallBang, e.Victim)
})
// Parse to end
err = p.ParseToEnd()
if err != nil {
log.Panic("failed to parse demo: ", err)
}
}
Expected behavior Sample code should print the list of kills in the demo but nothing is printed
Library version v4.0.0
This may be related to a setting on the game server - if so the best course of action would be to find the setting that affects this and inform Esportal about it.
note: I am a contractor for Esportal and can bring this up with their team, but I would need someone to tell me which setting is causing the issue.
It seems to work now with Esportal demos from the last few days and parser version v4.0.2 - I will be closing this for now.
Maybe this was partially related to #460