RoomRemoveMode 2 questions

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

Moderators: Lapo, Bax

User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

RoomRemoveMode 2 questions

Postby mhdside » 25 Jun 2012, 17:02

question 1: Why cannot I set the RoomRemoveMode from the client side (AS3)???????
question 2: I need a RoomRemoveMode that removes the room after its creator leaves it, even if there are other users inside. Is that possible? Or can you SFS team consider adding it?
Mahmoud Badri
Senior actionscript developer
http://www.el3ab.com
User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

Re: RoomRemoveMode 2 questions

Postby mhdside » 25 Jun 2012, 17:13

I would love to see those autoremove modes:
When_Empty: the Room is removed when it is empty
When_Empty_And_Creator_OFFLINE: the Room is removed when empty and its creator goes offline
When_Empty_And_Creator_LEAVE: the Room is removed when empty and its creator leaves it
When_Creator_OFFLINE: the Room is removed when its creator goes offline even if there are other users inside it
When_Creator_LEAVE: the Room is removed when its creator leaves it even if there are other users inside it
Never_Remove: the Room is never auto-removed
Mahmoud Badri

Senior actionscript developer

http://www.el3ab.com
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: RoomRemoveMode 2 questions

Postby rjgtav » 25 Jun 2012, 20:04

Hi.
question 1: Why cannot I set the RoomRemoveMode from the client side (AS3)???????

Well, it's probably for security reasons. If you had the RoomRemoveMode available at the client, you would enable the client to spam the server with rooms which RoomRemoveMode was NEVER_REMOVE, which would sooner or later kill the server.
question 2: I need a RoomRemoveMode that removes the room after its creator leaves it, even if there are other users inside. Is that possible? Or can you SFS team consider adding it?

I don't know if these new modes will be implemented, but in the mean time, you can easily implement them by listening to the USER_LEAVE_ROOM server-side event at the Zone-Level. You can listen to the USER_DISCONNECT event instead if you want to remove the room when it's creator disconnects.
When_Empty_And_Creator_LEAVE: the Room is removed when empty and its creator leaves it

The WHEN_EMPTY remove mode already works for this mode you described, as if the creator is the last user who is joined in that room, if it leaves the room, the room will become empty and so it gets removed for being empty.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 60 guests