Hello,
Imagine I joined various rooms.
Imagine I want to create a new game room and join it, and I want to leave another game room, which is not the last one I joined.
Using joinRoom(), I can specify which room I am coming from, so that I can leave that room, and remain in the other rooms.
Is there a way to do it with createRoom()?
In a few words: when I create a new game room with exitCurrentRoom:true, is there a way to specify which room I want to exit?
Apparently, it leaves only the last room I joined...
thx!!!
createRoom() - Specify which room to leave
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
In a few words: when I create a new game room with exitCurrentRoom:true, is there a way to specify which room I want to exit?
No, you will leave the current room, in other words the last one
Also, it seems that I can't get to work smartFox.leaveRoom(roomId)...
Does leaveRoom() have any known limits?
No there aren't limits.
I will do a test and let you know what I've found...
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
I still cant let leaveRoom() work
maybe its becdause of my setup?
here's the drawing:
I am logged in 3 rooms,
room 1 is defined in the config.xml and is the autoJoin() room. And I will remain logged there all the time.
room 2 is logged
room 3 is logged
I want to go into room 4, leaving only rooms 2 and 3
If I go with create-room, it will only leave room 3, but remains joined into room 2.
There is no way to leave room 2
did something like this happen before?
thanks a lot
maybe its becdause of my setup?
here's the drawing:
I am logged in 3 rooms,
room 1 is defined in the config.xml and is the autoJoin() room. And I will remain logged there all the time.
room 2 is logged
room 3 is logged
I want to go into room 4, leaving only rooms 2 and 3
If I go with create-room, it will only leave room 3, but remains joined into room 2.
There is no way to leave room 2
did something like this happen before?
thanks a lot
I would suggest this:
- enter the autoJoin room
- join room 2
- join room 3
Now before going in room 4, leave room 2 and 3 (with leave room), then create the new room and join it
Alternatively: before going in room 4, leave room 2 and create room 4 passing the exitCurrent = true (which will make you leave the last room = room 3)
Let me know if it helps
- enter the autoJoin room
- join room 2
- join room 3
Now before going in room 4, leave room 2 and 3 (with leave room), then create the new room and join it
Alternatively: before going in room 4, leave room 2 and create room 4 passing the exitCurrent = true (which will make you leave the last room = room 3)
Let me know if it helps
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Hello Lapo,
I tried in all possible permutations, but there is no way I can let leaveRoom() work
I dont know...
It doesnt leave the autoJoin room, as well as it doesnt leave any other room...
I call it 10 times, and in the admin the user is still in the room...
did something similar ever happen before?
thanks
Filippo
I tried in all possible permutations, but there is no way I can let leaveRoom() work
I dont know...
It doesnt leave the autoJoin room, as well as it doesnt leave any other room...
I call it 10 times, and in the admin the user is still in the room...
did something similar ever happen before?
thanks
Filippo
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Thank you Lapo,
I found a solution anyway, I just disconnect the user and re-connect again...
I keep the "guest_N" name given by server as choosen username so it keeps consistency...
It works now, but really the leaveRoom() which doesn't work remains a mistery...
I don't think it can be a bug in my code since it's very simple... and I tried so many times and in so many ways that a typo is impossible
maybe something in the server configuration on my machine, or related to the type of rooms created, but it doesnt work with any kind of room, static, dynamic, game, non-game, etc.
I hope we find the light
ciao
I found a solution anyway, I just disconnect the user and re-connect again...
I keep the "guest_N" name given by server as choosen username so it keeps consistency...
It works now, but really the leaveRoom() which doesn't work remains a mistery...
I don't think it can be a bug in my code since it's very simple... and I tried so many times and in so many ways that a typo is impossible
maybe something in the server configuration on my machine, or related to the type of rooms created, but it doesnt work with any kind of room, static, dynamic, game, non-game, etc.
I hope we find the light
ciao
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
humm... so this is weird.
I have just did a quick experiment.
My client connects to the autoJoin room plus 2 other rooms.
Then I have on stage 2 buttons: each one makes me leave the 2nd and 3rd room respectively.
Works nicely
Question... do you handle the onRoomLeft() in your app?
If so, after you invoke the leaveRoom ... don't you get the event fired???
If not... are you sure you're passing the correct roomId to the leaveRoom() method.
If you want I can send you my test. It just uses the "simpleChat" zone
I have just did a quick experiment.
My client connects to the autoJoin room plus 2 other rooms.
Then I have on stage 2 buttons: each one makes me leave the 2nd and 3rd room respectively.
Works nicely
Question... do you handle the onRoomLeft() in your app?
If so, after you invoke the leaveRoom ... don't you get the event fired???
If not... are you sure you're passing the correct roomId to the leaveRoom() method.
If you want I can send you my test. It just uses the "simpleChat" zone
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
I am quite sure I did everything nicely... I mean it's a big complex application and everything works fine...
Regarding to room Id, I tried to input it manually, to use the activeRoomId, to use room.getId() directly... I tried so many options that for sure at least once should have worked
I have the onRoomLeft() defined, and it works ok when I create a new room leaving the old one, but doenst get triggered on loaveRoom(), and also on the admin panel, I see that I remain logged in rooms...
Misteries of the worderful world of bugs of new technologies it's probably something related to the server on my local machine then... also if nobody ever found this problem before me, it's probably related to my comp or my app...
Anyway I have no rush now anymore since I found the disconnect/connect workaround...
Thank you very much for your help
Filippo
Regarding to room Id, I tried to input it manually, to use the activeRoomId, to use room.getId() directly... I tried so many options that for sure at least once should have worked
I have the onRoomLeft() defined, and it works ok when I create a new room leaving the old one, but doenst get triggered on loaveRoom(), and also on the admin panel, I see that I remain logged in rooms...
Misteries of the worderful world of bugs of new technologies it's probably something related to the server on my local machine then... also if nobody ever found this problem before me, it's probably related to my comp or my app...
Anyway I have no rush now anymore since I found the disconnect/connect workaround...
Thank you very much for your help
Filippo
2 quick things:
1 - the fact you see the user still in the room from the AdminTool, might be a bug. It's already fixed in the 1.4.0 release candidate.
2 - the fact you don't get the leaveRoom() event is strange and should not depend on your local machine. Unless you have disabled the event with the <DisabledSysEvents> tag in the Zone it should definitely work...
I've done the test with static room and dynamic game rooms, they all work!
1 - the fact you see the user still in the room from the AdminTool, might be a bug. It's already fixed in the 1.4.0 release candidate.
2 - the fact you don't get the leaveRoom() event is strange and should not depend on your local machine. Unless you have disabled the event with the <DisabledSysEvents> tag in the Zone it should definitely work...
I've done the test with static room and dynamic game rooms, they all work!
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 68 guests