Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapname and gamerounds all empty #435

Open
a361570441 opened this issue Oct 9, 2023 · 7 comments
Open

Mapname and gamerounds all empty #435

a361570441 opened this issue Oct 9, 2023 · 7 comments

Comments

@a361570441
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@penjiu
Copy link

penjiu commented Oct 13, 2023

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

You can get map name through this way.

@markus-wa
Copy link
Owner

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

@a361570441
Copy link
Author

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
}

@ysomad
Copy link

ysomad commented Nov 10, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants