Page 1 of 1

getSpectatorCount() return always 0

Posted: 12 Feb 2007, 18:44
by Alex
Hi
I’m running the latest SFS version 1.5.1b and AS3 API and I have following problem:
A room is created with maxSpectators = 2 and uCount=false. When I join the room as spectator and trace sfs. getSpectatorCount in onJoinRoom() event I get 0 – which I expect to be 1 but when I trace sfs. playerId I get -1 which is correct. Also in onUserEnterRoom event of other users in the room when I trace getSpectatorCount I receive 0, but if iterate trough all users and check their playerId’s I receive correct results.
Also getUserCount is not working properly if I have one user and one spectator getUserCount return 2

Posted: 12 Feb 2007, 21:36
by Lapo
thanks for reporting the problem.
We inspected the problem and there seem to be a bug lurking in there. It seems to be present in the AS 2 API as well and it's probably been there for a long time since it's pretty rare that you call that method, you usually rely on the room count updates which always return the right values.

We'll run a few more tests in the next days and tell you what we have found. The bug should be easy to fix and we'd be able to provide a patch very quickly.

Stay tuned

Posted: 19 Feb 2007, 16:57
by Lapo
A patch was released! Please check this page and let us know if you encounter any problem --> http://forums.smartfoxserver.com/viewtopic.php?p=4808

Posted: 19 Feb 2007, 18:27
by Alex
Hi
Everything is fine now - it looks that you even fixed another bug involving accessing room vars of Boolean type.
10x