Forum Multiplayer Don't close room after disconnecting

Discussion and help relating to the PlayerIO Multiplayer API.

Don't close room after disconnecting

Postby Col » October 19th, 2017, 4:19 pm

Hello Guys,

I am developing a matchmaking game and in every room are 2 players.

Now my problem is:
If one of them disconnects (for example because of his network connection) and joins again, the room is still running and they can go on.
But if both are disconnecting at the same time, the room closes and the room data gets lost (for example the Ingame Timer).

How can I change that if both player are leaving, the room should close after 1 min and not directly?
Or how can I fix my problem, that the Timer should go on?

Sorry for my bad english and thank you
Col :D
Col
 
Posts: 4
Joined: October 1st, 2017, 1:11 pm

Re: Don't close room after disconnecting

Postby Col » October 22nd, 2017, 4:05 pm

Push
Col
 
Posts: 4
Joined: October 1st, 2017, 1:11 pm

Re: Don't close room after disconnecting

Postby Henrik » October 24th, 2017, 9:48 pm

It's not possible to change the room close timer for empty rooms, and it would be a bad idea, since there's no guarantee that either of the players will reconnect.

What you can do though is use the GameClosed method, it runs when the room closes, and you can check if the game is completed or not. If it wasn't, you could store the game state in BigDB, and when either player re-opens the room, read back the state from BigDB.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Don't close room after disconnecting

Postby Col » October 25th, 2017, 10:16 pm

Very helpful! Thanks :D
Col
 
Posts: 4
Joined: October 1st, 2017, 1:11 pm


Return to Multiplayer