question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

Is there a GSDK equivalent of SetGameServerInstanceData()?

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.

Custom Game ServersMatchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

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.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

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.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Brent Batas (Lisk) commented ·

There are not size limitations on this.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.