question

dev-9-1 avatar image
dev-9-1 asked

Unity PlayFab Mirror Server stuck in StandingBy (Local Server Build)

Hello there, i know questions like these already exist, but i cant find a solution on my part.

What I am trying to do: Setup a Local Instance of my Unity Game + Mirror Implementation before deploying it to a PlayFab VM instance.

Where I´m at: I was able to create a local Instance with the "LocalMultiplayerAgent" where my Unity Build runs. The server instance is stuck at GameState: StandingBy

 CurrentGameState: StandingBy
 info: Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor[1]
       Executing OkObjectResult, writing value of type 'Microsoft.Azure.Gaming.AgentInterfaces.SessionHostHeartbeatInfo'.
 info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[105]
       Executed action LocalMultiplayerAgent.Controllers.SessionHostController.ProcessHeartbeat (LocalMultiplayerAgent) in 9.0944ms
 info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
       Request finished HTTP/1.1 POST http://host.docker.internal:56001/v1/sessionHosts/3dc8a6f27f88feb420bf946263f5728809af76948686fb8a300d7c8c7e024eca/heartbeats application/json 83 - 200 87 application/json;+charset=utf-8 9.1752ms
 info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
       Request starting HTTP/1.1 POST http://host.docker.internal:56001/v1/sessionHosts/3dc8a6f27f88feb420bf946263f5728809af76948686fb8a300d7c8c7e024eca/heartbeats application/json 83
 info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[102]
       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 LocalMultiplayerAgent.Controllers.SessionHostController (LocalMultiplayerAgent).

This is how my MultiplayerSettings.json looks like:

 {
     "RunContainer": true,
     "ForcePullFromAcrOnLinuxContainersOnWindows": false,
     "OutputFolder": "C:\\output\\UnityServerLinux",
     "NumHeartBeatsForActivateResponse": 100,
     "NumHeartBeatsForTerminateResponse": 1000,
     "TitleId": "",
     "BuildId": "00000000-0000-0000-0000-000000000000",
     "Region": "WestUs",
     "AgentListeningPort": 56001,
     "ContainerStartParameters": {
       "ImageDetails": {
         "Registry": "hubreregistry.io",
         "ImageName": "playfabtest",
         "ImageTag": "0.6",
         "Username": "",
         "Password": ""
       }
     },
     "DeploymentMetadata": {
       "Environment": "LOCAL",
       "FeaturesEnabled": "List,Of,Features,Enabled"
     },
     "PortMappingsList": [
       [
         {
           "NodePort": 56100,
           "GamePort": {
             "Name": "gameport",
             "Number": 7777,
             "Protocol": "TCP"
           }
         }
       ]
     ],
     "SessionConfig": {
       "SessionId": "ba67d671-512a-4e7d-a38c-2329ce181946",
       "SessionCookie": null,
       "InitialPlayers": [ "Player1", "Player2" ]
     }
   }
Custom Game Servers
1 comment
10 |1200

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

Simon Cui avatar image Simon Cui commented ·

May I know what exactly do you mean “stuck in StandingBy”? Does it mean there is only one heartbeat in StandingBy and no more heartbeat? Or there are many heartbeats but they are all in StandingBy? Besides, is there any error information in the log?

By the way, you can try to set a smaller NumHeartBeatsForActivateResponse to see if it works. It may be a configuration error. For more information, you can refer to Debug Container-based game servers using LocalMultiplayerAgent - PlayFab | Microsoft Learn.

1 Like 1 ·

1 Answer

·
dev-9-1 avatar image
dev-9-1 answered

Thanks for the answer. As the community portal was down the past few days, i could get it to work on my own :) Not sure, what was wrong, but the NumHeartBeatsForActivateResponse was definitely too high.

1 comment
10 |1200

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

Simon Cui avatar image Simon Cui commented ·

Glad to hear it worked! Please feel free to ask if you have further concerns.

0 Likes 0 ·

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.