What is the different between a peer dissconnected to a peer leaving a room.
if a participent disconnect from a room, what would his status be? STATUS_JOINED or STATUS_LEFT?
I'm working on a fairly long turn based game (should be a few minutes game) and i believe there would be alot of disconnecting cases that i would like to resolve.
Would it be possible to resend an invitation to the disconnected user and get him back to the room?
if the room creator got disconnected, and the previuse was possible, would he still be the creator of that game after reconnecting?
The first caveat is that the Real Time Multiplayer API is not really meant for turn-based games. So if someone gets dropped from the room, they can't get re-added; also, you can't remain in the room if your Activity goes to the background. Now, to get to the question:
If a participant leaves the room, their status is STATUS_LEFT. If they are in the room but can't be reached yet (i.e. the player is not yet part of the P2P connected graph), they might be in the STATUS_JOINED state, but not connected. Also, due to a bug, you might see a participant who has STATUS_LEFT but still reports as connected. So, in your logic to check if a participant is "really there", you should check that they are in STATUS_JOINED state and connected (not just one or the other).
You can't re-send an invite to a disconnected user to get them back in the room. But if all players have the game state, nothing prevents you from building a new room from scratch to continue the game. Of course, this won't work with automatch (because you can't request a new room with the same participants as the old one), but would work when players are playing with friends from their circles.
There is no such thing as the "room owner" -- it's a P2P symmetrical network. If player A creates the room and invites player B and player C, player A can then leave the room and the room will still work for players B and C. There is no requirement that the creator of the room remain in the room.
Hope this helps!
来源:https://stackoverflow.com/questions/19202066/when-a-peer-disconected-from-a-room-in-google-play-services