OnPhotonPlayerConnected is called twice

Options
Hey all,

Please help me with this problem. Here's a sequence of my actions:
I call PhotonNetwork.JoinRandomRoom(), after which OnPhotonRandomJoinFailed() is called, in which I call PhotonNetwork.CreateRoom(null); . The room is created successfully. After that, on another client I call PhotonNetwork.JoinRandomRoom() after which the client joins the room successfully, but on the first client (room owner) OnPhotonPlayerConnected() is called twice. Another events like OnJoinedLobby or OnJoinedRoom are called once. There's no delay between two OnPhotonPlayerConnected(), and both times they're invoked there are 2 players in the room.

Comments

  • vadim
    Options
    You mean OnPhotonPlayerConnected message called both for room owner and 2nd client?
    Can you check this with PhotonPlayer newPlayer message parameter?
  • Hm, I believe it's pretty clear from my post that OnPhotonPlayerConnected() is called twice on one client (master client).
  • vadim
    Options
    I mean twice on one client but for different players (log newPlayer parameter in OnPhotonPlayerConnected call)
  • Tobias
    Options
    OnPhotonPlayerConnected is "called when a remote player entered the room".
    So per new player once.
    You can have it in many scripts/components, which might look like it's called more often.