question

Manas Garai avatar image
Manas Garai asked

Modifying the MultiplayerSettings.json if one have multple ports for their game

I have gone through the documentation page for testing the game server locally using the local debugging toolset. It is still not very clear to me how to modify the Gameport.Number if I have multiple ports. Can anyone shed some light on this by giving an example of the JSON if I have multiple ports ?

10 |1200

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

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

As stated in this section: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/locally-debugging-game-servers-and-integration-with-playfab#basic-setup, and I quote, “If your game server needs multiple ports, copy/paste the existing port configuration and increment NodePort then update GamePort.Number and GamePort.Name to the required port.”. Therefore, a example JSON would be like the following:

 "PortMappingsList": [
        [
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "https_port1",
                    "Number": 5001,
                    "Protocol": "TCP"
                }
            },
            {
                "NodePort": 56200,
                "GamePort": {
                    "Name": "http_port2",
                    "Number": 5000,
                    "Protocol": "TCP"
                }
            }
        ]
    ]
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.

Manas Garai avatar image Manas Garai commented ·

Thanks, I got the debugging working but I am little confused about the output. The documentation say, MockVmAgent prints the following outputs :

  • CurrentGameState - StandingBy
  • CurrentGameState - Active
  • CurrentGameState - Terminating

and says that the game server would exit soon if the state is set to Terminating. In my case the application starts up and runs fine and I don't get the above outputs in the Powershell Window. I am attaching the output here. Could you please tell me if I am doing something wrong ?

0 Likes 0 ·
Manas Garai avatar image Manas Garai Manas Garai commented ·
0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Manas Garai commented ·

You'd need to implement the logic of shutting down your game server and set up the shutdown callback correctly, please check out this doc for more details: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/integrating-game-servers-with-gsdk#gracefully-shutting-down-your-game-server

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.