order of RPC calls

Options
if master client makes two RPC calls with RpcTarget.All sequentially(first RPC1, then RPC2), will these two RPCs be executed sequentially on each of the client? Are all RPCs delivered sequentially to each client?
Also if master client gets killed after firing RPC, will it still be called on all other clients?

In the documentation of RpcTarget.AllViaServer, it is mentioned that its benefit over RpcTarget.All is `The server's order of sending the RPCs is the same on all clients`. I didn't understand this point. Can someone please explain this point with some example.

Comments

  • Tobias
    Options
    When you use RpcTarget.All, then the sender of those messages will execute these two in order but immediately. If player A and B send RPCs and those need to be executed in the order they arrived on the server, then the target All won't help.

    You'd have to use AllViaServer, to get the same order of RPCs, when multiple users send RPCs (if you need said order).

    E.g. when you send the RPC "ImReadyToPlay", order for multiple senders does not matter.
    If you send the RPC "ImAcrossTheLine", then it will be of interest who's RPC arrived first on the server (and to get the same order on all clients).
  • raviuee
    Options
    Can you answer this part of posted question?
    `Also if master client gets killed after firing RPC, will it still be called on all other clients?`
  • Tobias
    Options
    When you called an RPC and it's queued or sent, it does not matter what happens in-game with the character or player. Meaning: Yes. The kill will only happen on the other clients, when the RPC arrives.
  • Can I ask if the RPC will be executed before the update? Or after it? Or in between?
  • Tobias
    Options
    By default, PUN dispatches incoming udpates in FixedUpdate. You can set a define to dispatch in LateUpdate.
    Have a look at PhotonHandler.LateUpdate() and you'll see where it calls this.Dispatch().