Auto-Destroy Rooms created by sfsExtensons

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

Moderators: Lapo, Bax

suvroz
Posts: 12
Joined: 16 Mar 2010, 09:37

Auto-Destroy Rooms created by sfsExtensons

Postby suvroz » 13 Aug 2010, 07:09

Hi,

I am creating room using extension using the below code:

var roomObj = {}
roomObj.name = roomname
roomObj.maxU = 20
roomObj.isGame = "true"
var roomVars = [{name:"wel", val:'welcome to room', priv:false, persistent:true}];
var resRom = _server.createRoom(roomObj, null, true, true,roomVars)

However the room is not getting auto-deleted when there is not user inside the room.

Is there a way to auto delete a room created by an extension where there is no user in that room.

Thanks A ton in advance!
Suvro
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 13 Aug 2010, 07:37

If you set the room ownership (2nd parameter in createRoom method) to null (server-owned), it won't get destroyed automatically where there is no users in the room. If you set the ownership to a user, it will get removed automatically when all users left.

You can however remove server-owned rooms, just that you'll have to create a script in your extension to do so.
Smartfox's forum is my daily newspaper.
suvroz
Posts: 12
Joined: 16 Mar 2010, 09:37

Postby suvroz » 13 Aug 2010, 08:16

Thanks.... It worked like a charm! :D

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 12 guests