MatchMaker Ticket allows the server to have the complete control over matchmaking logic. The client simply needs to issue a ticket and wait for the server to complete the matchmaking.
Using a ticket issued by MatchMaker, the client simply has to wait for the server to perform matchmaking and notify the matched clients.
The control of the matchmakings performed by tickets is handled by the server.
To learn how to manage the server-side of MatchMaker Ticket, please read here.
The upside of having the server to have the full control of matchmaking logics, the client does not require any change should the matchmaking specs and logics change.
How To Issue A Ticket
Diarkis.Modules.MatchMaker mm = new Diarkis.Modules.MatchMaker();
How To Receive Notifications When Matchmaking Is Completed
The server will send a notification when a matchmaking ticket finishes finding matches or fails to find matches. Matched remote clients will also receive a notifications when matched with the client that issued the matchmaking ticket.
Here is how to setup an event listener callback to receive the notifications.
mm.OnTicketComplete += (bool success, byte message) =>
// The server failed to find matches...
// message contains the data that the server created.
// message that the server sends can be easily configurable on the server.
How To Cancel Issued Ticket
There may be a time when you want to cancel the matchmaking ticket you have issued.
Here is how.
Important: You may cancel tickets that are issued by yourself only.
How To Receive Notifications When Ticket Is Canceled
mm.OnCancelTicket += (bool success, byte message) =>
// Failed to cancel the ticket...
// message byte array contains the error data
// ticket has been successfully canceled