question

brandon@uprootstudios.com avatar image
brandon@uprootstudios.com asked

GameserverSDK.GetInitialPlayers() returns nothing for a Matchmaking game

When using the C# GSDK in Unity, GetInitialPlayers() returns an empty list for a server that was started by Matchmaking when running in Thunderhead. I can get the GSDK Config just fine by using GameserverSDK.getConfigSettings(), however using GetInitialPlayers() returns an empty list. For reference, here's the code:

Debug.Log ("Listing initial members:");
foreach (var player in GameserverSDK.GetInitialPlayers()) {
    Debug.Log (player);
}
Debug.Log ("Done listing members.");

And here's the output:

Listing initial members: 
Done listing members.

Any suggestions?

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

·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

I figured it out, it was an error on my part. When debugging, I updated to the Unity GSDK and did not realize I had tried to call GetInitialPlayers() before the server had actually been allocated, so it was logging the empty result because no players had been assigned for the server yet.

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.