Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

No master client in Photon Turn Based (Unity 5.4)

$
0
0
Hi! I use Photon Turn Based for my project and faced with the following problem :
2 players in room (max 2 players), one of them is MasterClient nothing special.
Then master client player close the application and sometimes master client does not switch to another player(OnMasterClientSwitched don't call) So now we have a room with one player and no master сlient... If a new player will go into the room, it will have two players and no master client.

I tried to switch the master client before ApplicationQuit, but the bug is still there.


void OnApplicationQuit()
{
if (PhotonNetwork.room != null)
{
{
PhotonNetwork.SetMasterClient(PhotonNetwork.otherPlayers[0]);
}
PhotonNetwork.networkingPeer.SendOutgoingCommands();
PhotonNetwork.SendOutgoingCommands();
PhotonGameManager.I.SendSuspend(true);
PhotonNetwork.LeaveRoom();
}
}

Viewing all articles
Browse latest Browse all 15755

Trending Articles