room list player count showing -1

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

room list player count showing -1

Post 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
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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?
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post 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
diwip games - co founder & CPO.

http://www.diwip.com
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post 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
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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?
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post 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.
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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.
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post 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
diwip games - co founder & CPO.

http://www.diwip.com
shlomi
Posts: 83
Joined: 21 Feb 2010, 10:38
Location: Israel

Post 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.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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
Lapo
--
gotoAndPlay()
...addicted to flash games
shlomi
Posts: 83
Joined: 21 Feb 2010, 10:38
Location: Israel

Post by shlomi »

but my server is version 1.6.6.. do this patch good for it as well?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Apply 1.6.8 first, then use the one provided here.
Lapo
--
gotoAndPlay()
...addicted to flash games
shlomi
Posts: 83
Joined: 21 Feb 2010, 10:38
Location: Israel

Post 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)
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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?
Lapo
--
gotoAndPlay()
...addicted to flash games
shlomi
Posts: 83
Joined: 21 Feb 2010, 10:38
Location: Israel

Post 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
Post Reply