From 1a66fb4128ad23c1770c15e82e51b1b26ef72d1a Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Fri, 6 Dec 2024 12:28:18 -0600 Subject: [PATCH 1/4] update 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 270c33257a..8504ad065c 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 0e2dc4e0c889cb0a1d8b5eda027df433453a7f7b Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Fri, 6 Dec 2024 12:28:54 -0600 Subject: [PATCH 2/4] update Updating 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 8d99c94b92..a2660f9ce3 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs @@ -67,9 +67,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 b3c8e4773d4bcbae749e1076629c257d91c71662 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Fri, 6 Dec 2024 15:58:19 -0600 Subject: [PATCH 3/4] Update com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs Co-authored-by: Emma --- .../Runtime/Messaging/RpcTargets/RpcTarget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs index a2660f9ce3..9b803da6db 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs @@ -68,7 +68,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. ///
/// From 30131abd6246be4b829b5d95a79d280b49b16f34 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Fri, 6 Dec 2024 15:58:40 -0600 Subject: [PATCH 4/4] Update com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs Co-authored-by: Emma --- .../Runtime/Messaging/RpcTargets/RpcTarget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs index 9b803da6db..7d55209c15 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs @@ -87,7 +87,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 }