question

collinjryan avatar image
collinjryan asked

Unity GSDK Integration Hangup

I'm testing with MockVMAgent to make sure my GSDK Integration is proper. The Agent says it's waiting for heartbeats until PlayFabMultiplayerAgentAPI.Start() is called, and then the following happens:

info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 POST http://127.0.0.1:56001/v1/sessionHosts/e1f30e29-b0ec-4552-8b3e-906e98829171/heartbeats application/x-www-form-urlencoded 112
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]
      Route matched with {action = "ProcessHeartbeat", controller = "SessionHost"}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] ProcessHeartbeat(System.String, Microsoft.Azure.Gaming.AgentInterfaces.SessionHostHeartbeatInfo) on controller MockVmAgent.Controllers.SessionHostController (MockVmAgent).
info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1]
      Executing HttpStatusCodeResult, setting HTTP status code 415
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[2]
      Executed action MockVmAgent.Controllers.SessionHostController.ProcessHeartbeat (MockVmAgent) in 11.1816ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 61.7272ms 415

And I've got no idea what that means. But clearly I'm not getting to the PlayFabMultiplayerAgentAPI.ReadyForPlayers() step.
I tried looking at the Unity Mirror example but it had a lot of compile errors with my version of Unity.

unity3d
10 |1200

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

collinjryan avatar image
collinjryan answered

Ok, the solution was to just bring the project into a newer version of Unity. Now when testing the build locally we progress correctly through Initializing, to Standing By, to Active. However, when the zip is uploaded to the Playfab Manager, it sticks at Deploying in the same way it did when Standing By wasn't being called.

10 |1200

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

Seth Du avatar image
Seth Du answered

It is not easy to locate the issue precisely according to the current information. However, HTTP status code 415 means the payload format is in an unsupported format. I assume that your container doesn’t included required DLLs.

According to the documentation: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/locally-debugging-game-servers-and-integration-with-playfab:

  • To run properly in container mode, the zip archive must contain any system DLLs that are not included in the container image. For more information, see determine required system DLLs.

Please feel free to tell us if you have any questions on this issue after the testing environment has been configured properly.

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

collinjryan avatar image collinjryan commented ·

I added all the dlls, no change in the response.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ collinjryan commented ·

Is the target server build you are testing the official sample provide by PlayFab? Is it your own project? Have you noticed any information about current state in the log, for example:

CurrentGameState: Active

I am not sure the cause of HTTP status code 415 but the rest of the logs are very similar to my testing result and if you can find the state of the server is active, it simply means it is working and heartbeat can be listened.


0 Likes 0 ·
collinjryan avatar image collinjryan Seth Du ♦ commented ·

It's my own project. However, it's in a much older version of Unity (5.3.40f1), so I'm wondering if the version may be the root of the problem. I'm on a contract here so we can't bring the project into a more recent version of Unity unless it's absolutely necessary to get Playfab working.

As for the logs, there's never any information given as to the gamestate. Here's the full log of the VMagent:

0 Likes 0 ·
Show more comments
Seth Du avatar image Seth Du ♦ collinjryan commented ·
CurrentGameState: Active
info: Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor[1]
      Executing ObjectResult, writing value of type 'Microsoft.Azure.Gaming.AgentInterfaces.SessionHostHeartbeatInfo'.
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[2]
      Executed action MockVmAgent.Controllers.SessionHostController.ProcessHeartbeat (MockVmAgent) in 13.5091ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 14.102ms 200 application/json; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 POST http://127.0.0.1:56001/v1/sessionHosts/190a2bba-c75f-426a-8d2e-02f071b19f76/heartbeats application/json 74
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]
      Route matched with {action = "ProcessHeartbeat", controller = "SessionHost"}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] ProcessHeartbeat(System.String, Microsoft.Azure.Gaming.AgentInterfaces.SessionHostHeartbeatInfo) on controller MockVmAgent.Controllers.SessionHostController (MockVmAgent).

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ collinjryan commented ·

I cannot reproduce your issue. Here are some suggestions based on the current situation.

0 Likes 0 ·
collinjryan avatar image collinjryan Seth Du ♦ commented ·

The sample works but I have to run it in a much newer version of Unity so it isn't really a useful comparison.

I have been debugging locally with runcontainer set to false this whole time.

0 Likes 0 ·
Show more comments

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.