RoomConfig

public abstract class RoomConfig extends Object

Configuration for a new room.

Nested Class Summary

class RoomConfig.Builder Builder class for RoomConfig

Protected Constructor Summary

Public Method Summary

static RoomConfig.Builder
builder(RoomUpdateCallback callback)
Creates a builder for assembling a RoomConfig.
static RoomConfig.Builder
builder(RoomUpdateListener listener)
This method was deprecated. use builder(RoomUpdateCallback) instead.
static Bundle
createAutoMatchCriteria(int minAutoMatchPlayers, int maxAutoMatchPlayers, long exclusiveBitMask)
Creates an auto-match criteria Bundle for a new invitation.
abstract Bundle
getAutoMatchCriteria()
Retrieves the criteria for auto-matching one or more players for the room.
abstract String
getInvitationId()
Retrieves the ID of the invitation to accept, if any.
abstract String[]
getInvitedPlayerIds()
Retrieves the player IDs to invite to the room.
abstract RealTimeMessageReceivedListener
getMessageReceivedListener()
This method was deprecated. Use getOnMessageReceivedListener() instead.
abstract OnRealTimeMessageReceivedListener
getOnMessageReceivedListener()
Returns the OnRealTimeMessageReceivedListener that is called when the client has received a message from a peer.
abstract RoomStatusUpdateCallback
getRoomStatusUpdateCallback()
Returns RoomStatusUpdateCallback for the room status changes.
abstract RoomStatusUpdateListener
getRoomStatusUpdateListener()
This method was deprecated. Use getRoomStatusUpdateCallback() instead.
abstract RoomUpdateCallback
getRoomUpdateCallback()
Returns RoomUpdateCallback that is called when operations complete.
abstract RoomUpdateListener
getRoomUpdateListener()
This method was deprecated. Use getRoomUpdateCallback() instead.
abstract int
getVariant()
Retrieves the (optional) developer-controlled parameter describing the type of game to play.

Inherited Method Summary

Protected Constructors

protected RoomConfig ()

Public Methods

public static RoomConfig.Builder builder (RoomUpdateCallback callback)

Creates a builder for assembling a RoomConfig. The provided listener is required, and must not be null. It will be invoked on the main thread when appropriate.

Parameters
callback The callback to be invoked when the primary state of the room changes.
Returns
  • An instance of a builder.

public static RoomConfig.Builder builder (RoomUpdateListener listener)

This method was deprecated.
use builder(RoomUpdateCallback) instead.

Creates a builder for assembling a RoomConfig. The provided listener is required, and must not be null. It will be invoked on the main thread when appropriate.

Parameters
listener The listener to be invoked when the primary state of the room changes.
Returns
  • An instance of a builder.

public static Bundle createAutoMatchCriteria (int minAutoMatchPlayers, int maxAutoMatchPlayers, long exclusiveBitMask)

Creates an auto-match criteria Bundle for a new invitation. Can be passed to setAutoMatchCriteria(Bundle).

Parameters
minAutoMatchPlayers Minimum number of auto-matched players.
maxAutoMatchPlayers Maximum number of auto-matched players.
exclusiveBitMask Exclusive bitmasks for the automatching request. The logical AND of each pairing of automatching requests must equal zero for auto-match. If there are no exclusivity requirements for the game, this value should just be set to 0.
Returns
  • A bundle of auto-match criteria data.

public abstract Bundle getAutoMatchCriteria ()

Retrieves the criteria for auto-matching one or more players for the room.

Returns
  • The criteria for auto-matching one or more players for the room.

public abstract String getInvitationId ()

Retrieves the ID of the invitation to accept, if any. This is necessary when calling join(RoomConfig).

Returns
  • The ID of the invitation to accept.

public abstract String[] getInvitedPlayerIds ()

Retrieves the player IDs to invite to the room.

Returns
  • The player IDs to invite to the room.

public abstract RealTimeMessageReceivedListener getMessageReceivedListener ()

This method was deprecated.
Use getOnMessageReceivedListener() instead.

Retrieves the listener for message received from a peer.

Returns

public abstract OnRealTimeMessageReceivedListener getOnMessageReceivedListener ()

Returns the OnRealTimeMessageReceivedListener that is called when the client has received a message from a peer.

public abstract RoomStatusUpdateCallback getRoomStatusUpdateCallback ()

Returns RoomStatusUpdateCallback for the room status changes.

public abstract RoomStatusUpdateListener getRoomStatusUpdateListener ()

This method was deprecated.
Use getRoomStatusUpdateCallback() instead.

Retrieves the listener for the room status changes.

Returns

public abstract RoomUpdateCallback getRoomUpdateCallback ()

Returns RoomUpdateCallback that is called when operations complete.

public abstract RoomUpdateListener getRoomUpdateListener ()

This method was deprecated.
Use getRoomUpdateCallback() instead.

Retrieves the listener that is called when operations complete.

Returns
  • The listener that is called when operations complete.

public abstract int getVariant ()

Retrieves the (optional) developer-controlled parameter describing the type of game to play. Must be either a positive integer or ROOM_VARIANT_DEFAULT if not desired.

Returns
  • The developer-specified game variant.