connection resilience in a turn base room

0 votes
Hello Everyone,

Im using Appwarp , unity SDK, and i have turn base rooms.

Right now if there is any problem with the connection it  can be detected on the callbacks, and I take care of it with a bit of code.

I would like to try "Connection resilience" strategy on my games. What should I know according connection lose on turn base? if it brings it back how will it influence on turn base rooms?(Timer,Moves,etc...)

 

Thanks.
asked Sep 10, 2014 in App42 Cloud API-BaaS by noo_no1 (11 points)

1 Answer

+2 votes
Hey,
 
To use connection resiliency you will need to set recovery allowance. In setRecoveryAllowance() method you have to pass the number of seconds you want the server to retain the connection. Then whenever there is a connection error, you will receive connection_error_recoverable in onConnectDone, then you have to call recoverConnection() method to recover the lost connection.
 
While you have lost the connection and trying to recover the connection, you will lose all the game play. To deal with this, there is a special method getMoveHistory(). This method will return the last 5 moves. You can use this information to know what you have missed. You can even see the last move to check if it was your turn or not, if it is your turn then you can perform your turn
 
Whenever your connection breaks, other players will receive the onUserPaused notification to let them know that you are tying to reconnect. If you successfully get re-connected, other players will get onUserResumed notification. If you were unable to re-connect successfully within your recovery allowance time, others player will get onUserLeftRoom notification.
 
Thanks
answered Sep 10, 2014 by Suyash Mohan (900 points)
well explained!! thanks a lot!
Thanks for your explanation!!
What's the best way to simulate this problem? Turn off wifi and turn back on?
Yes! you can turn off wifi and turn back on to test connection resiliency
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...