Page 1 of 2

room list player count showing -1

Posted: 08 Jun 2010, 15:48
by udikantz
Hey,

We have a problem with our game. in some cases the room list sent from the server can send incorrect number of users playing in the room.
how this scenario is possible at all, i cannot reproduce this my self yet. would like to hear your opinion of what may cause such a thing

Image

Posted: 08 Jun 2010, 18:18
by Lapo
Never seen or heard of a similar problem before. Looks very strange.
Without any details its quite difficult to help.
Quick tip: if you check that Room with the AdminTool does it report the same negative value?

What Server version are you using?

Posted: 10 Jun 2010, 08:09
by udikantz
it rarely happens,
i'll have to wait for it to happen again and i will check with the admin tool.
yet a doubt its a client problem , because all i do is get parameters from the server and display them.

the server version is 1.6.8

Posted: 15 Jun 2010, 01:33
by udikantz
Look below in room id 69, the admin tool shows a correct player amount (4) but incorrect spectator amount -1. however the room list shows 5\5 players. which is incorrect.



[URL=http://img517.imageshack.us/i/bugggg.png/]Image

i made sure that the data from the screen shoot is updated
really don't know where to look for.
any ideas what can cause this?

server version is 1.68

Posted: 15 Jun 2010, 06:55
by Lapo
Thanks for the info. We filed the issue under our bug database.
As I said it's the first time we hear about this and without a way to recreate it is not easy to say where the problem could be.

We could suspect a synchronization problem in the Room Manager but this doesn't explain how come we've never seen this before or no others are complaining about a similar issue...

What's you average traffic?
Is your server very busy in terms of CPU utilization during the peak hours?
How often does the problem appear?

Posted: 17 Jun 2010, 06:54
by udikantz
Lapo wrote:Thanks for the info. We filed the issue under our bug database.
As I said it's the first time we hear about this and without a way to recreate it is not easy to say where the problem could be.

We could suspect a synchronization problem in the Room Manager but this doesn't explain how come we've never seen this before or no others are complaining about a similar issue...

What's you average traffic?
Is your server very busy in terms of CPU utilization during the peak hours?
How often does the problem appear?
currently when i look in the admin tool:
AVG data in 1MB , AVG data OUT - 120kb
the server is very low cpu. never seen goes above 3% cpu. with maximum connections of 77 clients.

this problems seems to happen when the server is up 2 days. or less. with not restart.

i can tell you that in the server code we call switchPlayer / switchSpectatir manually. even if we have a problem in the code don't see how we get negative values in the spectator count or player count.

Posted: 17 Jun 2010, 08:14
by Lapo
Thanks, this could help a bit.
Evidently it's not a concurrency problem because traffic is too low.
I will add a note about the SwitchPlayer/SwitchSpectator in the bug report to see if one us can find a way to reproduce it.

Posted: 24 Jun 2010, 23:15
by udikantz
Hey,
I have installed the patch that you have sent me, it seems like the bug still exist.
this time i didn't find any negative player count but i have seen a few rooms that have 2 players in. and the sfs report for 3 players in the room.
(wrong player count). let me know how can i assist you finding the bug.
thanks.

EDIT:

just woke up and found out that theres also negative player count.
so the patch i have received did not solve anything yet

Posted: 18 Jul 2010, 06:25
by shlomi
hi udikantz (Udi??) ,

did you found some solution for that? i have the same problem. in the clients i have -1 in the players amount, the Admin tool showing 0 and if i sit with user (became a player) and raise form seat (became a spectator) the Admin tool stack on 1 players and not change it back to 0.

also, the room stack with 1 spectator even it's empty.

as you said, my server running about 3 days without restart and i'm using manually switching to spectator / player.

thanks.

Shlomi.

Posted: 19 Jul 2010, 06:37
by Lapo
Download and install this patch

Requirements:
SFS 1.6.8 is required.

Installation:
stop the server if it's running
backup your {sfs-folder}/Server/lib/jysfs.jar
copy the new jar to {sfs-folder}/Server/lib/ and rename it to jysfs.jar
start the server.

thank you

Posted: 19 Jul 2010, 08:44
by shlomi
but my server is version 1.6.6.. do this patch good for it as well?

Posted: 19 Jul 2010, 17:31
by Lapo
Apply 1.6.8 first, then use the one provided here.

Posted: 20 Jul 2010, 11:18
by shlomi
hi Lapo.

i did all of what you said:
1. i download the 1.6.8 patch and copied (replaced) the files under the server folder to Server/libs.
2. i re-include the folder "Flash API" on my client (Flex) with the new one that you providing in the 1.6.8 patch.

now, i have a new weird problem, when a game started (mean, i'm changing couple of room variables to indicate the users that the game has started), i can't get the value on room variables, for instance i have a room variables that call "gameIsActive" in the admin control i can see that it's true but when i check it's value on the server, the room variables it self is not null but his value via getBooleanValue function is always false , like that:

Code: Select all

public static getIsActiveGame(Room sfsRoom){
    if(sfsRoom.getVariable("gameIsActive") != null){
        return  sfsRoom.getVariable("gameIsActive").getBooleanValue();
    }
    return false;
}
it's returning me false!!

do something has changed on the 1.6.8 with the room variables environment?

P.S. i seeing in the eclipse toolTip that the function getBooleanValue is belong to UserVarible ,so maybe you made this kind of change in the 1.6.8 version, if you did, how i can get a Boolean value from a roomVariable now?

thanks

Shlomi.

EDIT: also, some other weird issue happened, the room users amount start decrease "automatically" in some point (i didn't figured when yet) from the real amount to the minus of the max spectators that this room allowed, for example: if the room has max 50 spectator and i have 4 players in the room, in some point, this amount (4) start decrease till -49 and stop.. BTW, i think the 4 is also the max players that this room allowed. when i went back to 1.6.6 it's stopped occurring! (also the first issue above)

Posted: 22 Jul 2010, 07:29
by Lapo
If you have followed my steps you should be running 1.6.9, not 1.6.8
As regards the Room Variables. Do you set and read the variables only from server side?

Posted: 22 Jul 2010, 09:46
by shlomi
oh..

the file on your link (jysfs_169_05.jar) is not the file on the web site (http://www.smartfoxserver.com/products/ ... d.php?d=89) that indicate to the 1.6.8 version.
also, i didn't found any mention to the 1.6.9 version on this page (the SFS download page)

I'll try to update this file (jysfs_169_05.jar) and will let you know if problems will occur..

thanks..

Shlomi