I am using Unity to develop my multiplayer game, and I am using the Multiplayer server and Multiplayer Matchmaking you provided.
when integrating Server SDK to my Unity project.
I Notice the following event OnSessionConfigUpdateEvent.
Should I poll the Session ID from the OnSessionConfigUpdateEvent when clients called GetMatch and Server is allocated? is this the best place to get session ID from? is the Session ID same as the MatchID?
Code Snippets:
PlayFabMultiplayerAgentAPI.OnSessionConfigUpdateEvent += OnSessionConfigUpdate;
private void OnSessionConfigUpdate(SessionConfig sessionConfig) { Debug.Log("On Session Config Update called"); Debug.Log("Session id is " + sessionConfig.SessionId); }
Answer by Citrus Yan · Nov 23, 2020 at 09:53 AM
Assuming that you would want to Integrate Matchmaking with PlayFab Multiplayer Servers as discussed in this section: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/matchmaking/multiplayer-servers#information-passed-to-the-game-server. In that case, yes, the Session Id is the same as the Match Id, and the Matchmaking system will write such information into the config file so that you can retrieve it later. And, please note that such info is only available after the server allocation, you’ll be able to retrieve it once readyForPlayers returns true, for more details, please check out this section: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/integrating-game-servers-with-gsdk#getting-configuration-settings-within-your-game-server