Hi!
I have a problem with leaving room. The process goes like this:
- Connect, login and join to room 1 (success)
- I send public message to room 1 (success)
- Join room 2 without leaving room 1 (success)
- send public message to room 2 (success)
- leave room 2 (fails ->)
- after that I don't get onRoomLeft event, and I can still send messages to room 2
Any ideas what could cause this? Is this a bug or again, am I doing something wrong?
Thanks,
Teemu
[Java] leaveRoom doesn't work?
Ok, I had some faulty code in my application. This room 2 is a dynamic game room, which I first create. Earlier I tried to join that room in onRoomAdded event, because I didn't realize that client joins room automatically after creation.
However, I have exitCurrentRoom set as false in roomProperties, and isGame is set to true. If I put isGame property as false, then the client will stay in room 1 also. Should it work like this?
However, I have exitCurrentRoom set as false in roomProperties, and isGame is set to true. If I put isGame property as false, then the client will stay in room 1 also. Should it work like this?
No. You can still be in game room and another room. For example the following code:
will keep the user in the old room. The only difference between regular and game room is that the user is automatically joined into the game room.
Code: Select all
Map<String, Object> params = new HashMap<String, Object>();
params.put("isGame", true);
params.put("exitCurrentRoom", false);
sfs.createRoom("Test Room", 2, params);
will keep the user in the old room. The only difference between regular and game room is that the user is automatically joined into the game room.
Teemu: just to make things clear
What is written in the API docs is actually correct. The error is that exitCurrent should be exitCurrentRoom. This way it is "aligned" with the Actionscript 2 and 3 API
We will update the Java API very soon, meanwhile you can use exitCurrent as a workaround.
Hope it helps
What is written in the API docs is actually correct. The error is that exitCurrent should be exitCurrentRoom. This way it is "aligned" with the Actionscript 2 and 3 API
We will update the Java API very soon, meanwhile you can use exitCurrent as a workaround.
Hope it helps
Return to “Java2SE / Android Client API”
Who is online
Users browsing this forum: No registered users and 22 guests