From 0cd32e0751f466431f6776aba151b777accc4c49 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Fri, 6 Dec 2024 12:00:38 -0600 Subject: [PATCH 1/3] update Adding and updating xml API documentation for ConnectionEvent and ConnectionEventData --- .../Connection/NetworkConnectionManager.cs | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs b/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs index 4296a6835a..09119e8076 100644 --- a/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs @@ -10,15 +10,54 @@ namespace Unity.Netcode { - + /// + /// The connection event type set within to signify the type of connection event notification received. + /// + /// + /// is returned as a parameter of the event notification. + /// and event types occur on the client-side of the newly connected client and on the server-side.
+ /// and event types occur on connected clients to notify that a new client (peer) has joined/connected. + ///
public enum ConnectionEvent { + /// + /// This event is set on the client-side of the newly connected client and on the server-side.
+ ///
+ /// + /// On the newly connected client side, the will be the .
+ /// On the server side, the will be the ID of the client that just connected. + ///
ClientConnected, + /// + /// This event is set on clients that are already connected to the session. + /// + /// + /// The will be the ID of the client that just connected. + /// PeerConnected, + /// + /// This event is set on the client-side of the client that disconnected client and on the server-side. + /// + /// + /// On the disconnected client side, the will be the .
+ /// On the server side, this will be the ID of the client that disconnected. + ///
ClientDisconnected, + /// + /// This event is set on clients that are already connected to the session. + /// + /// + /// The will be the ID of the client that just disconnected. + /// PeerDisconnected } + /// + /// Returned as a parameter of the event notification. + /// + /// + /// See for more details on the types of connection events received. + /// public struct ConnectionEventData { public ConnectionEvent EventType; From 9813c0d3c9f542cbf73ea9fe58a0546b9ae0d837 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Fri, 6 Dec 2024 12:21:01 -0600 Subject: [PATCH 2/3] update Adding XML API documentation for RpcTargetUse. --- .../Runtime/Messaging/RpcTargets/RpcTarget.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs index c5706a8b31..a9e4c17144 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs @@ -79,9 +79,28 @@ public enum SendTo SpecifiedInParams } + /// + /// This parameter controls the use of a particular performance optimization in situations where it can be used.
+ /// Because BaseRpcTarget is a managed type, allocating a new one is expensive, as it puts pressure on the garbage collector. + ///
+ /// + /// When using a allocation type for the RPC target(s):
+ /// You typically don't need to worry about persisting the generated. + /// When using a allocation type for the RPC target(s):
+ /// You will want to use , which returns , during initialization (i.e. ) and it to a property.
+ /// Then, When invoking the RPC, you would use your which is a persisted allocation of a given set of client identifiers. + /// !! Important !!
+ /// You will want to invoke of any persisted properties created via when despawning or destroying the associated component's . Not doing so will result in small memory leaks. + ///
public enum RpcTargetUse { + /// + /// Creates a temporary used for the frame an decorated method is invoked. + /// Temp, + /// + /// Creates a persisted that does not change and persists until it is disposed. + /// Persistent } From 5926099c10e0be1a10f5b25c5a676cba8ad54029 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Fri, 6 Dec 2024 17:07:24 -0600 Subject: [PATCH 3/3] Update RpcTarget.cs Apply adjustments from backport to this. --- .../Runtime/Messaging/RpcTargets/RpcTarget.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs index a9e4c17144..2864205769 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs @@ -80,7 +80,7 @@ public enum SendTo } /// - /// This parameter controls the use of a particular performance optimization in situations where it can be used.
+ /// This parameter configures a performance optimization. This optimization is not valid in all situations.
/// Because BaseRpcTarget is a managed type, allocating a new one is expensive, as it puts pressure on the garbage collector. ///
/// @@ -99,7 +99,7 @@ public enum RpcTargetUse /// Temp, /// - /// Creates a persisted that does not change and persists until it is disposed. + /// Creates a persisted that does not change and will persist until is called. /// Persistent }