-
Notifications
You must be signed in to change notification settings - Fork 101
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
Missing player in TeamState.Members() #492
Comments
There seems to be an issue with disconnecting and reconnecting.
Probably there should be some additional handling for this situation in the playerConnect method demoinfocs-golang/pkg/demoinfocs/game_events.go Lines 655 to 662 in 5543f4b
inside the playerDisconnect method? |
This is related to #494; I believe the problem is that we should switch to track players using the The most basic version of this is: teamPlayers := make([]*common.Player, 64)
for i := 0; i < 64; i++ {
i := i
slot := fmt.Sprintf("m_aPlayers.%04d", i)
entity.Property(slot).OnUpdate(func(pv st.PropertyValue) {
var player *common.Player
if pv.Any != nil {
player = p.gameState.playersByEntityID[entityIDFromHandle(pv.S2UInt64(), true)]
}
teamPlayers[i] = player
fmt.Printf("%v switched to %s\n", player, team)
})
} I have something like the above hacky version of this working locally, but I think we might need to consult @markus-wa or @akiver to decide how to do this properly. Right now I can't see a way to do this without a medium-sized overhaul of the team-related code. |
Sorry I'm currently a bit slow at getting back on issues - this definitely seems like an important thing to fix. I don't know how quickly I'll be able to get to this so MRs are very welcome. |
This looks relevant: https://github.com/akiver/cs-demo-analyzer/blob/6c642144c19a40277e3690a3d6fc42e313f8752e/pkg/api/ebot.go#L71 |
could you try with this branch please? #499 |
I will be closing this for now, feel free to reopen if the issue persists with |
Describe the bug
I was parsing demofiles from HLTV and noticed that
parser.GameState().TeamTerrorists().Members()
does not return all players, but all players are in theparser.GameState().Participants().All()
.When I looked into the func
(ptcp participants) TeamMembers(team common.Team)
there were only 9 participants, but theparser.GameState().Participants().All()
is returning 13 players and all right ones are there.When I looked into the
p.parser.GameState().Participants().Connected/Playing()
there are the 9 players. I'm not sure if it's a problem with data or the parser, since I'm not much proficient with this library.Thanks for any reply.
To Reproduce
For example:
Library version
v4.0.0
The text was updated successfully, but these errors were encountered: