Play-games-plugin-for-unity: Player disconnects if screen turn off or app goes bacground

Created on 7 Mar 2019  路  7Comments  路  Source: playgameservices/play-games-plugin-for-unity

Hello,
I m working on a realtime card game.
When i test the app, players are connected each other but if one turn off screen or take application to background user disconnects. I searched on google I found that "edit BaseGameActivity.onStop() and remove gamehelper.onStop()" but i couldnt find the classes includes these.
Any help to prevent this situation?
Thanks

Most helpful comment

Thanks for the reply.
I designed my game that if there is no response from the player (the game in background) in time system automatically response and the game continues. So isnt there any way to prevent the disconnection?

All 7 comments

Its in the documentation:

IMPORTANT: Due to the way the underlying platform works, the user's connection to the room will be severed if the user sends the game into the background. In this case, OnLeftRoom() will be called. It is not possible to reconnect to a room if this happens.

https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/RTMP.md

Thanks for the reply.
I designed my game that if there is no response from the player (the game in background) in time system automatically response and the game continues. So isnt there any way to prevent the disconnection?

So is screen turn off still disconnect or not?

I have the same issue. Player automatically disconnects when the app looses focus (user switched apps or received a system alert when the game is running).

This is very annoying for the player. It makes sense if the user gets automatically disconnected when application forced quit or on due to extended period of inactivity, but it's very annoying then it just looses focus or phone goes to sleep.

Is there any solution in play-games-plugin-for-unity for it?

I know it's definitely solvable in native Android SDK as mentioned here: https://stackoverflow.com/questions/44518833/real-time-multiplayer-google-play-games-services-peer-gets-disconnected-when-app

Thanks for your question. Play Games Services multiplayer system has been deprecated (see this notice), so we are closing this issue.

Well that's a shame

Was this page helpful?
0 / 5 - 0 ratings