private String getServerID() {
   String serverID = myId;
   for (Participant p : mParticipants) {
     if (p.getParticipantId().compareTo(serverID) < 0) serverID = p.getParticipantId();
   }
   return serverID;
 }
  public void sendToPlayerReliable(String message) {
    Log.d(TAG, "SENDRELIABLE" + message);
    byte[] mMsgBuf = message.getBytes();

    if (mParticipants != null) {
      for (Participant p : mParticipants) {
        if (!p.getParticipantId().equals(myId)) {
          Games.RealTimeMultiplayer.sendReliableMessage(
              mGoogleApiClient, null, mMsgBuf, mRoomId, p.getParticipantId());
        }
      }
    }
  }
Example #3
0
  static Participant c(TurnBasedMatch var0, String var1) {
    ArrayList var4 = var0.getParticipants();
    int var3 = var4.size();

    for (int var2 = 0; var2 < var3; ++var2) {
      Participant var5 = (Participant) var4.get(var2);
      if (var5.getParticipantId().equals(var1)) {
        return var5;
      }
    }

    throw new IllegalStateException(
        "Participant " + var1 + " is not in match " + var0.getMatchId());
  }
Example #4
0
  static String b(TurnBasedMatch var0, String var1) {
    ArrayList var6 = var0.getParticipants();
    int var3 = var6.size();

    for (int var2 = 0; var2 < var3; ++var2) {
      Participant var4 = (Participant) var6.get(var2);
      Player var5 = var4.getPlayer();
      if (var5 != null && var5.getPlayerId().equals(var1)) {
        return var4.getParticipantId();
      }
    }

    return null;
  }
    static int a(TurnBasedMatch turnbasedmatch, String s)
    {
        ArrayList arraylist = turnbasedmatch.getParticipants();
        int j = arraylist.size();
        for (int i = 0; i < j; i++)
        {
            Participant participant = (Participant)arraylist.get(i);
            if (participant.getParticipantId().equals(s))
            {
                return participant.getStatus();
            }
        }

        throw new IllegalStateException((new StringBuilder()).append("Participant ").append(s).append(" is not in match ").append(turnbasedmatch.getMatchId()).toString());
    }
 private boolean isServer() {
   for (Participant p : mParticipants) {
     if (p.getParticipantId().compareTo(myId) < 0) return false;
   }
   return true;
 }