question

Benjamin Golinvaux avatar image
Benjamin Golinvaux asked

readyForPlayers never returns (heartbeat JSON error)

Hello.

I am trying to test my game using GSDK with LocalMultiplayerAgent in container mode (last step before being able to test it on Playfab)

I notice that my game is frozen on the Microsoft::Azure::Gaming::GSDK::readyForPlayers() that never returns.

That seems rather normal because the GSDKInternal::decodeHeartbeatResponse(...) function cannot get past the JSON decoding, according to the log that I found in the C:\gamelogs\GSDK_output...log container file (and, thus, the m_transitionToActiveEvent event is never signalled) : see below.

I will of course rebuild the GSDK after adding some verbose logging but, AFAIK, the heartbeat is supplied by the other executable running in the VM, right?

Are there circumstances where the heartbeat response contains a bogus JSON payload ?

Thanks in advance


(I am using the GSDK as of commit # 627f9edf from May 20th)

VM Agent Endpoint: 172.19.0.11:46001

Instance Id: 55b2384e0b42abdc56947fc4928ba63ccaaabf56e1d78b2b5c8dc673c462741f  

- GSDKMethodEntry: GSDKInternal Result: 0 

FPlayFabGSDKModule::StartServer() - 01 

FPlayFabGSDKModule::StartServer() - 02 FPlayFabGSDKModule::StartServer() - 03 HealthyFailed to parse heartbeat * Line 1, Column 1
  Syntax error: value, object or array expected.
10 |1200

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

Benjamin Golinvaux avatar image
Benjamin Golinvaux answered

My issue is some sort of stack corruption and is probably caused by out-of-date binary deps wrt the headers, or perhaps a mix between debug and release binaries. I will deal with it :)

10 |1200

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

Benjamin Golinvaux avatar image
Benjamin Golinvaux answered

Edit : I hadn't noticed (I read the logs wrong), but the reason why JSON parsing is failing is that the so-called JSON payload is simply "Healthy" , without any quotes.

There is something quite strange going on here....

What side is correct ? Is the heartbeat response supposed to be a non-quoted string, or is my MpsAgent version maybe too old?

Thanks in advance for any help or pointers.

3 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.

Rick Chen avatar image Rick Chen ♦ commented ·

Are you using the GSDK for CPP? I will do some test about this, it could take a while, your patience is appreciated.

0 Likes 0 ·
Benjamin Golinvaux avatar image Benjamin Golinvaux Rick Chen ♦ commented ·

Hello Rick,

I am using a small wrapper written by Nick Arthur (https://github.com/narthur157/playfab-gsdk-ue4) that basically provides the code described in https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/playfabgsdk_guide


However, I have modified this code to upgrade it to the latest GSDK.

I am pretty sure I did something wrong. I tracked down my issue to some sort of stack corruption (I receive from the Agent REST request a string that is a few bytes earlier in the stack and that has nothing to do with the request). Probably a "debug vs release" or "cdecl vs WINAPI" issue...

Meanwhile, your colleague Dimitris , on the Discord channel, has pointed me to a fresh PR written by an Epic dev that provides a UE version of the GSDK that only uses UE objects for JSON, REST requests and strings. It's basically a "no-binary-dependencies" approach that I really like.

I am thus in the process of removing the code based on the Microsoft tutorial and use this PR instead. The PR hasn't been merged yet but looks high quality and has been approved (https://github.com/PlayFab/gsdk/pull/77)

I really think you should not waste your time with my issue. Thanks for your help!

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Benjamin Golinvaux commented ·

Thank you for letting me know that my colleague has been supporting you. OK, this issue does seem a bit complex. I will leave that to you and my colleague. Thank you for sharing those information.

0 Likes 0 ·
Paul Gilmore avatar image
Paul Gilmore answered

Greetings from PlayFab!

We understand that generating your MultiplayerSettings.json file is difficult. It is easy to make mistakes using raw json. We have recently made a tool to try and improve this. Please take a look: GitHub.com/PlayFab/LocalMultiplayerAgent/SettingsJsonGenerator

I feel that this utility should help a lot in this case. If your json file failed to parse, there was likely an easy-to-miss syntax error, such as a stray comma, or mismatched quote. It is my hope that this utility would be extremely helpful in this regard.

Please check it out and send us your feedback.

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.