Page 1 of 1

How do you create a permanent room?

Posted: 08 Jan 2013, 12:56
by Devon
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

Re: How do you create a permanent room?

Posted: 08 Jan 2013, 21:01
by Lapo
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

Re: How do you create a permanent room?

Posted: 08 Jan 2013, 21:17
by Devon
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?

Re: How do you create a permanent room?

Posted: 09 Jan 2013, 09:14
by Lapo
A filter will not do the job for you. You really need an extension as I have indicated in my previous post.