I am trying to implement a real-time multiplayer in my Android game using
the Google Play Games Services but I am facing an issue when the onRoomCreated
method, that I overrided, is called.
@Override
public void onRoomCreated(int statusCode, Room room) {
if (statusCode != GamesStatusCodes.STATUS_OK) {
stopKeepingScreenOn();
showGameError();
return;
}
roomId = room.getRoomId();
showWaitingRoom(room);
}
The status code is always different of GamesStatusCodes.STATUS_OK
and actually equal to 2 (+ the room
parameter is null), which means according to Google :
The GoogleApiClient is in an inconsistent state and must reconnect to the service to resolve the issue. Further calls to the service using the current connection are unlikely to succeed.
But there is no change if I call getApiClient().reconnect()
. So I would really appreciate any help. For information, getApiClient()
comes from the GameHelper
class that I extend and which is provided in the library from the Android samples page.