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.
| |||||||||||
This method is deprecated.
use
setOnMessageReceivedListener(OnRealTimeMessageReceivedListener) instead.
| |||||||||||
Set the listener for message received from a connected peer in a room.
| |||||||||||
Set the callback for room status changes.
| |||||||||||
This method is deprecated.
use
setRoomStatusUpdateCallback(RoomStatusUpdateCallback) instead.
| |||||||||||
Sets the variant for the room when calling
create(RoomConfig) . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Add one or more player IDs to invite to the room. This should be set only when calling create(RoomConfig)
Parameters | |
---|---|
playerIds |
String : One or more player IDs to invite to the room. |
Returns | |
---|---|
RoomConfig.Builder |
The builder instance. |
Add a list of player IDs to invite to the room. This should be set only when calling create(RoomConfig)
Parameters | |
---|---|
playerIds |
ArrayList : One or more player IDs to invite to the room. |
Returns | |
---|---|
RoomConfig.Builder |
The builder instance. |
Builds a new RoomConfig
object.
Returns | |
---|---|
RoomConfig |
The built RoomConfig instance.
|
Sets the auto-match criteria for the room. See createAutoMatchCriteria(int, int, long)
.
Parameters | |
---|---|
autoMatchCriteria |
Bundle : The criteria for auto-matching one or more players for the match. If
null , the match is created with the invited players only. |
Returns | |
---|---|
RoomConfig.Builder |
The builder instance. |
Set the ID of the invitation to accept. This is required and should be set only when calling
join(RoomConfig)
.
Parameters | |
---|---|
invitationId |
String : The ID of the invitation to accept.
|
Returns | |
---|---|
RoomConfig.Builder |
This method is deprecated.
use setOnMessageReceivedListener(OnRealTimeMessageReceivedListener)
instead.
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.
Parameters | |
---|---|
listener |
RealTimeMessageReceivedListener : 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. |
Returns | |
---|---|
RoomConfig.Builder |
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.
Parameters | |
---|---|
listener |
OnRealTimeMessageReceivedListener : 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.
|
Returns | |
---|---|
RoomConfig.Builder |
Set the callback for room status changes.
Parameters | |
---|---|
callback |
RoomStatusUpdateCallback : The callback that is called to notify the client when the status of the room
has changed. The callback is called on the main thread.
|
Returns | |
---|---|
RoomConfig.Builder |
This method is deprecated.
use setRoomStatusUpdateCallback(RoomStatusUpdateCallback)
instead.
Set the listener for room status changes.
Parameters | |
---|---|
listener |
RoomStatusUpdateListener : 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. |
Returns | |
---|---|
RoomConfig.Builder |
Sets the variant for the room when calling create(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_DEFAULT
(the default) if not desired.
Note that variants must match exactly. Thus, if you do not specify a variant, only other
rooms created with ROOM_VARIANT_DEFAULT
will be considered potential
auto-matches.
Parameters | |
---|---|
variant |
int : The variant for the match. |
Returns | |
---|---|
RoomConfig.Builder |
The builder instance. |