• Sign Up Login
  • Features
    • Game Services
    • Real-time Analytics
    • LiveOps
    • Add-ons
  • Game Services
  • Real-time Analytics
  • LiveOps
  • Add-ons
  • Games
  • Pricing
  • Blog
  • Support
    • Docs
    • Forums
    • Contact
  • Docs
  • Forums
  • Contact
  • Sign Up Login
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Brent Batas · Jul 31 at 10:57 PM · Custom Game ServersMatchmaking

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.

Comment
Ian Chen

People who like this

1 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

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.

Comment

People who like this

0 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Brent Batas · Aug 02 at 03:56 PM 0
Share

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.

avatar image Sarah Zhang ♦ Brent Batas · Aug 06 at 09:37 AM 1
Share

There are not size limitations on this.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    Related Questions

    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

    • PlayFab

      • Features
      • Games
      • Pricing
      • Blog
    • Engineers

      • Documentation
      • Quickstarts
      • API Reference
      • SDKs
      • Usage Limits
    • Support

      • Forums
      • Videos
      • Contact
      • Service Health
      • Terms of Service
    • Social

      • Facebook
      • Twitter
      • LinkedIn
      • YouTube
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • About Microsoft
    • Jobs
    • Accessibility
    • Diversity & inclusion
    • Security
    • Company news
    • © Microsoft 2019
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Post an idea
    • Create an article
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges