API reference
API reference
Select your platform
No SDKs available
No versions available

CustomMatchmaking Class

Extends MonoBehaviour
Component responsible for creating, joining and leaving game rooms upon developer request.
When using this component you'll also need to add another component to the same gameobject that implements the ICustomMatchmakingBehaviour interface.

Fields

Event called when a CreateRoom() operation finished.
Event called when a JoinRoom operation finished.
Event called when a LeaveRoom operation finished.

Properties

string LobbyName[Get]
bool IsPrivate[Get]
int MaxPlayersPerRoom[Get]
bool IsPasswordProtected[Get]
Indicates whether you're currently connected to a game room.
Indicates the token of the game room you're currently connected to.
If not connected this is null.
Indicates whether the used implementation of the ICustomMatchmakingBehaviour interface supports room passwords.
This is also used for controlling which fields are shown in the inspector UI of the CustomMatchmaking component.

Protected Fields

ICustomMatchmakingBehaviour MatchmakingBehaviour[Get]

Member Functions

Creates a new room with the selected options in the component public fields.
Returns
A task you should await for and receive a result with the information on the newly created room.
Creates a new room with the selected options.
Parameters
options
The selected options for creating a new room.
Returns
A task you should await for and receive a result with the information on the newly created room.
Joins a room with the selected roomToken and roomPassword .
Parameters
roomToken
Unique identifier of the room you want to join. This is obtained from the RoomOperationResult obtained after doing a CreateRoom() operation.
roomPassword
Optional password for rooms that require one when joining. This is obtained from the RoomOperationResult obtained after doing a CreateRoom() operation.
Returns
A task you should await for and receive a result with the information on the newly joined room.
Joins a room with the selected roomLobby .
Parameters
roomLobby
Identifier of the room lobby you want to join. This is the same lobby name used in the CreateRoom() and CreateRoom(RoomCreationOptions) operations.
Returns
A task you should await for and receive a result with the information on the newly joined room.
Leaves the room you're currently connected to.

Protected Functions

Generates a random room password to be used in the created room when it's requested in a CreateRoom() operation.
May be overriden to implement your own random password generation.
Returns
A random room password to be used in the created room.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon