1

Resolved

36 players on a 32 players server

description

I think there is something wrong with the handling of playerlist.
 
I seeing everyday diffs from what the real number of players is on the server and what BF3Rcon.net saying it is.
 
I have thinked i should log more to know whats happening but are you aware of this bug?

file attachments

comments

Timiz0r wrote Nov 7, 2011 at 7:37 PM

I haven't seen this bug yet. I'm working on another bug in my dev version, but, after that, I'll do some searching.

Timiz0r wrote Nov 7, 2011 at 7:43 PM

I'm done with my bug, so now I'll check out this one :D

Timiz0r wrote Nov 7, 2011 at 7:52 PM

Ah good I can confirm it, although I haven't found the cause yet. My only guess is that player.onLeave isn't sent by the server. I'll go ahead and get to work on this.

Timiz0r wrote Nov 7, 2011 at 8:17 PM

Right now I'm running a test console to find differences between RconClient.Players and admin.listPlayers. I'm only searching for extra names in the RconClient.Players because that's where the problem is happening.

Timiz0r wrote Nov 7, 2011 at 8:58 PM

The server I use for testing crashed and lost most of its people, so my testing isn't doing much atm.

However, I believe the bug may be caused when someone leaves just after the RconClient receives the admin.listPlayers all. Since parsing that information takes more time than removing the player with player.onLeave, the player may be accidentally added back into the PlayerCollection. This is the only problem I can think of because the player is automatically removed with RCON's player.onLeave.

I have an idea for a solution that should solve the above problem, assuming that is the problem. I'll keep track of what names come up in player.onJoin and player.onLeave using a HashSet (O(1)). The player will then only be added if it's in that HashSet.

Timiz0r wrote Nov 7, 2011 at 10:38 PM

It turns out my solution won't work because the players that are joining and haven't yet joined won't be able to get added to the HashSet.

My new idea is to use a HashSet to store the names of players that left. These names will be removed when the player joins or at the end of a *listPlayers all.

wrote Nov 8, 2011 at 12:25 AM

Timiz0r wrote Nov 8, 2011 at 12:25 AM

I believe I have fixed the problem. Here's the binary I used. It contains a couple other bug fixes that I haven't check in yet. Let me know how it works :D.

RickardP wrote Nov 8, 2011 at 4:45 AM

Thanks for fix, going to try this binary today, but the server i have is not always players on so can take a while to se if its works.. comming back when i can say more.

Timiz0r wrote Nov 8, 2011 at 4:15 PM

Also, that version has a bug that sends the PlayerJoined event multiple times per player (at least for me), which I fixed in changeset 4861. Both versions should still tell whether or not this bug was fixed.

RickardP wrote Nov 9, 2011 at 5:05 AM

Looks like the bug with playerlist is fixed.

And yes, i getting the joined event more then one time / player.

When do the next version comming out?

I going to release my mobile webinterface application maybe today, should i take the latest code in the repo and release with it?

Timiz0r wrote Nov 9, 2011 at 11:48 AM

Since the only feature I've added lately is adding IPs to players, the library should still be very stable. Since the code in trunk is supposed to contain stable code, I merged the dev code into trunk. The trunk code should be good to go, but I've got a couple more changes to do before I release 3.1.

wrote Nov 9, 2011 at 11:49 AM

wrote Feb 13, 2013 at 5:23 PM

wrote May 15, 2013 at 4:09 AM

wrote May 15, 2013 at 4:09 AM

wrote Jun 12, 2013 at 1:02 AM