Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by Brent Batas (Lisk) · Aug 07, 2019 at 06:54 PM · MatchmakingCustom Game Servers

How to get a BuildID from a SessionId?

I'm working on upgrading my dev tools for Servers 2.0.

For calls like ShutdownMultiplayerServer and GetMultiplayerServerDetails

https://docs.microsoft.com/en-us/rest/api/playfab/multiplayer/multiplayerserver/shutdownmultiplayerserver?view=playfab-rest

https://docs.microsoft.com/en-us/rest/api/playfab/multiplayer/multiplayerserver/getmultiplayerserverdetails?view=playfab-rest

Why do we have to provide both the SessionId and the BuildId?

Isn't the SessionId unique? If so, isn't that enough to identify the session?

If there's something I'm missing, then, how can I retrieve the BuildId based on the SessionId?

For full context, I'm trying to create a command for remotely shutting down a server (something we could do in legacy multiplayer with just one button click in the PlayFab dashboard). I want to be able to type something like "shutdown de51953a9107b84e0fce3ad18a7545f8e37ee4b2d0ae38cd5677e02043ab6493" and it will shutdown that instance.

Comment

People who like this

0 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

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Citrus Yan · Aug 09, 2019 at 01:45 AM

Hi Brent, after a discussion with our team, we draw a conclusion that only the combination of SessionId and BuildId can identify a server session. The reason is that you can request a multiplayer server with the same SessionId on different builds, you can test it by calling RequestMultiplayerServer. So this is the reason why you have to provide both SessionId and BuildId to identify the session.

About retrieving the BuildId based on the SessionId, unfortunately PlayFab does not have such API to be able to do that. You can make a Feature Request about it though. However, we found that buildId and sessionId are both listed in the event “server_state_changed”, maybe you can retrieve those from it although I am afraid it’s hard for you to do it programmatically. Moreover, the amount of buildIds is much lesser compared to sessionIds , maybe you could try to enumerate them. If your sessionIds is random enough then statiscally the chance that you shutdown the wrong server is quite small although this will make many invalid calls.

From my point of view, I think Jason’s approach is quite economic and effective, you can consider about it.

By the way, One more thing that might helpful for you, we can use ListMultiplayerServers to get all server sessions for a build. You can use this to build your tool to shutdown the server instance with a specific session id.

Comment

People who like this

0 Show 1 · 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 (Lisk) · Aug 09, 2019 at 01:58 PM 0
Share

Thanks - I'll be able to come up with a workable solution using ListMultiplayerServers. It was just unintuitive to me that SessionId would be non-unique, given that it has "id" in the name, but it sounds like that's the case.

avatar image

Answer by jasonallen · Aug 08, 2019 at 06:01 PM

Microsoft::Azure::Gaming::GSDK::getConfigSettings() will give you all the info to make those calls. The dictionary keys can be found in: https://github.com/PlayFab/gsdk/blob/master/cpp/cppsdk/gsdk.h

However this would still need to be done via the server. My server queries the info and then stores it elsewhere so I can see the info whenever I need to make rest calls.

Comment

People who like this

0 Show 4 · 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 (Lisk) · Aug 08, 2019 at 06:32 PM 0
Share

Thanks for the reply. Unfortunately I don't think this quite answers the question, because I am looking to call these APIs from a development tool, not from a running server instance.

avatar image jasonallen Brent Batas (Lisk) · Aug 08, 2019 at 06:48 PM 0
Share

What I was saying was that my server sends this data after starting up, then I have the info stored for rest calls that I do from dev tools. I think the reason this is required is to stop people from trying brute force rest calls to knock down your server.

avatar image Brent Batas (Lisk) jasonallen · Aug 08, 2019 at 08:17 PM 0
Share

hmm, I'm still confused :( can you describe your flow a little more specifically? Where do you send information to? Like some persistant data store, like redis or some backend database?

Show more comments

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

    6 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image

    Related Questions

    Custom game server instance (unity) does not start 1 Answer

    How do I find the fields to input into RedeemMatchmakerTicket in UE4? 1 Answer

    PlayFab Matchmaking with custom game servers 1 Answer

    What is the recommended way to get the list of players in a match, from a game server? 2 Answers

    Matchmaking flow with Unity 3 Answers

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

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

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges