How to reconnect to a room in Google real time muliplayer with Unity3D ?
I create a quick game multiplayer connection
const int MinOpponents = 1, MaxOpponents = 1;
const int GameVariant = 0;
PlayGamesPlatform.Instance.RealTime.CreateQuickGame(MinOpponents,MaxOpponent,GameVariant,listener);
and Create With Invitation Screen
PlayGamesPlatform.Instance.RealTime.CreateWithInvitationScreen(
minimumOpponents,maximumOpponents,gameVariation, listener);
Connected to a room with one opponent
I dissabled my Ethernet connection of one device
Control Panel > All Control Panel Items > Network and Sharing Center > Change Adapter Settings > Ethernet >Disable this network device
I Enabled my Ethernet connection by
Control Panel > All Control Panel Items > Network and Sharing Center > Change Adapter Settings > Ethernet >Enable this network device
In my game each player’s data is sending to each other .
PlayGamesPlatform.Instance.RealTime.SendMessageToAll (true, messageToSend);
Before Ethernet disconnect it works perfect . After ethernet reconnection data is not getting to each other , but if one device left the room , following event will call.
public void OnPeersDisconnected (string[] participantIds)
{
foreach (string participantID in participantIds) {
ShowMPStatus ("Player " + participantID + " has left.");
if (updateListener != null) {
updateListener.PlayerLeftRoom (participantID);
}
}
}
How to detect , player disconnected from net and how to reconnect to same room properly