question

TChuck avatar image
TChuck asked

Can't connec to containerized server,Can't connect to Containerized Server

Hello all,

I'm trying to setup my Unity FishNetwork project to work with PlayFab for the server and backend. I've done the steps marked here: https://learn.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/locally-debugging-game-servers-and-integration-with-playfab

In the non-container version, everything works perfectly. I see the heartbeat, my client can join the server and walk around and do things. Perfectly fine.

However, the container version results in timeout. Launching it from powershell, I can see the server go from stand by to active, and I can see the heartbeat just fine. In my unity game, when I try to launch the local client, it simply times out. Even when testing locally trying to reach the server on a browser (via http://127.0.0.1:56100/Hello), it times out (any other port results in connection refused.

I'm out of ideas. Any clue on how to fix this? This is what my MultiplayerSettings looks like:

 {
     "RunContainer":true,
   "AssetDetails": [
     {
       "MountPath": "C:\\Assets",
       "LocalFilePath": "C:\\Assets\\LoungeServer.zip"
     }
   ],
   "PortMappingsList": [
     [
       {
         "GamePort": {
           "Number": 30000,
           "Name": "game_port",
           "Protocol": "TCP"
         },
         "NodePort": 56100
       }
     ]
   ],
   "GameCertificateDetails": [],
   "SessionConfig": {
     "SessionCookie": null,
     "SessionId": "456836cb-4d91-4697-a437-d5367e81f152",
     "InitialPlayers": [
       "Player1",
       "Player2"
     ]
   },
   "DeploymentMetadata": {
     "Environment": "LOCAL",
     "FeaturesEnabled": "List,Of,Features,Enabled"
   },
   "TitleId": "7CC82",
   "Region": "EastUs",
   "BuildId": "55364397-e2d1-41eb-a04e-e2cdab18613a",
   "RunMode": 1,
   "ContainerStartParameters": {
     "StartGameCommand": "C:\\Assets\\MetaBoyLoungeHeadless_PlayFab.bat",
     "resourcelimits": {
       "cpus": 1,
       "memorygib": 16
     },
     "imagedetails": {
       "registry": "mcr.microsoft.com",
       "imagename": "playfab/multiplayer",
       "imagetag": "wsc-10.0.17763.973.1",
       "username": "",
       "password": ""
     }
   },
   "OutputFolder": "C:\\Assets\\WindowsContainerLogOutput",
   "NumHeartBeatsForActivateResponse": 10,
   "NumHeartBeatsForTerminateResponse": 172800,
   "AgentListeningPort": 56001
 }

In my app, I'm attempting to connect to port 56100, as per NodePort. And just times out.

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.

TChuck avatar image
TChuck answered

The server was listening to 56100. I had followed the same steps from a mirror/unity integration. I was able to get their integration working properly, but could not get it working on my fishnetwork/unity integration. So I ended up just going with mirror instead. Problem was avoided and was able to get it to connect to playfab.

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.

Gosen Gao avatar image Gosen Gao commented ·

If your server is listening to 56100, then the Number parameter under GamePort should be 56100.

0 Likes 0 ·
Gosen Gao avatar image
Gosen Gao answered

If I am not misunderstood, you server is listening to port 30000 and it mapped to 56100 in the container. And you cannot connect to it with port 56100. I would suggest you create a simple app with a route which responds to the request ‘127.0.0.1: 56100/Hello’ and run it in the docker container to see if it is a docker container issue. If it works fine with the simple app, then you can follow MpsSamples/Debugging.md at main · PlayFab/MpsSamples · GitHub to debug your server. You can also provide the GSDK logs to us for research.

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.