Hello,
When I test my game server locally within a container, eveything works fine, but when I upload my game server on Playfab, I cannot make it work.
When I launch my game clients, the game server state pass from StandyBy to PendingHearbeat.
I added logs in my game server and find that the call to ReadyForPlayers function is blocking forever and never returns (nor true neither false).
I cannot figured out what is the source of this issue.
Any help will be much appreciated. Thanks :)
In the latest GSDK, I don't think it's supposed to return a value and you call it like a function, i.e. GSDK.ReadyForPlayers();
Copy/paste from: github cppsdk gsdk.h
class GSDK { public: /// <summary>Renamed from WaitForSessionAssignment. Called when the game server is ready to accept clients. If Start() hasn't been called by this point, it will be called implicitly here.</summary> /// <remarks>Required. This is a blocking call and will only return when this server is either allocated (a player is about to connect) or terminated.</remarks> /// <returns>True if the server is allocated (will receive players shortly). False if the server is terminated. </returns> static bool readyForPlayers();<br>
As you can see, readyForPlayers function return a boolean value in the latest CPP SDK on github. (The url is correct?)
But whatever if it return something or not, the issue is that the call to this function never end and I don't know why.
Thanks for your help.
Answer by Citrus Yan · Mar 15, 2021 at 02:58 AM
I believe Brandon is correct, according to the latest SDK, ReadyForPlayer() doesn't return anything:
public static void ReadyForPlayers() { ... }
Copy/paste from: github cppsdk gsdk.h
class GSDK { public: /// <summary>Renamed from WaitForSessionAssignment. Called when the game server is ready to accept clients. If Start() hasn't been called by this point, it will be called implicitly here.</summary> /// <remarks>Required. This is a blocking call and will only return when this server is either allocated (a player is about to connect) or terminated.</remarks> /// <returns>True if the server is allocated (will receive players shortly). False if the server is terminated. </returns> static bool readyForPlayers();<br>
As you can see, readyForPlayers function return a boolean value in the latest CPP SDK on github. (The url is correct?)
But whatever if it return something or not, the issue is that the call to this function never end and I don't know why.
Thanks for your help.
May I have the code snippet of yours that calls readyForPlayers()?
int main() { Microsoft::Azure::Gaming::GSDK::start(true); Microsoft::Azure::Gaming::GSDK::registerShutdownCallback(&OnShutdown); Microsoft::Azure::Gaming::GSDK::registerHealthCallback(&IsHealthy); Microsoft::Azure::Gaming::GSDK::registerMaintenanceCallback(&OnMaintenanceScheduled); // Init all the stuff I need to run the game server Bool bReady = Microsoft::Azure::Gaming::GSDK::readyForPlayers(); // This point is never reached. // If I call readyForPlayers in another thread, I reach this point but readyForPlayers never end. // Game server loop }
Answer by Benjamin Golinvaux · Jul 12, 2021 at 03:07 PM
I am quite late to the party, but I want to mention that I experience the same problem.
In my case, I think I have traced it to the parsing of the heartbeat response failing due to some bogus JSON (in response to the periodic "heartbeat" request that the Game server, through GSDK, is making to the Playfab VM agent)
If you are still stuck on the problem, maybe you should inspect the contents of the C:\gamelogs folder in the container (if you're using the default log location)
Matchmaking Error 1 Answer
Backfill tickets not being properly cancelled 1 Answer