Execution Table
The following table details the execution of ServerRpc
and ClientRpc
functions:
Function | Server | Client | Host (Server+Client) |
---|---|---|---|
ServerRpc Send | |||
ServerRpc Execute | |||
ClientRpc Send | |||
ClientRpc Execute |
An RPC function never executes its body immediately since the function call really is a stand-in for a network transmission. Even a ServerRpc
called by a host (an instance that is a client and the server at the same time, or listen-server) will not be executed immediately. It will instead follow the regular network frame staging first and queued-up to be executed locally in the next network frame.
Structure of a typical ServerRpc
:
Pseudo-code sample of a ServerRpc
: