Matchmaking
Here’s a simplified flow for how to use matchmaking and MPSD together with PlayFab Party:- Players will create and gather into MPSD sessions that represent the groups they want playing together across matchmaking sessions. Players will gather into these sessions by using XBOX’s invite and join features.
- Those player groups will submit tickets to the matchmaking service which will gather compatible player groups into a matchmaking session. This matchmaking session will, itself, be represented by a new session document which the players will then join. Players must also listen for changes to this session document.
- Once the matchmaking session has been finalized and the roster is locked, the title must elect one of the members of the matchmaking session to set up the PlayFab Party network. A simple strategy for selecting the Party network creator is to use the first member of the matchmaking MPSD session document.
-
The selected member will create the network with an initial
PartyInvitationthat restricts network access to only the members of the matchmaking session. Once the network has successfully completed creation, the selected member should post the resulting network descriptor and Party invitation to the session document as a session property for other members to use. -
When each member sees the session document updated, they may use the network descriptor and invitation to connect to and join the network.
Here we’ve presented one flow for incorporating matchmaking and MPSD with PlayFab Party. The core ideas of this flow can be extended to other flows you might be interested in with MPSD, but presenting all possible flows is outside the scope of this documentation. For more information, see the full MPSD documentation.
Platform invites
Here’s a flow for how to incorporate XBOX platform invites into PlayFab Party:-
PlayerA creates an MPSD session document, listens for session changes, and a creates a Party network. When the Party network creation has completed, *PlayerA *posts the network descriptor and an initial invite (if necessary) to the MPSD session document.
- When PlayerA wants to invite PlayerB to the Party network, PlayerA initiates a platform invite to PlayerB via in-game or console UI.
- PlayerB receives the platform invite which includes an “invite handle” that PlayerB can use to find PlayerA’s MPSD session document.
- PlayerB joins the session document and listens for changes.
-
PlayerA sees PlayerB join the session document. PlayerA creates a new invitation for PlayerB to use and posts that invitation to the session document
-
PlayerB sees the invitation posted to the session document and uses it to join the Party network.
Invitations created via PartyNetwork::CreateInvitation will become invalid if the PartyLocalUser which created them leaves the network. Therefore, if a new user adds themselves to a session document but the user which invited them leaves, it is recommended that the new user remove themselves from the session document and wait to be re-invited by another user.
Join in-progress
Joining in-progress game sessions is very similar to the platform invite scenario. The core difference is that instead of PlayerA sending PlayerB an “invite handle”, PlayerB will get a “join handle” when they initiate a join-in-progress from the platform UI. Using this “join handle”, the PlayerB will join the session document and listen for changes. PlayerA will respond by creating and posting a new Party invitation for them to the session document. PlayerB will see this new invitation alongside the network descriptor and will use it to join the Party network.Invitations created via PartyNetwork::CreateInvitation will become invalid if the PartyLocalUser which created them leaves the network. Therefore, if a new user receives a Party invitation from the join-in-progress flow, but cannot use it becaues the user which created it has left, it is recommended that the new user remove themselves from the session document and re-join later. This will enable another member of the session to restart the flow and generate a new Party invitation for this user.
Disconnects and Cleanup
If a player leaves or is otherwise disconnected from a Party network, they should also remove themselves from any MPSD sessions associated with that Party network. Party network disconnects not initiated by a PartyNetwork::LeaveNetwork operation are considered fatal. After experiencing a fatal disconnect, a player may try to re-connect and re-authenticate into the network but must also rejoin the MPSD session. If a player’s connection to an MPSD session is temporarily interrupted, they may get disconnected from that session. Players can attempt to rejoin the session but, if they fail, should voluntarily remove themselves from the Party network by calling PartyNetwork::LeaveNetwork.The mechanisms and heuristics which detect disconnects for Party networks and MPSD sessions are different. Even in scenarios where a player will be disconnected from both the Party network and MPSD session, these disconnect events are independent, and it is not guaranteed that they occur close to each other in time. Titles should handle the scenario where a player might only be disconnected from either the Party network or MPSD session.
