Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Accessing unexisting parser.Players #9

Closed
romain-durban opened this issue Nov 26, 2014 · 4 comments
Closed

Accessing unexisting parser.Players #9

romain-durban opened this issue Nov 26, 2014 · 4 comments
Assignees

Comments

@romain-durban
Copy link

DP/GameEventHandler.cs ~line 140 (event "player_disconnect")
Got out of index exception on parser.Players[(int)data["userid"]].Disconnected = true;, fixed by making sure the index is valid: if(parser.Players.ContainsKey ((int)data ["userid"]))

@romain-durban romain-durban changed the title Accessing unexisting parser.Player Accessing unexisting parser.Players Nov 26, 2014
@moritzuehling
Copy link
Contributor

This should not happen - if a player disconnects he should be there in the first place. Is it possible to send the demo to github@moritzuehling.de?

Thanks!

@moritzuehling moritzuehling self-assigned this Nov 26, 2014
@romain-durban
Copy link
Author

I think it happens because of bots joining the game before the demo starts (Matchmaking) and then do not produce connection event in the parser. The error indeed occurs on a bot being kicked by console.
I'll send the demo, but this should actually happen for all MM demos downloaded from the server.

Since this check is done only on 'disconnect' events, it's not really expensive, all the more it's a dictionary key check.

@moritzuehling
Copy link
Contributor

Since this check is done only on 'disconnect' events, it's not really expensive, all the more it's a dictionary key check.

Hey,

our main goal is that the check is not necessary because in fact, it shouldn't be. So I rather fix the missing player than fixing the symptom.

@moritzuehling
Copy link
Contributor

This issue should be fixed in e560b2b.

Much thanks for you help, @romain-durban !

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

No branches or pull requests

2 participants