Hello!
How to close game room from extension to prevent players join through 'quickJoinGame' ?
Close Game Room
Re: Close Game Room
Under SFS2X you can do this:
This will deny access to all players, until the "active" flag is set back to true.
If you're asking for the old SFS PRO, there isn't a similar mechanism, but it can be "emulated". Can you explain what you're trying to do?
Cheers
Code: Select all
theRoom.setActive(false);
This will deny access to all players, until the "active" flag is set back to true.
If you're asking for the old SFS PRO, there isn't a similar mechanism, but it can be "emulated". Can you explain what you're trying to do?
Cheers
Re: Close Game Room
Hi Lapo.
I need somehow to prevent players to join room when some conditions went true. And i think 'setActive' will fit my requirements.
But you said that room will become 'inactive', it means that this room will not receive any events/requests?
Thanks!
I need somehow to prevent players to join room when some conditions went true. And i think 'setActive' will fit my requirements.
But you said that room will become 'inactive', it means that this room will not receive any events/requests?
Thanks!
Re: Close Game Room
Yeah, the inactivation of a Room is useful when no one is inside.
Otherwise I'd recommend using a server-side check. Either:
1) Send you join requests to your Extension and perform the "check logic" there, before joining
or
2) Implement a request filter, which works in a similar manner: by running your custom code before a system request (such as joinRoom) is executed. More on this here:
http://docs2x.smartfoxserver.com/Advanc ... er-filters
Hope it helps
Otherwise I'd recommend using a server-side check. Either:
1) Send you join requests to your Extension and perform the "check logic" there, before joining
or
2) Implement a request filter, which works in a similar manner: by running your custom code before a system request (such as joinRoom) is executed. More on this here:
http://docs2x.smartfoxserver.com/Advanc ... er-filters
Hope it helps
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 26 guests