java.lang.Object | |
↳ | com.google.android.gms.games.multiplayer.realtime.RoomConfig.Builder |
Builder class for RoomConfig
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add one or more player IDs to invite to the room.
| |||||||||||
Add a list of player IDs to invite to the room.
| |||||||||||
Builds a new
RoomConfig object. | |||||||||||
Sets the auto-match criteria for the room.
| |||||||||||
Set the ID of the invitation to accept.
| |||||||||||
Set the listener for message received from a connected peer in a room.
| |||||||||||
Set the listener for room status changes.
| |||||||||||
Sets whether to enable sockets for sending and receiving data.
| |||||||||||
Sets the variant for the room when calling
createRoom(RoomConfig) . |
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Add one or more player IDs to invite to the room. This should be set only when calling
createRoom(RoomConfig)
playerIds | One or more player IDs to invite to the room. |
---|
Add a list of player IDs to invite to the room. This should be set only when calling
createRoom(RoomConfig)
playerIds | One or more player IDs to invite to the room. |
---|
Sets the auto-match criteria for the room. See
createAutoMatchCriteria(int, int, long)
.
autoMatchCriteria | The criteria for auto-matching one or more players for the
match. If null , the match is created with the invited players only. |
---|
Set the ID of the invitation to accept. This is required and should be set only when
calling joinRoom(RoomConfig)
.
invitationId | The ID of the invitation to accept. |
---|
Set the listener for message received from a connected peer in a room.
If not using socket-based communication, a non-null listener must be provided here before
constructing the RoomConfig
object.
listener | The message received listener that is called to notify the client when it receives a message in a room. The listener is called on the main thread. |
---|
Set the listener for room status changes.
listener | The listener that is called to notify the client when the status of the room has changed. The listener is called on the main thread. |
---|
Sets whether to enable sockets for sending and receiving data. The socket for each
participant can be obtained using getRealTimeSocketForParticipant(String, String)
. If
false the sendUnreliableRealTimeMessage(byte[], String, String)
API should be used to send
messages.
Note that for reliable messages, the sendReliableRealTimeMessage(RealTimeReliableMessageSentListener, byte[], String, String)
API
should still be used. Reliable messages will be delivered via the
RealTimeMessageReceivedListener
registered with
setMessageReceivedListener(RealTimeMessageReceivedListener)
.
enableSockets | Whether to enable the use of sockets for sending/receiving data. |
---|
Sets the variant for the room when calling createRoom(RoomConfig)
. This is an
optional, developer-controlled parameter describing the type of game to play, and is used
for auto-matching criteria. Must be either a positive integer or
ROOM_VARIANT_ANY
(the default) if not desired.
variant | The variant for the match. |
---|