using System.Collections.Generic; using Unity.Collections; namespace Unity.Netcode { /// /// Server-Side RPC /// Place holder. /// Note: Clients always send to one destination when sending RPCs to the server /// so this structure is a place holder /// public struct ServerRpcSendParams { } /// /// The receive parameters for server-side remote procedure calls /// public struct ServerRpcReceiveParams { /// /// Server-Side RPC /// The client identifier of the sender /// public ulong SenderClientId; } /// /// Server-Side RPC /// Can be used with any sever-side remote procedure call /// Note: typically this is use primarily for the /// public struct ServerRpcParams { /// /// The server RPC send parameters (currently a place holder) /// public ServerRpcSendParams Send; /// /// The client RPC receive parameters provides you with the sender's identifier /// public ServerRpcReceiveParams Receive; } /// /// Client-Side RPC /// The send parameters, when sending client RPCs, provides you wil the ability to /// target specific clients as a managed or unmanaged list: /// and /// public struct ClientRpcSendParams { /// /// IEnumerable version of target id list - use either this OR TargetClientIdsNativeArray /// Note: Even if you provide a value type such as NativeArray, enumerating it will cause boxing. /// If you want to avoid boxing, use TargetClientIdsNativeArray /// public IReadOnlyList TargetClientIds; /// /// NativeArray version of target id list - use either this OR TargetClientIds /// This option avoids any GC allocations but is a bit trickier to use. /// public NativeArray? TargetClientIdsNativeArray; } /// /// Client-Side RPC /// Place holder. /// Note: Server will always be the sender, so this structure is a place holder /// public struct ClientRpcReceiveParams { } /// /// Client-Side RPC /// Can be used with any client-side remote procedure call /// Note: Typically this is used primarily for sending to a specific list /// of clients as opposed to the default (all). /// /// public struct ClientRpcParams { /// /// The client RPC send parameters provides you with the ability to send to a specific list of clients /// public ClientRpcSendParams Send; /// /// The client RPC receive parameters (currently a place holder) /// public ClientRpcReceiveParams Receive; } #pragma warning disable IDE1006 // disable naming rule violation check // RuntimeAccessModifiersILPP will make this `public` internal struct __RpcParams #pragma warning restore IDE1006 // restore naming rule violation check { public ServerRpcParams Server; public ClientRpcParams Client; } }