当前位置: 首页>>代码示例>>Java>>正文


Java Room.getRoomId方法代码示例

本文整理汇总了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>>");
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:18,代码来源:Example.java

示例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);
}
 
开发者ID:Augugrumi,项目名称:SpaceRace,代码行数:19,代码来源:AbsRoomActivity.java

示例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>>");
}
 
开发者ID:Augugrumi,项目名称:SpaceRace,代码行数:19,代码来源:AbsRoomActivity.java

示例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>>");
}
 
开发者ID:kloder-games,项目名称:godot-gpgs,代码行数:17,代码来源:RealTimeMultiplayer.java

示例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>>");
}
 
开发者ID:TylerCarberry,项目名称:2048-Battles,代码行数:17,代码来源:MultiplayerActivity.java

示例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();
}
 
开发者ID:spdd,项目名称:chessonline,代码行数:22,代码来源:DroidFish.java

示例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>>");
}
 
开发者ID:playgameservices,项目名称:android-basic-samples,代码行数:19,代码来源:MainActivity.java

示例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);
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:16,代码来源:Example.java

示例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:
    }
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:15,代码来源:AndroidNetworkService.java

示例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:
    }
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:15,代码来源:AndroidNetworkService.java

示例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);
}
 
开发者ID:kloder-games,项目名称:godot-gpgs,代码行数:16,代码来源:RealTimeMultiplayer.java

示例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);
}
 
开发者ID:SpaceGame-ETSII,项目名称:spacegame,代码行数:8,代码来源:RoomStatusUpdate.java

示例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);
}
 
开发者ID:CODA-Masters,项目名称:Pong-Tutorial,代码行数:13,代码来源:AndroidLauncher.java

示例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);
}
 
开发者ID:CODA-Masters,项目名称:Pong-Tutorial,代码行数:14,代码来源:AndroidLauncher.java

示例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()));
}
 
开发者ID:CODA-Masters,项目名称:Pong-Tutorial,代码行数:13,代码来源:AndroidLauncher.java


注:本文中的com.google.android.gms.games.multiplayer.realtime.Room.getRoomId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。