@Override
public void onRoomCreated(int statusCode, Room room) {
.....
// show the waiting room UI
showWaitingRoom(room);
}
the room is created and if the user quit the UI waiting window the leave method cannot really allow leaving the room because roomId = null but the room is created.
Maybe it could be better to get the roomId inside here:
@Override
public void onRoomCreated(int statusCode, Room room) {
Log.d(TAG, "onRoomCreated(" + statusCode + ", " + room + ")");
if (statusCode != GamesStatusCodes.STATUS_OK) {
Log.e(TAG, "*** Error: onRoomCreated, status " + statusCode);
showGameError();
return;
}
//get room ID
roomId = room.getRoomId();
//
// show the waiting room UI
showWaitingRoom(room);
}
rather than within public void onConnectedToRoom(Room room) method.
Hi notice that there is a bug in ButtonClicker example:
Games.RealTimeMultiplayer.leave gets called only if mRoomId is not null:
but at this point:
the room is created and if the user quit the UI waiting window the leave method cannot really allow leaving the room because roomId = null but the room is created.
Maybe it could be better to get the roomId inside here:
rather than within
public void onConnectedToRoom(Room room)
method.