question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

After a client calls CreateMatchmakingTicket(), how do we know when to call GetMatch()?

I'm just starting to get into Multiplayer Servers 2.0 & Matchmaking 2.0. I currently have a live game using legacy servers/matchmaking, and I'm looking to upgrade over the next couple of months.

My understanding is that:

1) my client will call CreateMatchmakingTicket() whenever it wants to look for a match. This call will return a TicketId.

2) then at some point, I will call GetMatch(TicketId) to get the connection information (ip, port, etc) for the matched game server.

3) then at this point, I can connect to the game server directly using the connection information (ip, port, etc.)

How do I know when to call #2? It says in the documentation:

When matchmaking has successfully matched together a collection of tickets, it produces a 'match' with an Id. 

How would the client know when matchmaking has successfully matched together a collection of tickets? Am I supposed to just call GetMatch() every second or two until I get a valid response?

In my legacy multiplayer, I simply call PlayFabClientAPI.Matchmake() and the response either contains the connection information or an error and I can proceed accordingly.

Custom Game ServersMatchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Hi, actually, you must poll the Matchmaking service by TicketId to access the Status of the ticket in matchmaking. In order to do so, have your title call GetMatchingMakingTicket, for instance, polls the ticket every 6 seconds. When the status of the ticket changes to Matched, stop polling. From your client, call GetMatch with MatchId provided in the response from GetMatchmakingTicket This match contains the list of users who are matched together.

Here is the doc you may find helpful: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/matchmaking/quickstart

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.