本文整理汇总了Java中com.google.android.gms.games.multiplayer.realtime.Room.getRoomId方法的典型用法代码示例。如果您正苦于以下问题:Java Room.getRoomId方法的具体用法?Java Room.getRoomId怎么用?Java Room.getRoomId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.games.multiplayer.realtime.Room
的用法示例。
在下文中一共展示了Room.getRoomId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onConnectedToRoom
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onConnectedToRoom(Room room) {
Log.d(TAG, "onConnectedToRoom.");
//get participants and my ID:
mParticipants = room.getParticipants();
mMyId = room.getParticipantId(Games.Players.getCurrentPlayerId(mGoogleApiClient));
// save room ID if its not initialized in onRoomCreated() so we can leave cleanly before the game starts.
if(mRoomId==null)
mRoomId = room.getRoomId();
// print out the list of participants (for debug purposes)
Log.d(TAG, "Room ID: " + mRoomId);
Log.d(TAG, "My ID " + mMyId);
Log.d(TAG, "<< CONNECTED TO ROOM>>");
}
示例2: onRoomCreated
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onRoomCreated(int statusCode, Room room) {
Log.d("ROOM", "onRoomCreated(" + statusCode + ", " + room + ")");
if (statusCode != GamesCallbackStatusCodes.OK) {
Log.e("ROOM", "*** Error: onRoomCreated, status " + statusCode);
showGameError();
return;
}
creator = true;
// save room ID so we can leave cleanly before the game starts.
mRoomId = room.getRoomId();
SpaceRace.messageManager.setRoom(room);
// show the waiting room UI
showWaitingRoom(room);
}
示例3: onConnectedToRoom
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onConnectedToRoom(Room room) {
Log.d("ROOM", "onConnectedToRoom.");
//get participants and my ID:
mParticipants = room.getParticipants();
mMyId = room.getParticipantId(mPlayerId);
// save room ID if its not initialized in onRoomCreated() so we can leave cleanly before the game starts.
if (mRoomId == null) {
mRoomId = room.getRoomId();
}
// print out the list of participants (for debug purposes)
Log.d("ROOM", "Room ID: " + mRoomId);
Log.d("ROOM", "My ID " + mMyId);
Log.d("ROOM", "<< CONNECTED TO ROOM>>");
}
示例4: onConnectedToRoom
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onConnectedToRoom(Room room) {
Log.d(TAG, "onConnectedToRoom.");
//get participants and my ID:
participants = room.getParticipants();
myId = room.getParticipantId(Games.Players.getCurrentPlayerId(googleApiClient));
// save room ID if its not initialized in onRoomCreated() so we can leave cleanly before the game starts.
if (roomId == null) roomId = room.getRoomId();
// print out the list of participants (for debug purposes)
Log.d(TAG, "Room ID: " + roomId);
Log.d(TAG, "My ID " + myId);
Log.d(TAG, "<< CONNECTED TO ROOM>>");
}
示例5: onConnectedToRoom
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onConnectedToRoom(Room room) {
Log.d(LOG_TAG, "onConnectedToRoom.");
// get room ID, participants and my ID:
mRoomId = room.getRoomId();
mParticipants = room.getParticipants();
mMyId = room.getParticipantId(Games.Players.getCurrentPlayerId(mGoogleApiClient));
// print out the list of participants (for debug purposes)
Log.d(LOG_TAG, "Room ID: " + mRoomId);
Log.d(LOG_TAG, "My ID " + mMyId);
Log.d(LOG_TAG, "Is mParticipants null " + (mParticipants == null));
Log.d(LOG_TAG, "<< CONNECTED TO ROOM>>");
}
示例6: onConnectedToRoom
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onConnectedToRoom(Room room) {
Log.d(TAG, "onConnectedToRoom.");
// get room ID, participants and my ID:
mRoomId = room.getRoomId();
mParticipants = room.getParticipants();
mMyId = room.getParticipantId(Games.Players.getCurrentPlayerId(getApiClient()));
// print out the list of participants (for debug purposes)
//Log.d(TAG, "Room ID: " + mRoomId);
//Log.d(TAG, "My ID " + mMyId);
//Log.d(TAG, "<< CONNECTED TO ROOM>>");
gmsGameVariantNumber = room.getVariant();
if(isServer()) {
imFirstType = -1;
sendFirstTypeForStart();
}
sendMyStats();
}
示例7: onConnectedToRoom
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onConnectedToRoom(Room room) {
Log.d(TAG, "onConnectedToRoom.");
//get participants and my ID:
mParticipants = room.getParticipants();
mMyId = room.getParticipantId(mPlayerId);
// save room ID if its not initialized in onRoomCreated() so we can leave cleanly before the game starts.
if (mRoomId == null) {
mRoomId = room.getRoomId();
}
// print out the list of participants (for debug purposes)
Log.d(TAG, "Room ID: " + mRoomId);
Log.d(TAG, "My ID " + mMyId);
Log.d(TAG, "<< CONNECTED TO ROOM>>");
}
示例8: onRoomCreated
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@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;
}
// save room ID so we can leave cleanly before the game starts.
mRoomId = room.getRoomId();
// show the waiting room UI
showWaitingRoom(room);
}
示例9: onRoomCreated
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onRoomCreated(int statusCode, Room room) {
Log.d(TAG, "onRoomCreated: ");
switch (statusCode) {
case STATUS_OK:
currentRoomId = room.getRoomId();
showWaitingRoom(room);
break;
case STATUS_CLIENT_RECONNECT_REQUIRED:
signIn();
break;
default:
}
}
示例10: onJoinedRoom
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onJoinedRoom(int statusCode, Room room) {
Log.d(TAG, "onJoinedRoom: ");
switch (statusCode) {
case STATUS_OK:
currentRoomId = room.getRoomId();
showWaitingRoom(room);
break;
case STATUS_CLIENT_RECONNECT_REQUIRED:
signIn();
break;
default:
}
}
示例11: onRoomCreated
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@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;
}
// save room ID so we can leave cleanly before the game starts.
roomId = room.getRoomId();
// show the waiting room UI
showWaitingRoom(room);
}
示例12: onConnectedToRoom
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onConnectedToRoom(Room room) {
Gdx.app.log("multi","onConnectedToRoom - RoomID:"+room.getRoomId());
callback.roomId = room.getRoomId();
callback.setMyId(room);
callback.updateRoomProperties(room);
}
示例13: onJoinedRoom
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onJoinedRoom(int statusCode, Room room) {
if (statusCode != GamesStatusCodes.STATUS_OK) {
Toast.makeText(getApplicationContext(), "Error joining room. Error Code : ", Toast.LENGTH_SHORT).show();
return;
}
mRoomId = room.getRoomId();
// get waiting room intent
Intent i = Games.RealTimeMultiplayer.getWaitingRoomIntent(gameHelper.getApiClient(), room, 2);
startActivityForResult(i, RC_WAITING_ROOM);
}
示例14: onRoomCreated
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onRoomCreated(int statusCode, Room room) {
if (statusCode != GamesStatusCodes.STATUS_OK) {
Toast.makeText(getApplicationContext(), "Error creating room. Error Code : " + String.valueOf(statusCode), Toast.LENGTH_SHORT).show();
return;
}
mRoomId = room.getRoomId();
// get waiting room intent
Intent i = Games.RealTimeMultiplayer.getWaitingRoomIntent(gameHelper.getApiClient(), room, 2);
startActivityForResult(i, RC_WAITING_ROOM);
}
示例15: onRoomConnected
import com.google.android.gms.games.multiplayer.realtime.Room; //导入方法依赖的package包/类
@Override
public void onRoomConnected(int i, Room room) {
// Todos los usuarios están conectados
mRoomId = room.getRoomId();
// Calculamos quien va empezar
parcitipants = room.getParticipantIds();
creatorID = parcitipants.get(0);
myID = room.getParticipantId(Games.Players.getCurrentPlayerId(gameHelper.getApiClient()));
}