OnJoinRoom photon player?

Options
I want to send all players in a room a simple chat message when a player joines or leaves a room. I did not saw a photonPlayer parameter on the OnJoinRoom. So how would i do this?

Comments

  • dreamora
    Options
    You would use the OnConnected.... function on the master client and make it call an RPC to inform all players.
    This is the job of the master client in the end, to take the 'lead' of the game and inform / update the rest about relevant things
  • Tobias
    Options
    Does the message change per game or so? If not, there is no reason to send it?
    The client that becomes master could set a message as buffered RPC. In that case, the server will take care of "greeting" new players. But: if the master switches (cause the current master leaves), the new master should set a new message.