java - Room - getUserCount vs howManyUsers

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

Moderators: Lapo, Bax

Menser
Posts: 111
Joined: 13 Nov 2007, 18:32

java - Room - getUserCount vs howManyUsers

Postby Menser » 23 Aug 2008, 15:19

Hey-

Quick question, in the server side java api i see getUserCount and howManyUsers.

What is the difference, if i go by there names, they would appear to be the same. They also both return an int. howManyUsers lacks a description in the docs though....

Thanks
_-Menser-_
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 26 Aug 2008, 12:31

howManyUsers is older and it's being dropped in favor of getUserCount. It's going to be deprecated.

Btw, thanks for noticing it's been there for a while :)
Lapo
--
gotoAndPlay()
...addicted to flash games
rockycaam
Posts: 14
Joined: 08 Jan 2009, 19:47
Contact:

Postby rockycaam » 29 Jan 2009, 14:45

Does getUserCount return a list of all players and spectators or only players?

The description says:

getUserCount

public int getUserCount()

Returns:
The number of clients in this room
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 29 Jan 2009, 15:57

getUserCount(): returns the number of users, not spectators (in case of game rooms)
getSpectatorCount(): returns the number of spectators (in case of game rooms)
howManyUsers(): return the total amount of users + spectators

hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 44 guests