public void sendToPlayer(String message) { Log.d(TAG, "SENDTOPLAYER" + message); byte[] mMsgBuf = message.getBytes(); if (mParticipants != null) { for (Participant p : mParticipants) { if (!p.getParticipantId().equals(myId)) { Games.RealTimeMultiplayer.sendUnreliableMessage( mGoogleApiClient, mMsgBuf, mRoomId, p.getParticipantId()); } } } }
@Override public void sendToOnePlayer(String id, String message) { byte[] mMsgBuf = message.getBytes(); Games.RealTimeMultiplayer.sendUnreliableMessage(mGoogleApiClient, mMsgBuf, mRoomId, id); }
public void sendToServer(String message) { byte[] mMsgBuf = message.getBytes(); Games.RealTimeMultiplayer.sendUnreliableMessage( mGoogleApiClient, mMsgBuf, mRoomId, room.getCreatorId()); }