demoinfocs-golang icon indicating copy to clipboard operation
demoinfocs-golang copied to clipboard

Faceit - unexpected EOF: demo stream ended unexpectedly

Open maddenbjames opened this issue 1 year ago • 1 comments
trafficstars

Describe the bug After parsing the entire demo, at the end of the parse it will show this error failed to parse demo: unexpected EOF: demo stream ended unexpectedly (ErrUnexpectedEndOfDemo)

This has been happening a lot more as of late, and as far as I can tell almost exclusively with faceit demos.

To Reproduce Demo page download https://www.faceit.com/en/cs2/room/1-2304a144-2f75-4ab1-913d-2826bb857ae3

Run it on any parser, tested with our intricate one and also just a basic kill printer

Code:

func main() {
	f, err := os.Open("../demos/test.dem")
	if err != nil {
		log.Panic("failed to open demo file: ", err)
	}
	defer f.Close()

	p := dem.NewParser(f)
	defer p.Close()

	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 It finishes the parse with no error. This error seems to happen either at the start of the demo or at the end of the demo parse.

Library version v4.1.2

maddenbjames avatar Apr 24 '24 13:04 maddenbjames

image

Maybe related to this? Just throwing info out there, our CS mod guy said this was added 2 days ago to the demo.proto

maddenbjames avatar Apr 24 '24 13:04 maddenbjames