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.
In my legacy implementation, immediately after calling PlayFabMatchmakerAPI.StartGame(), I am able to call SetGameServerInstanceData() to store custom information for this particular game ID, such as display names of ingame players, game modes, and some other information.
Later, I can call PlayFabClientAPI.GetCurrentGames() and deserialize GameServerData to retrieve that custom information and use it.
For servers 2.0, my understanding is that when matchmaking decides to spin up a game server executable (i.e. "Match Found!"), I should call RequestMultiplayerServer(). However, I don't see anywhere I can attach custom information.
Moreover, the closest thing I see to GetCurrentGames() is ListMultiplayerServers(), but this appears to lack any custom data fields.
The direct solution to my problem would be if there was a GSDK equivalent of SetGameServerInstanceData as well as GetCurrentGames. However, if there is no direct equivalent, I would like to see an approach how I can still store/retrieve custom data for current games in progress.
Answer by Sarah Zhang · Aug 02 at 07:11 AM
There is no a equivalent of SetGameServerInstanceData() in GSDK. About passing and retrieving custom data for current Multiplayer Servers. If you use RequestMultiplayerServer API, you can use “session cookie” to pass info to servers. If you use MatchMaking service, you don’t need to request MultiplayerServer manually. MatchMaking will allocate sessions based on attributes in queues, MatchMaking will pass matchID to the server instead of sessionId, when you use GetMatch API, you can get server info via MatchId. You also don’t need to list servers when you use MatchMaking. In addition, GSDK is only applied to connect your game server to the PlayFab agent installed on the VM. It is different from the server API. You can check the doc for more.
Thanks Sarah - regarding the session cookie, it looks like a string value. Are there any size limitations on this? I'm planning to serialize a JSON object with about 36-48 numbers/short strings to pass as the session cookie.
My own multiplayer server app run on playfab 24/7 1 Answer
Master server in CloudScript + Unity3D custom game servers ? 1 Answer
After a client calls CreateMatchmakingTicket(), how do we know when to call GetMatch()? 1 Answer
Can I get a conceptual explanation of how a custom Matchmaker would work? 1 Answer
Are game servers in multiplayer 2.0 running before a match is found? 1 Answer