Which actions do send messages?

Options
Hello everyone,
I want to be sure if some things send messages. If yes, I can't use them every frame. But I want to know if I'm allowed to use certain things in Update() every frame without wasting messages.

To be more precise, I wonder if some things like these send messages to the server and count for the messages/s.

For example:

- if(PhotonNetwork.IsMasterClient)
- if(PhotonNetwork.InRoom)
- PhotonNetwork.PlayerList.Length
- PhotonNetwork.LocalPlayer.GetPhotonTeam() (Photon.Pun.UtilityScripts)
- PhotonNetwork.CurrentRoom.PlayerCount
- PhotonNetwork.LocalPlayer.ActorNumber
- Getting players from the PlayerList, for example: foreach(Player p in PhotonNetwork.PlayerList)
- And getting the team of another player, for example: somePlayer.GetPhotonTeam()

I would be very happy if someone could clear me up and tell me if these are dangerous for the traffic and the messages/s. The things listed above are the things I'm most using where I'm worried if they send messages or not. I assume that some of them don't send messages, but I am still not sure. I would like to hear that from someone who really knows it.

Thank you very very much!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Duck,
    - if(PhotonNetwork.IsMasterClient)
    - if(PhotonNetwork.InRoom)
    - PhotonNetwork.PlayerList.Length
    - PhotonNetwork.LocalPlayer.GetPhotonTeam() (Photon.Pun.UtilityScripts)
    - PhotonNetwork.CurrentRoom.PlayerCount
    - PhotonNetwork.LocalPlayer.ActorNumber
    - Getting players from the PlayerList, for example: foreach(Player p in PhotonNetwork.PlayerList)
    - And getting the team of another player, for example: somePlayer.GetPhotonTeam()
    None of the above will make the client communicate with the server and send a request/message.
    If you check the code of each method / property, we just look up local client cached data.
  • Duck
    Options
    @JohnTube Thank you very much for your answer. I assumed that these don't communicate with the server. I just wanted to confirm it. But what is about getting the Team of another player? Because it may change during the game.