Page 1 of 1

Cannot create Room dynamically

Posted: 23 May 2012, 13:34
by psych
Hi,

I am trying to create Room dynamically. My idea is to create a game Room for every two players connected previously by invitations. However, when i try to create a room this way:

Code: Select all

sfs.addEventListener(SFSEvent.ROOM_ADD, onGameRoomCreated);
sfs.addEventListener(SFSEvent.ROOM_CREATION_ERROR, onGameRoomCreationError);

var gameRoomSettings:RoomSettings = new RoomSettings("Game");
gameRoomSettings.maxUsers = 2;
gameRoomSettings.isGame = true;
sfs.send(new CreateRoomRequest(gameRoomSettings));	

private function onGameRoomCreated(event:SFSEvent):void
{
	trace("[SmartFoxConnector] A Game room was added: " + event.params.room );		
}
		
		
private function onGameRoomCreationError(evt:SFSEvent):void
{
	trace("[SmartFoxConnector] An error occurred while attempting to create the Game room: " + evt.params.errorMessage);
}
Niether onGameRoomCreated or onGameRoomCreationError event listener gets fired and i don't know what could be the problem? I would appreciate any help i can get on this?

I checked in andmin interface that room name is ok and although the user that's creating this room is with Guest privillege i checked in Smartfoxserver 2X Admin interface that he has room creation privillege but maybe i am missing something? It's strange that i get no error or any notice?

Thanks in advance!

Re: Cannot create Room dynamically

Posted: 24 May 2012, 09:07
by Bax
We can assure you that it works :)
You must be doing something wrong. What about the Admin Tool? Do you see the room being created? Any server-side error?