- Matching
- Backfill tickets can’t match with each other.
- Backfill tickets are given priority during searching, reducing fragmentation of the player base.
- Contract
- Backfill tickets can be created with a
ServerDetailsfield. This allows the server to indicate how matched players should connect to it. - Backfill tickets can be created with team assignments. This allows games with teams to maintain their team information.
- Backfill tickets can be created with a
- Queue properties
- Backfill tickets don’t trigger Multiplayer Server allocation.
- Backfill tickets aren’t reflected in queue statistics, as their players are already playing a game and would inaccurately skew wait time.
- Ownership
- Backfill tickets are owned by a game server, not a user. Users can’t view or interact with backfill tickets in any way.
Prerequisites
- Basic familiarity with the PlayFab Multiplayer SDK. For more information, see the Matchmaking SDK Quickstart for more information.
- Define
PFMULTIPLAYER_INCLUDE_SERVER_APISbefore including the matchmaking header. For example:
Configure a server backfill ticket
Create and populate a PFMatchmakingServerBackfillTicketConfiguration struct with the necessary details:-
timeoutInSeconds: How long to attempt filling the ticket, in seconds. -
queueName: The name of a match queue. -
memberCount: The number of members currently in the match. -
members: The PFMatchmakingMatchMember members currently in the match. -
serverDetails(optional): Populate PFMultiplayerServerDetails with information about your server (FQDN, IP address, ports, region) that is provided to clients.
The
PFMultiplayerServerDetails::ipv4Address field isn’t validated and can be used to supply arbitrary connection string information to clients.Creating a server backfill ticket
Using PFMultiplayerCreateServerBackfillTicket to create a server backfill ticket, we need to pass our game server’s entity (as a PFEntityKey) along with the backfill configuration we created in the previous step.Check the status of the matchmaking ticket
You must check for updates to the ticket by calling PFMultiplayerStartProcessingMatchmakingStateChanges to receive state changes and then calling PFMultiplayerFinishProcessingMatchmakingStateChanges when you’re done processing those state changes. The SDK returns a TicketStatusChanged state change any time the status of the ticket changes and a TicketCompleted state change when matchmaking has completed.Get the match
After receiving the PFMatchmakingStateChangeType::TicketCompleted state change, call PFMatchmakingTicketGetMatch to get the details of the match. These details contain the match ID, the users who have been matched together, and the preferred region for the match, and an arrangement string for lobby associated with the match. Once you retrieve any information you need out of the PFMatchmakingMatchDetails struct, the ticket should be destroyed with PFMultiplayerDestroyMatchmakingTicket.Cancelling a ticket
If you would like to cancel the matchmaking process before the time-out set in thePFMatchmakingServerBackfillTicketConfiguration, call PFMatchmakingTicketCancel with the ticket handle.
Calling this API doesn’t guarantee the ticket is cancelled. The ticket could still complete before the cancellation can be processed, or the cancellation request can fail due to networking or service errors. You can still process matchmaking state changes to get the result of the ticket if you’d like to confirm the ticket cancellation is complete prior to moving on. Otherwise, you can immediately call PFMultiplayerDestroyMatchmakingTicket.
