How is RPC processed in the target ?

Options
I have been using RPCs to process my players decision, so basically during an auction in the game, players will try to bid the price, which causes RPCs to send over the network to the Master Client ( I understand the Master Client can execute locally and resulting a faster bidding action ).

My question is, if multiple RPCs are called to the Master Client in a very close timing, are they process in a single thread manner ? or they are processed parallel ?

Though i saw threads in unity specifying unity is single threaded, i am not sure how PUN is design and embedded

Answers

  • Tobias
    Options
    PUN executes incoming messages one by one, when you call DispatchIncomingCommands(). PUN does this from one thread (the Update loop) in Unity to make your life easier.

    You can send RPCs with PhotonTargets.AllViaServer (usually as second parameter of RPC).
    This does not execute the RPC locally. Instead, the server will get it and send it back, just like everyone's RPCs. The benefit is: The order in which the RPCs arrive at the server, is also the order in which all clients execute them (so: first bid can be successful, others can be ignored).