You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Documentation~/advanced-topics/message-system/rpc.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# RPC
2
2
3
-
Any process can communicate with any other process by sending a remote procedure call (RPC). As of Netcode for GameObjects version 1.8.0, the `Rpc` attribute encompasses server to client RPCs, client to server RPCs, and client to client RPCs.
3
+
Any process can communicate with any other process by sending a remote procedure call (RPC). The `Rpc` attribute is used to define who receives and executes the RPC.
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,8 @@ public enum RpcInvokePermission
40
40
}
41
41
42
42
/// <summary>
43
-
/// <para>Represents the common base class for Rpc attributes.</para>
43
+
/// <para>Marks a method as a remote procedure call (RPC).</para>
44
+
/// <para>The marked method will be executed on all game instances defined by the <see cref="SendTo"/> target.</para>
44
45
/// </summary>
45
46
[AttributeUsage(AttributeTargets.Method)]
46
47
publicclassRpcAttribute:Attribute
@@ -80,7 +81,7 @@ public struct RpcAttributeParams
80
81
publicRpcDeliveryDelivery=RpcDelivery.Reliable;
81
82
82
83
/// <summary>
83
-
/// Who has network permission to invoke this RPC
84
+
/// Controls who has permission to invoke this RPC. The default setting is <see cref="RpcInvokePermission.Everyone"/>
84
85
/// </summary>
85
86
publicRpcInvokePermissionInvokePermission;
86
87
@@ -90,7 +91,7 @@ public struct RpcAttributeParams
90
91
/// <remarks>
91
92
/// Deprecated in favor of <see cref="InvokePermission"/>.
92
93
/// </remarks>
93
-
[Obsolete("RequireOwnership is deprecated. Please use InvokePermission = RpcInvokePermission.Owner instead.")]
94
+
[Obsolete("RequireOwnership is deprecated. Please use InvokePermission = RpcInvokePermission.Owner or InvokePermission = RpcInvokePermission.Everyone instead.")]
94
95
publicboolRequireOwnership;
95
96
96
97
/// <summary>
@@ -127,15 +128,14 @@ public class ServerRpcAttribute : RpcAttribute
127
128
{
128
129
/// <summary>
129
130
/// When true, only the owner of the NetworkObject can invoke this ServerRpc.
130
-
/// This property sets the base <see cref="RpcAttribute.InvokePermission"/> to <see cref="RpcInvokePermission.Owner"/> when "RequireOwnership = true" or to <see cref="RpcInvokePermission.Everyone"/> when "RequireOwnership = false". />.
131
131
/// </summary>
132
132
/// <remarks>
133
-
/// Deprecated in favor of using <see cref="RpcAttribute"/> with <see cref="SendTo.Server"/> and an <see cref="RpcAttribute.InvokePermission"/>.
133
+
/// <para> Deprecated in favor of using <see cref="RpcAttribute"/> with a <see cref="SendTo.Server"/> target and an <see cref="RpcAttribute.InvokePermission"/>.</para>
0 commit comments