question

Dawid Majdanik avatar image
Dawid Majdanik asked

I can join server only once,I can join my server only once

Hello,

I started developing my project and I am adding PlayFab support. Relying on available projects I did first connection with my server and I can connect multiple clients from different PCs so I think it works like it should.

The problem I have is that it works only once after releasing server. When server is deployed I can join it and work on my project but when every client disconnects and server gets empty, I no longer can join it. I have to remove server and deploy new one, so I can join, otherwise I get "null" string message in my console.

The way how I ask for my server is (on client) "PlayFabMultiplayerAPI.RequestMultiplayerServer".

Once server is empty should I call method that flags this server empty or should I request it in different way?

Example:

1. Deploying server

2. Clients join server and play

3. Everyone disconnects so server is empty

4. No one can join server anyone, I have to remove this instance and create new one.

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

·
Seth Du avatar image
Seth Du answered

About MPS design

The server build behavior totally depends on your code. As PlayFab Multiplayer Server is designed for session-based game, like MOBA, 1v1, Battel Royal, it is a common scenario that the server instance shuts down and release resources when there are no connections. MMORPG that requires long time running is not suitable.

About long time running

I don’t know your server build code, but please check the delegation of PlayFabMultiplayerAgentAPI.OnShutDownCallback, if you refer to the official sample, when this function is triggered, the server build will check the current connection number of players, and you may modify this part of code to keep the instance running. There is 750 core hours free quota (the lightest VM has 2 cores, which means you will have up to 375 running hours) and we suggest shutting down the server immediately when your test is done.

About auto allocation

If you are using Matchmaking system of PlayFab, you can enable auto-allocation and select your server build. When a match is found, players can call GetMatch API to get allocated server IP/port. Otherwise, PlayFabMultiplayerAPI.RequestMultiplayerServer API is required. However, I don’t recommend permitting clients to call this API because there can be abusive uses from malicious players, hence implementing it on an Azure Function should be a promising idea, where necessary verification steps can be done.

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.