Об этом нет. Мне пришлось закодировать некоторые java. это то, что я вложил в свою java-библиотеку, если кто-то может извлечь из этого выгоду.
package cometsoft.com.roomconfiglib;
import
com.google.android.gms.games.multiplayer.realtime.OnRealTimeMessageReceivedListener;
import com.google.android.gms.games.multiplayer.realtime.RealTimeMessage;
import com.google.android.gms.games.multiplayer.realtime.Room;
import com.google.android.gms.games.multiplayer.realtime.RoomConfig;
import com.google.android.gms.games.multiplayer.realtime.RoomStatusUpdateCallback;
import com.google.android.gms.games.multiplayer.realtime.RoomUpdateCallback;
import android.os.Bundle;
import android.support.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
interface RoomConfigListener {
public abstract void onRoomConnecting(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room);
public abstract void onRoomAutoMatching(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room);
public abstract void onPeerInvitedToRoom(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room,
@android.support.annotation.NonNull java.util.List<java.lang.String> list);
public abstract void onPeerDeclined(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room,
@android.support.annotation.NonNull java.util.List<java.lang.String> list);
public abstract void onPeerJoined(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room,
@android.support.annotation.NonNull java.util.List<java.lang.String> list);
public abstract void onPeerLeft(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room,
@android.support.annotation.NonNull java.util.List<java.lang.String> list);
public abstract void onConnectedToRoom(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room);
public abstract void onDisconnectedFromRoom(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room);
public abstract void onPeersConnected(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room,
@android.support.annotation.NonNull java.util.List<java.lang.String> list);
public abstract void onPeersDisconnected(@android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room,
@android.support.annotation.NonNull java.util.List<java.lang.String> list);
public abstract void onP2PConnected(@android.support.annotation.NonNull
java.lang.String s);
public abstract void onP2PDisconnected(@android.support.annotation.NonNull
java.lang.String s);
public abstract void onRoomCreated(int i, @android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room);
public abstract void onJoinedRoom(int i, @android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room);
public abstract void onLeftRoom(int i, @android.support.annotation.NonNull
java.lang.String s);
public abstract void onRoomConnected(int i, @android.support.annotation.Nullable
com.google.android.gms.games.multiplayer.realtime.Room room);
void onRealTimeMessageReceived(@android.support.annotation.NonNull
com.google.android.gms.games.multiplayer.realtime.RealTimeMessage
realTimeMessage);
}
public class RoomConfigBuilder {
private RoomConfigListener mRoomConfigListener;
private Bundle mautoMatchCriteria;
private RoomUpdateCallback mRoomUpdateCallback = new RoomUpdateCallback() {
@Override
public void onRoomCreated(int statusCode, Room room) {
mRoomConfigListener.onRoomCreated(statusCode, room);
}
@Override
public void onRoomConnected(int statusCode, Room room) {
mRoomConfigListener.onRoomConnected(statusCode, room);
}
@Override
public void onJoinedRoom(int statusCode, Room room) {
mRoomConfigListener.onJoinedRoom(statusCode, room);
}
@Override
public void onLeftRoom(int statusCode, @NonNull String roomId) {
mRoomConfigListener.onLeftRoom(statusCode, roomId);
}
};
private RoomStatusUpdateCallback mRoomStatusUpdateCallback = new
RoomStatusUpdateCallback() {
@Override
public void onConnectedToRoom(Room room) {
mRoomConfigListener.onConnectedToRoom(room);
}
@Override
public void onDisconnectedFromRoom(Room room) {
mRoomConfigListener.onDisconnectedFromRoom(room);
}
@Override
public void onPeerDeclined(Room room, @NonNull List<String> arg1) {
mRoomConfigListener.onPeerDeclined(room, arg1);
}
@Override
public void onPeerInvitedToRoom(Room room, @NonNull List<String> arg1) {
mRoomConfigListener.onPeerInvitedToRoom(room, arg1);
}
@Override
public void onP2PDisconnected(@NonNull String participant) {
mRoomConfigListener.onP2PDisconnected(participant);
}
@Override
public void onP2PConnected(@NonNull String participant) {
mRoomConfigListener.onP2PConnected(participant);
}
@Override
public void onPeerJoined(Room room, @NonNull List<String> arg1) {
mRoomConfigListener.onPeerJoined(room, arg1);
}
@Override
public void onPeerLeft(Room room, @NonNull List<String> peersWhoLeft) {
mRoomConfigListener.onPeerLeft(room, peersWhoLeft);
}
@Override
public void onRoomAutoMatching(Room room) {
mRoomConfigListener.onRoomAutoMatching(room);
}
@Override
public void onRoomConnecting(Room room) {
mRoomConfigListener.onRoomConnecting(room);
}
@Override
public void onPeersConnected(Room room, @NonNull List<String> peers) {
mRoomConfigListener.onPeersConnected(room, peers);
}
@Override
public void onPeersDisconnected(Room room, @NonNull List<String> peers) {
mRoomConfigListener.onPeersDisconnected(room, peers);
}
};
private OnRealTimeMessageReceivedListener mOnRealTimeMessageReceivedListener =
new OnRealTimeMessageReceivedListener() {
@Override
public void onRealTimeMessageReceived(@NonNull RealTimeMessage
realTimeMessage) {
mRoomConfigListener.onRealTimeMessageReceived(realTimeMessage);
}
};
public RoomConfig BuildRoomConfig(RoomConfigListener listener, Bundle
autoMatchCriteria, ArrayList<String> invitees, String invitationId) {
mRoomConfigListener = listener;
mautoMatchCriteria = autoMatchCriteria;
RoomConfig.Builder mRoomConfigBuilder;
mRoomConfigBuilder =
RoomConfig.builder(mRoomUpdateCallback)
.setRoomStatusUpdateCallback(mRoomStatusUpdateCallback)
.setOnMessageReceivedListener(mOnRealTimeMessageReceivedListener);
if (invitees != null){
mRoomConfigBuilder.addPlayersToInvite(invitees);
}
if (autoMatchCriteria != null){
mRoomConfigBuilder.setAutoMatchCriteria(mautoMatchCriteria);
}
if (invitationId != null){
mRoomConfigBuilder.setInvitationIdToAccept(invitationId);
}
return mRoomConfigBuilder.build();
}
}