question

hendra avatar image
hendra asked

Is it possible to reconnect to a room when the room state is closed?

Is this possible ?

1. Player call matchmake API call

2. There's no room available, so playfab creates a new server instance

3. When the game started, the server calls SetGameServerInstanceState to closed

4. The player then disconnects

5. The player call matchmake again with the previous lobbyId

My Question is

1. Can that player rejoin the room (even though it's mark as closed) ?

2. What happen when the user calls matchmake again with the previous lobbyId but that lobby has already been removed ?

3. When the player disconnects, and call NotifyMatchmakerPlayerLeft, does that mean the room state goes back to open ?

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

·
brendan avatar image
brendan answered

Correction:

1. Whether the player can rejoin the room is up to your server's custom logic. If the question is, will calling Matchmake with the specific LobbyId of a server return an OK response with a matchmaker ticket, even if the server state is set to closed, the answer is no: https://community.playfab.com/questions/12719/is-rejoinable-with-lobbyid-to-game-server-that-sta.html. Setting the state to closed means it won't come back in any matchmaking calls. Part of the idea is that you're able to set the server to closed so that you can have only a specific set of players join it, but you would need to use a custom matchmaker to return the server info, in that case.

2. If the server instance is no longer running, you'll just get the lobby not found error back.

3. No, the server instance state is only set when you call SetGameServerInstanceState.

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

hendra avatar image hendra commented ·

Thanks Brendan!

One more question,

I'm using Unity, when i want to close the server, i call Application.Quit. Should i always call Deregister Game as well ?

0 Likes 0 ·
brendan avatar image brendan hendra commented ·

If it's an externally hosted server. RegisterGame, DeregisterGame, and RefreshGameServerInstanceHeartbeat are only for externally hosted servers: https://api.playfab.com/docs/tutorials/external-game-servers

0 Likes 0 ·
hendra avatar image hendra brendan commented ·

I'm using custom game server that i upload to playfab

So all i need is too use Application.Quit ?

Because this what happens to me

1. Call matchmake

2. Create server and played the game until finish

3. When the game finished,the server calls application.quit

4. And also kicks all of the player back to menu scene

5. I wait until the server instance is back to 0 (from playfab multiplayer tab)

6. and then i matchmake again, and the server instance is 2 not 1 (I think that the previous room got called also)

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.