Design Overview
To integrate MPA with PlayFab Lobby and Match or similar services, a title or title service has to query the relevant information from the lobby state and then migrate this information into the MPA service. The MPA service is not intended for lobby or session state information.Activity
For MPA Activity, the source information should be underlying lobby information. A title or service needs set the relevant information in the MPA Activity content fields with the following best practices:-
Update frequency
State migration from lobby data should be performed at a reasonable reflect changes, like updates to the
CurrentPlayersinformation. Update calls should not exceed the call limits described outlined in Fine-Grained Rate Limiting. MPA Activity should also not be deleted/recreated to update information. -
XBOX User Identity (XUID)
The XUID of a player is typically unvalidated information in services outside of XBOX services and not the primary identifier for cross-network services. PlayFab Lobby uses a cross-network PlayFab User Entity ID for players that can be converted to a XUID for the active user through API or service calls. For more details refer to the PlayFab Tutorial: Get a player Profile. Only this resolved XUID should be considered secure.
The XUID of other players cannot be retrieved in this way. As a solution, XUIDs can be provided as custom string properties of a player in the Lobby. These strings should not be considered secure and always be validated through the PlayFab service by using
PFAccountManagementClientGetPlayFabIDsFromXboxLiveIDsGetResultto compare the expected and actual PlayFab User Entity ID for a XUID. A mismatch indicates an incorrect XUID. For all services, XUIDs provided as insecure strings are not secure and can lead to impersonation attacks without validation. -
Connection String
To integrate with the PlayFab Lobby service, the connection string of an MPA activity should be set to the Lobby connection string that can be retrieved through
PFLobbyGetConnectionString. Other services should use an equivalent join string. -
Reflecting Lobby Joinability
An Activity is intended to allow players to join gameplay experiences and needs to be matched with the joinability of the underlying lobby state. An Activity automatically becomes non-joinable when the Activity is full (
CurrentPlayersreaches theMaxPlayersvalue). Titles that want to make an Activity temporarily non-joinable can also use this behavior. An Activity should only be deleted with no future joins are possible. Note that altering the privacy setting of the Activity only restricts, but cannot block all joins. Due to the latency of Activity joins, titles should always account for flows where joins are performed against full or non-joinable sessions and provide the appropriate errors to the player. - Reflection Privacy changes The state and changes of activity privacy through Join Restrictions should mirror the Access Policy defined for the underlying PlayFab Lobby. The same applies for similar services and may require mapping of privacy values.
Invites
For MPA Invites, the recommended source should also be the underlying lobby information. This best practice approach is more reliable than an invite to a network mesh like PlayFab Party and can provide state information through lobby data immediately. To integrate with the PlayFab Lobby service, the connection string of an MPA invite should be set to the Lobby connection string. This string can be retrieved throughPFLobbyGetConnectionString. In addition, the appropriate cross-platform join value should be set for the invite.
