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 /
  • Bugs /
avatar image
Question by tldQuantic · Mar 12, 2021 at 02:36 PM · MatchmakingCustom Game Serversmultiplayer

Call to ReadyForPlayers function is blocking forever

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 :)

Comment

People who like this

0 Show 2
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 Brandon Phillips · Mar 13, 2021 at 01:15 AM 0
Share

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();

avatar image tldQuantic Brandon Phillips · Mar 15, 2021 at 09:05 AM 0
Share

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.

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

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()
        {
		...
        }

Comment

People who like this

0 Show 14 · 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 tldQuantic · Mar 15, 2021 at 09:04 AM 0
Share

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.

avatar image Citrus Yan tldQuantic · Mar 18, 2021 at 06:03 AM 0
Share

May I have the code snippet of yours that calls readyForPlayers()?

avatar image tldQuantic Citrus Yan · Mar 18, 2021 at 06:38 PM 0
Share
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
}



Show more comments
avatar image

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)

Comment

People who like this

0 Show 0 · 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

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

    5 People are following this question.

    avatar image avatar image avatar image avatar image avatar image

    Related Questions

    Matchmaking Error 1 Answer

    Why are all my attempts at using the Dedicated Server Setup ending in TooManyServerRestarts? (Unreal Engine 4.25.3) 2 Answers

    Backfill tickets not being properly cancelled 1 Answer

    Randomly, players can't connect to the server 1 Answer

    EOS online subsystem can NOT connect from PlayFAB 1 Answer

    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