How do you create a permanent room?

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

Moderators: Lapo, Bax

Devon
Posts: 41
Joined: 12 Apr 2011, 16:18

How do you create a permanent room?

Postby Devon » 08 Jan 2013, 12:56

I'm trying to make it so that a user may create a room and have it remain there even if it's empty and the owner has disconnected. However, I cannot get the rooms to be persistent.

I wasn't able to find much information on the matter in the 2X documentation. :-/

Thanks,
- Devon
Last edited by Devon on 08 Jan 2013, 21:17, edited 2 times in total.
User avatar
Lapo
Site Admin
Posts: 21228
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How do you create a permanent room?

Postby Lapo » 08 Jan 2013, 21:01

Maybe you are looking in the wrong place. From client side it is simply not possible for security reasons (imagine what would happen if a malicious client would create thousands of them)

From server side there are several ways:
1- Statically, from the AdminTool > ZoneConfigurator or ZoneMonitor
2- Dynamically, from your Extension code. You get to choose the RemoveMode which allows you to decide if a Room is removed and when, with the possibility to not remove it at all.

In the documentation you can read an overview here:
http://docs2x.smartfoxserver.com/Overvi ... chitecture

And you can check the SFSApi class for the CreateRoom method:
http://docs2x.smartfoxserver.com/api-do ... FSApi.html
Lapo
--
gotoAndPlay()
...addicted to flash games
Devon
Posts: 41
Joined: 12 Apr 2011, 16:18

Re: How do you create a permanent room?

Postby Devon » 08 Jan 2013, 21:17

I need the user to be able to create the rooms though, so they have to be dynamically created.

After doing a series of searches, I've finally gathered enough information from older forum posts to see that I need to use a system filter.
I've managed to get it setup and working, but I'm not sure how to alter the room variables. Currently, the filter gets sender and params passed to it. The params are still in their abbreviated form used when sent across the network.

I was able to do params.putUtfString("n", "noodles"); and change the name of newly created rooms to "noodles". However, I need to know how to change it's isDynamic and autoRemoveMode settings.

If I have to create the room myself and return a HALT, how do I 1) replicate the existing privileges system and 2) let the client know if the room was successfully created or not?

---

Or are you suggesting that I send an extension request instead of a normal CreateRoom request and rewrite everything to implement privileges, auto-join, ect?
User avatar
Lapo
Site Admin
Posts: 21228
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How do you create a permanent room?

Postby Lapo » 09 Jan 2013, 09:14

A filter will not do the job for you. You really need an extension as I have indicated in my previous post.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 21 guests