Close Game Room

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

KVADRO
Posts: 7
Joined: 05 Jan 2018, 22:13

Close Game Room

Postby KVADRO » 07 Jan 2018, 17:18

Hello!
How to close game room from extension to prevent players join through 'quickJoinGame' ?
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Close Game Room

Postby Lapo » 08 Jan 2018, 08:50

Under SFS2X you can do this:

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
Lapo
--
gotoAndPlay()
...addicted to flash games
KVADRO
Posts: 7
Joined: 05 Jan 2018, 22:13

Re: Close Game Room

Postby KVADRO » 08 Jan 2018, 10:43

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!
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Close Game Room

Postby Lapo » 08 Jan 2018, 14:39

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
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 13 guests