i am trying to build a real time multi-player game and now i am exploring sample game provided by google for multi-player. Link is ...
https://github.com/playgameservices/android-samples/tree/master/ButtonClicker
issue is that when i change auto-match criteria configuration as per my requirement
void startQuickGame() {
final int MIN_OPPONENTS = 1, MAX_OPPONENTS = 3;
Bundle autoMatchCriteria = RoomConfig.createAutoMatchCriteria(MIN_OPPONENTS,
MAX_OPPONENTS, 0);
RoomConfig.Builder rtmConfigBuilder = RoomConfig.builder(this);
rtmConfigBuilder.setMessageReceivedListener(this);
rtmConfigBuilder.setAutoMatchCriteria(autoMatchCriteria);
rtmConfigBuilder.setRoomStatusUpdateListener(this);
getGamesClient().createRoom(rtmConfigBuilder.build());
}
then this code not wait for 3rd or 4rh player in room (as i set in MAX_OPPONENTS ) and game starts immediately with 2 player(1 opponent). i want to add timer here and game starts after that specified time.
and surprisingly after room creation MIN_PLAYER value dose'nt work at all in this code that is for default room UI.
final int MIN_PLAYERS = 2;
Intent i = getGamesClient().getRealTimeWaitingRoomIntent(room, MIN_PLAYERS);
// show waiting room UI
startActivityForResult(i, RC_WAITING_ROOM);
my requirement is that after room creation i want to wait for a specific time and then game starts with joined player. no matter they are 2 , 3 or 4.