Get how many users in a zone

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Ninjaoninja2
Posts: 204
Joined: 22 Sep 2013, 23:33

Get how many users in a zone

Postby Ninjaoninja2 » 21 May 2021, 17:15

Hi there,

I have altered the login phase slightly where a user logs in, and then they're logged into a "hub" zone, from there on the client, they can select another zone out of a list of other zones.

What I'm wanting to do, is expose to the users how many users are in that zone, out of how many are allowed in the zone. (Ex. 100 users/1000 users)
I know you can get a room count, but I was wondering if there was a way to get a zone count returned either client side, or perhaps on the server side in an extension that I can then send to the client.
If you it's possible to get the zone count, I'm just looking for some help in finding the best approach to do that.

Thanks.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Get how many users in a zone

Postby Lapo » 21 May 2021, 19:27

Hi,
on the server side every Zone object has a getUserCount() method.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Ninjaoninja2
Posts: 204
Joined: 22 Sep 2013, 23:33

Re: Get how many users in a zone

Postby Ninjaoninja2 » 25 May 2021, 03:14

Lapo wrote:Hi,
on the server side every Zone object has a getUserCount() method.

Cheers

Perfect! Exactly what I was looking for. I knew I was missing something. Thanks!

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 61 guests