question

David James avatar image
David James asked

Getting BuildId from PlayFabMultiplayerAgentAPI

I'm attempting to get the current queue information as a server by first gathering the session's build ID and then comparing against all listed queues until I find a match.

I'm told by someone using GameServerSDK that this is working for them:

  _configSettings = GameserverSDK.getConfigSettings();
  _buildId =  _configSettings.ContainsKey(GameserverSDK.BuildIdKey)
                    ? _configSettings[GameserverSDK.BuildIdKey]
                    : "BUILDID NOT SET BY SDK";


However, neither of the below seem to return a valid build id (string is null).

This is essential for working with multiple queues for the server to configure the game correctly.

PlayFabMultiplayerAgentAPI.SessionConfig.Metadata.TryGetValue(PlayFabMultiplayerAgentAPI.BuildIdKey, out var buildID1);
PlayFabMultiplayerAgentAPI.GetConfigSettings().TryGetValue(PlayFabMultiplayerAgentAPI.BuildIdKey, out var buildID2);
sdksmultiplayerMatchmaking
4 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.

David James avatar image David James commented ·

It may be my methods of debugging are invalid, could anyone confirm either of the above methods work, or if there is an easier way to get buildID as server?

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha commented ·

I will dig into it.

0 Likes 0 ·
David James avatar image David James Xiao Zha commented ·

Thank you sir!

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image Dimitris-Ilias Gkanatsios David James commented ·

You can get it through environment variables Basics of a PlayFab game server - PlayFab | Microsoft Docs

0 Likes 0 ·

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

If you just want to get the BuildID, according to my test of these two methods, you can get the BuildID normally through the second method:

PlayFabMultiplayerAgentAPI.GetConfigSettings().TryGetValue(PlayFabMultiplayerAgentAPI.BuildIdKey, out var buildID2);. 

Please let me know if you have any other problems.

10 |1200

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

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.