

A client could in turn send an RPC only to the server to specify starting options, such as the color they prefer or the items they have bought. A server could send an RPC to a particular client to initialize the player right after they connect, for example, to assign them their player number, spawn location, team color, etc. A client of a particular player could send RPC calls to everyone to signal that they picked up an item. For example, a server for a game which only starts after four clients have connected could send an RPC call to all clients as soon as the fourth one connects, thus starting the game. RPC calls are usually used to execute some event on all clients in the game or pass event information specifically between two parties, but you can be creative and use them however you like. For example, you can easily invoke the RPC function on all connected machines, on the server alone, on all clients but the one sending the RPC call or on a specific client. There are several possible RPC call modes to cover all common use cases. Unlike a normal function call, an RPC needs an additional parameter to denote the recipients of the RPC request. You should keep parameters to a minimum in order to get the best performance. Invoking an RPC is similar to calling a normal function and almost as easy but there are some important differences to understand.Īn RPC call can have as many parameters as you like but the network bandwidth involved will increase with the number and size of parameters. Remote Procedure Calls (RPCs) let you call functions on a remote machine. This information is for legacy projects using the old networking system.) Using RPCsĪ function must be marked as an RPC before it can be invoked remotely.(For new projects, you should use the new networking system introduced in 5.1. A client could in turn send an RPC only to the server to specify his starting options, such as the color he prefers or the items he has bought. A server could send an RPC to a particular client to initialize him right after he connects, for example, to give him his player number, spawn location, team color, etc. An integration test tests a complete app or a large part of an app. A client could send RPC calls to everyone to signal that he picked up an item. A widget test (in other UI frameworks referred to as component test) tests a single widget.



(For new projects, you should use the new networking system introduced in 5.1.
