Skip to content

Commit 35dad81

Browse files
committed
RpcParams corrections
1 parent 4aa8320 commit 35dad81

File tree

2 files changed

+56
-13
lines changed

2 files changed

+56
-13
lines changed

com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,54 @@
33

44
namespace Unity.Netcode
55
{
6+
/// <summary>
7+
/// Specifies how RPC messages should be handled in terms of local execution timing
8+
/// </summary>
69
public enum LocalDeferMode
710
{
11+
/// <summary>
12+
/// Uses the default behavior for RPC message handling
13+
/// </summary>
814
Default,
15+
16+
/// <summary>
17+
/// Defers the local execution of the RPC until the next network tick
18+
/// </summary>
919
Defer,
20+
21+
/// <summary>
22+
/// Executes the RPC immediately on the local client without waiting for network synchronization
23+
/// </summary>
1024
SendImmediate
1125
}
26+
1227
/// <summary>
13-
/// Generic RPC
28+
/// Generic RPC. Defines parameters for sending Remote Procedure Calls (RPCs) in the network system
1429
/// </summary>
1530
public struct RpcSendParams
1631
{
32+
/// <summary>
33+
/// Specifies the target that will receive this RPC
34+
/// </summary>
1735
public BaseRpcTarget Target;
1836

37+
/// <summary>
38+
/// Controls how the RPC is handled for local execution timing
39+
/// </summary>
1940
public LocalDeferMode LocalDeferMode;
2041

42+
/// <summary>
43+
/// Implicitly converts a BaseRpcTarget to RpcSendParams
44+
/// </summary>
45+
/// <param name="target">The RPC target to convert</param>
46+
/// <returns>A new RpcSendParams instance with the specified target</returns>
2147
public static implicit operator RpcSendParams(BaseRpcTarget target) => new RpcSendParams { Target = target };
48+
49+
/// <summary>
50+
/// Implicitly converts a LocalDeferMode to RpcSendParams
51+
/// </summary>
52+
/// <param name="deferMode">The defer mode to convert</param>
53+
/// <returns>A new RpcSendParams instance with the specified defer mode</returns>
2254
public static implicit operator RpcSendParams(LocalDeferMode deferMode) => new RpcSendParams { LocalDeferMode = deferMode };
2355
}
2456

@@ -51,9 +83,32 @@ public struct RpcParams
5183
/// </summary>
5284
public RpcReceiveParams Receive;
5385

86+
/// <summary>
87+
/// Implicitly converts RpcSendParams to RpcParams
88+
/// </summary>
89+
/// <param name="send">The send parameters to convert</param>
90+
/// <returns>A new RpcParams instance with the specified send parameters</returns>
5491
public static implicit operator RpcParams(RpcSendParams send) => new RpcParams { Send = send };
92+
93+
/// <summary>
94+
/// Implicitly converts a BaseRpcTarget to RpcParams
95+
/// </summary>
96+
/// <param name="target">The RPC target to convert</param>
97+
/// <returns>A new RpcParams instance with the specified target in its send parameters</returns>
5598
public static implicit operator RpcParams(BaseRpcTarget target) => new RpcParams { Send = new RpcSendParams { Target = target } };
99+
100+
/// <summary>
101+
/// Implicitly converts a LocalDeferMode to RpcParams
102+
/// </summary>
103+
/// <param name="deferMode">The defer mode to convert</param>
104+
/// <returns>A new RpcParams instance with the specified defer mode in its send parameters</returns>
56105
public static implicit operator RpcParams(LocalDeferMode deferMode) => new RpcParams { Send = new RpcSendParams { LocalDeferMode = deferMode } };
106+
107+
/// <summary>
108+
/// Implicitly converts RpcReceiveParams to RpcParams
109+
/// </summary>
110+
/// <param name="receive">The receive parameters to convert</param>
111+
/// <returns>A new RpcParams instance with the specified receive parameters</returns>
57112
public static implicit operator RpcParams(RpcReceiveParams receive) => new RpcParams { Receive = receive };
58113
}
59114

pvpExceptions.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@
3737
"Unity.Netcode.ServerRpcAttribute: RequireOwnership: undocumented",
3838
"Unity.Netcode.ServerRpcAttribute: .ctor(): undocumented",
3939
"Unity.Netcode.ClientRpcAttribute: .ctor(): undocumented",
40-
"Unity.Netcode.LocalDeferMode: undocumented",
41-
"Unity.Netcode.LocalDeferMode: Default: undocumented",
42-
"Unity.Netcode.LocalDeferMode: Defer: undocumented",
43-
"Unity.Netcode.LocalDeferMode: SendImmediate: undocumented",
44-
"Unity.Netcode.RpcSendParams: Target: undocumented",
45-
"Unity.Netcode.RpcSendParams: LocalDeferMode: undocumented",
46-
"Unity.Netcode.RpcSendParams: RpcSendParams op_Implicit(BaseRpcTarget): undocumented",
47-
"Unity.Netcode.RpcSendParams: RpcSendParams op_Implicit(LocalDeferMode): undocumented",
48-
"Unity.Netcode.RpcParams: RpcParams op_Implicit(RpcSendParams): undocumented",
49-
"Unity.Netcode.RpcParams: RpcParams op_Implicit(BaseRpcTarget): undocumented",
50-
"Unity.Netcode.RpcParams: RpcParams op_Implicit(LocalDeferMode): undocumented",
51-
"Unity.Netcode.RpcParams: RpcParams op_Implicit(RpcReceiveParams): undocumented",
5240
"Unity.Netcode.StaleDataHandling: undocumented",
5341
"Unity.Netcode.StaleDataHandling: Ignore: undocumented",
5442
"Unity.Netcode.StaleDataHandling: Reanticipate: undocumented",

0 commit comments

Comments
 (0)