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

Mapname and gamerounds all empty

Open a361570441 opened this issue 2 years ago • 7 comments
trafficstars

I found that my function of getting mapname and getting each round of each game failed in the latest master, and in 4.0.0 beta2 only mapname failed. Hello, I'm very sorry that I didn't quite understand what you meant because I'm a newbie to this part. This is my code and I found that it does not take effect anymore. It still takes effect in 4.0.0 beta2 but not in the latest master. Here is my mapname code // Create new demoparser p := dem.NewParser(f) defer p.Close()

// Parse demofile header
header, err := p.ParseHeader()
checkError(err)

// Parse nav mesh given the map name
currentMap := header.MapName

a361570441 avatar Oct 09 '23 02:10 a361570441

I found a solution to get mapname, but the rank information and gamerounds of cs2 are still empty, I don't know why, and 4.0.0 beta2 is very slow, master is very fast but its data are all empty

a361570441 avatar Oct 09 '23 02:10 a361570441

What I mean is that most of the data can be obtained in beta2 but it is very slow, while in master it is very fast but the data is empty.

a361570441 avatar Oct 09 '23 02:10 a361570441

I found a possibility in my code when i fmt.Println(currentGame.MatchPhases.RoundStarted) : (*demoParser).RegisterEventHandler(func(e events.RoundStart) { gs := (*demoParser).GameState() currentGame.MatchPhases.RoundStarted = append(currentGame.MatchPhases.RoundStarted, int64(gs.IngameTick())) fmt.Println(currentGame.MatchPhases.RoundStarted) if *roundStarted == 1 { currentGame.Rounds = append(currentGame.Rounds, *currentRound) } else { *globalFrameIndex = 0 } the latetest version RoundStart only fires once: image

, however beta2 got many: image

a361570441 avatar Oct 09 '23 09:10 a361570441

RegisterNetMessageHandler(msg *msgs2.CSVCMsg_ServerInfo) { // msg.MapName }

You can get map name through this way.

penjiu avatar Oct 13 '23 08:10 penjiu

The issue is that CS2 demos do not include this info in the header - we might deprecate Header.MapName in the future

markus-wa avatar Oct 14 '23 15:10 markus-wa

The issue is that CS2 demos do not include this info in the header - we might deprecate Header.MapName in the future

Thanks for your reply, but I already found a solution to get mapname, now the question is i got totaly empty round info. the latetest version RoundStart only fires once and roundend event didn't fire. when i fmt.Println(currentGame.MatchPhases.RoundStarted) : (*demoParser).RegisterEventHandler(func(e events.RoundStart) { gs := (*demoParser).GameState() currentGame.MatchPhases.RoundStarted = append(currentGame.MatchPhases.RoundStarted, int64(gs.IngameTick())) fmt.Println(currentGame.MatchPhases.RoundStarted) if *roundStarted == 1 { currentGame.Rounds = append(currentGame.Rounds, *currentRound) } else { *globalFrameIndex = 0 }

a361570441 avatar Oct 16 '23 02:10 a361570441

It's not only MapName but all fields in common.DemoHeader comes empty.

h, _ := p.ParseHeader() // no error here
slog.Info("parsed demo header", "header", h)
INFO parsed demo header header="{Filestamp:PBDEMS2 Protocol:0 NetworkProtocol:0 ServerName: ClientName: MapName: GameDirectory: PlaybackTime:0s PlaybackTicks:0 PlaybackFrames:0 SignonLength:0}"

demo: https://www.faceit.com/ru/cs2/room/1-b02514d4-11e8-415a-92ff-9a9461feb033

ysomad avatar Nov 10 '23 17:11 ysomad