Urgent : maxUsers & maxSpectators

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

Moderators: Lapo, Bax

Posts: 131
Joined: 06 Nov 2008, 12:45
Location: Delhi, India

Urgent : maxUsers & maxSpectators

Postby Satyarth » 23 Jan 2013, 18:48

So i want our room capacity to be 300. Now those 300 can be spectators or players.
So i was trying to set maxUsers=300 and maxSpectators=300. But that made my room capacity to be 600. I do not want that.

What settings should i choose ?
Posts: 41
Joined: 12 Apr 2011, 16:18

Re: Urgent : maxUsers & maxSpectators

Postby Devon » 24 Jan 2013, 03:29

If you want 300 total users, you'd probably have to implement something yourself. I'd probably set them both to 300, use the privilege manager prevent the SFS join room requests. Then create a custom extension handler to implement the join-room request the way that you want. For example:

Code: Select all

if( room.userCount() + room.spectatorCount() < 300 ) {
    // Move user to room, remove user from last room, perform other logic
} else {
    // Throw exception
User avatar
Site Admin
Posts: 21647
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Urgent : maxUsers & maxSpectators

Postby Lapo » 24 Jan 2013, 08:20

Before I answer your question I need to warn you that 300 player/watchers in a Room could be way too much for a regular, internet-based game. Unless you have already figured out how to optimize the client updates, firing 300 events for every move of each player is likely to generate too much traffic and the clients won't be able to keep up with it.

Back to your question, players and spectators are two separate entities in a Game Room so you should set a max for each of those.
If you don't need to discriminate between players and watchers then simply do not use a Game Room, use a regular Room instead.
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 28 guests