Page 1 of 1

[help] Create dynamic room

Posted: 14 Mar 2012, 21:31
by htpeng
Hi,
I have some problems creating dynamic room.

Code: Select all

var settings:RoomSettings = new RoomSettings("Room");
settings.maxUsers = 6;
sfs.addEventListener(SFSEvent.ROOM_ADD, onRoomAdded);
sfs.addEventListener(SFSEvent.ROOM_CREATION_ERROR, onRoomCreationError);
sfs.send(new CreateRoomRequest(settings));
there are also function onRoomAdded and onRoomCreationError in my code, but when I tried to create the room, none of the events are sent back. Nothing seems wrong in my code. What could be my problem?


Also, I have a question. If I create a room from Zone Configurator, it will always be inside a zone. But, if create a room using code (dynamically), I don't have to set what zone it belongs to. So, I wonder what zone it belongs to if I create it dynamically? And can I monitor the room I created dynamically in the Zone Monitor?


Please reply :)
Regards,

Re: [help] Create dynamic room

Posted: 15 Mar 2012, 05:24
by itsmylifesoham
hi,

first the answer to your 2nd Question : when you connect to smartfoxserver instance you had sent a loginrequest to some zone right? now after you are successfully logged into that zone you are sending a createroomrequest, so the room will get created in the same zone in which you are currently logged into.

now since you are not getting any of the two events and you asked the second Question, i am kinda in doubt if you are logged into a zone before you send the createroomrequest, if no then nothing will be fired on the client as you are not connected to server yet.

now the 3rd Question : well even i couldnt monitor the dynamic rooms and the users inside them from the zone monitor, so i dont think its possible from admin tool. only static rooms can be monitored from admin tool.

Re: [help] Create dynamic room

Posted: 15 Mar 2012, 07:06
by htpeng
Well, I didn't know if the zone would be automatically the one I logged in to. But, I have logged into a zone before I create the room. I do put it in a SFSEvent.LOGIN event to make sure it's logged successfully.
Is there any other issues that could possibly make it failed to create?
note : I logged in using guest, and the zone allow guest user


Thanks for your answers anyway :)

Re: [help] Create dynamic room

Posted: 15 Mar 2012, 07:17
by itsmylifesoham
ok i would like you to do this...

let the createroomrequest be sent to the server.
now two things might be happening :

1. room failed to create ...
2. room was created but you were not notified

after sending the request please see the latest server log txt file in your logs folder in the sfs directory... if you could paste the last traces from that file or attach it, it will help as the server will log errors while creating rooms, and if rooms get created it will also log traces like "room created" this will help us to know if your room is actually getting created.