Page 1 of 1

[SOLVED]How to set room auto remove ?

Posted: 10 Apr 2013, 03:39
by lhc1990
I created room from java script client side. How do I set room setting to auto remove when there is no one else ? Here is my code

Code: Select all

var  settings = new SFS2X.Requests.Game.SFSGameSettings(name);
	settings.name = param.invitation.params.roomName;
	settings.maxUsers = 2;
	settings.maxSpectators = 2;
	settings.isPublic = true;
	settings.minPlayersToStartGame = 2;
	settings.isGame = true;
	settings.groupId = 'games';
	settings.leaveLastJoinedRoom = true;
	settings.extension = new SFS2X.Requests.RoomExtension('GameRoom', 'room.game.RoomExtension');
Thanks

Re: How to set room auto remove ?

Posted: 10 Apr 2013, 08:46
by Lapo
On the client side you cannot set the REMOVE behavior. It will always use the default behavior which is explained here:
http://docs2x.smartfoxserver.com/Develo ... chitecture

From the docs:
DEFAULT: this is applied by default if the setting is not provided. In this mode regular Rooms are removed when the Room is empty and it's creator is no longer logged in the Zone. Game Rooms are removed as soon as they are empty.
cheers