I have a timer in my room, the value of which I constantly write to the property of the room. I found out that for some reason the second player cannot connect to the game scene. Here are the lines of code that cause the bug
private void Update()
{
_currentPlayersCountText.text = PhotonNetwork.PlayerList.Length.ToString();
if (PhotonNetwork.IsMasterClient && PhotonNetwork.IsConnectedAndReady)
{
//...
Hashtable ht = PhotonNetwork.CurrentRoom.CustomProperties; //bug here
ht["timer"] = _roomTimer.timeRemaining;
PhotonNetwork.CurrentRoom.SetCustomProperties(ht);
}
//...
}
This is exactly what is happening here, because I commented on these lines and the player calmly entered the game scene. I also commented on other places related to time synchronization, but it had no effect.