From 7a95a1001b260adbad83f2b2a6742096002ca0cb Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 1 Apr 2025 10:53:26 +0200 Subject: [PATCH 01/25] Initial PR to separate Test stuff from Missing API description --- pvpExceptions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/pvpExceptions.json b/pvpExceptions.json index 0a338d445a..5bcda0770f 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -108,6 +108,7 @@ "Unity.Netcode.NetworkTransport.TransportEventDelegate: missing ", "Unity.Netcode.NetworkTransport.TransportEventDelegate: missing ", "Unity.Netcode.Transports.UTP.UnityTransport.ConnectionAddressData: IsIpv6: undocumented", + "Unity.Netcode.TestHelpers.Runtime.ObjectNameIdentifier: undocumented", "Unity.Netcode.TestHelpers.Runtime.ObjectNameIdentifier: void OnNetworkSpawn(): undocumented", "Unity.Netcode.TestHelpers.Runtime.ObjectNameIdentifier: void RegisterAndLabelNetworkObject(): undocumented", From 96cb8d8e6b16276fa75ad2695eaa2434fa777757 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 13:16:34 +0200 Subject: [PATCH 02/25] 150-1 PVP fixes --- .../TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs | 1 - .../Runtime/Components/BufferDataValidationComponent.cs | 1 - .../NetworkVariableBaseInitializesWhenPersisted.cs | 1 + pvpExceptions.json | 8 -------- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs index 3669c36f16..d09736a387 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs @@ -425,7 +425,6 @@ private static void SceneManagerValidationAndTestRunnerInitialization(NetworkMan /// The Server NetworkManager /// The Clients NetworkManager /// called immediately after server is started and before client(s) are started - /// public static bool Start(bool host, NetworkManager server, NetworkManager[] clients, BeforeClientStartCallback callback = null) { if (s_IsStarted) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs index 3912448423..0e2b7fd869 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs @@ -54,7 +54,6 @@ private void Start() /// /// Returns back whether the test has completed the total number of iterations /// - /// public bool IsTestComplete() { if (m_CurrentBufferSize > MaximumBufferSize || TestFailed) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs index 2a9a1b052e..2ce7186db6 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs @@ -334,6 +334,7 @@ public void Initialize(NetworkManager networkManager) /// /// This validates that the instances persisted to the next test set and persisted /// between network sessions + /// public bool ValidateInstanceSpawnCount(int minCount) { // First pass we should have no instances diff --git a/pvpExceptions.json b/pvpExceptions.json index 5bcda0770f..6d63494d65 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -10,14 +10,6 @@ "Failed to find a suitable OpenCL device, baking cannot use GPU lightmapper." ] }, - "PVP-150-1": { - "errors": [ - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: bool Start(bool, NetworkManager, NetworkManager[], BeforeClientStartCallback): empty tag", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: IEnumerator WaitForClientsConnected(NetworkManager[], ResultWrapper, float): XML is not well-formed: An identifier was expected", - "Unity.Netcode.RuntimeTests.BufferDataValidationComponent: bool IsTestComplete(): empty tag", - "Unity.Netcode.RuntimeTests.NetworkVariableBaseInitializesWhenPersisted.PrefabInstanceHandler: bool ValidateInstanceSpawnCount(int): XML is not well-formed: Expected an end tag for element 'summary'" - ] - }, "PVP-151-1": { "errors": [ "Unity.Netcode.NetworkConfig: Prefabs: undocumented", From 6d9bf0dbf2a181f1c19506015bf49f898ea4b492 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 7 Apr 2025 15:05:12 +0200 Subject: [PATCH 03/25] NetworkPrefab and NetworkPrefabs corrections --- .../Runtime/Configuration/NetworkPrefab.cs | 26 +++++++++++++++++++ .../Runtime/Configuration/NetworkPrefabs.cs | 8 ++++++ 2 files changed, 34 insertions(+) diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs index 9cc2158cc1..c101104269 100644 --- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs +++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs @@ -57,6 +57,11 @@ public class NetworkPrefab /// public GameObject OverridingTargetPrefab; + /// + /// Compares this NetworkPrefab with another to determine equality + /// + /// The NetworkPrefab to compare against + /// True if all fields match between the two NetworkPrefabs, false otherwise public bool Equals(NetworkPrefab other) { return Override == other.Override && @@ -66,6 +71,12 @@ public bool Equals(NetworkPrefab other) OverridingTargetPrefab == other.OverridingTargetPrefab; } + /// + /// Gets the GlobalObjectIdHash of the source prefab based on the current override settings + /// + /// The hash value identifying the source prefab + /// Thrown when required prefab references are missing or invalid + /// Thrown when Override has an invalid value public uint SourcePrefabGlobalObjectIdHash { get @@ -98,6 +109,12 @@ public uint SourcePrefabGlobalObjectIdHash } } + /// + /// Gets the GlobalObjectIdHash of the target prefab when using prefab overrides + /// + /// The hash value identifying the target prefab, or 0 if no override is set + /// Thrown when required prefab references are missing or invalid + /// Thrown when Override has an invalid value public uint TargetPrefabGlobalObjectIdHash { get @@ -122,6 +139,11 @@ public uint TargetPrefabGlobalObjectIdHash } } + /// + /// Validates the NetworkPrefab configuration to ensure all required fields are properly set + /// + /// Optional index used for error reporting when validating lists of prefabs + /// True if the NetworkPrefab is valid and ready for use, false otherwise public bool Validate(int index = -1) { NetworkObject networkObject; @@ -224,6 +246,10 @@ public bool Validate(int index = -1) return true; } + /// + /// Returns a string representation of this NetworkPrefab's source and target hash values + /// + /// A string containing the source and target hash values public override string ToString() { return $"{{SourceHash: {SourceHashToOverride}, TargetHash: {TargetPrefabGlobalObjectIdHash}}}"; diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs index 42758f7e78..26a33ce1b8 100644 --- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs +++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs @@ -39,6 +39,9 @@ public class NetworkPrefabs [NonSerialized] public Dictionary OverrideToNetworkPrefab = new Dictionary(); + /// + /// Gets the read-only list of all registered network prefabs + /// public IReadOnlyList Prefabs => m_Prefabs; [NonSerialized] @@ -84,6 +87,7 @@ internal void Shutdown() /// Processes the if one is present for use during runtime execution, /// else processes . /// + /// /// When true, logs warnings about invalid prefabs that are removed during initialization public void Initialize(bool warnInvalid = true) { m_Prefabs.Clear(); @@ -156,6 +160,8 @@ public void Initialize(bool warnInvalid = true) /// /// Add a new NetworkPrefab instance to the list /// + /// The NetworkPrefab to add + /// True if the prefab was successfully added, false if it was invalid or already registered /// /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually. /// @@ -177,6 +183,7 @@ public bool Add(NetworkPrefab networkPrefab) /// /// Remove a NetworkPrefab instance from the list /// + /// The NetworkPrefab to remove /// /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually. /// @@ -199,6 +206,7 @@ public void Remove(NetworkPrefab prefab) /// /// Remove a NetworkPrefab instance with matching from the list /// + /// The GameObject to match against for removal /// /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually. /// From 0fedf0cf96467d05ce2db993754e07381ddff64a Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 13:23:34 +0200 Subject: [PATCH 04/25] The rest of NetworkPrefab APIs --- .../Runtime/Configuration/NetworkPrefabs.cs | 5 ++++- pvpExceptions.json | 14 +------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs index 26a33ce1b8..6e801f5b61 100644 --- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs +++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs @@ -65,6 +65,9 @@ private void RemoveTriggeredByNetworkPrefabList(NetworkPrefab networkPrefab) m_Prefabs.Remove(networkPrefab); } + /// + /// Finalizer that ensures proper cleanup of network prefab resources + /// ~NetworkPrefabs() { Shutdown(); @@ -87,7 +90,7 @@ internal void Shutdown() /// Processes the if one is present for use during runtime execution, /// else processes . /// - /// /// When true, logs warnings about invalid prefabs that are removed during initialization + /// When true, logs warnings about invalid prefabs that are removed during initialization public void Initialize(bool warnInvalid = true) { m_Prefabs.Clear(); diff --git a/pvpExceptions.json b/pvpExceptions.json index 6d63494d65..2f603b040c 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -12,19 +12,7 @@ }, "PVP-151-1": { "errors": [ - "Unity.Netcode.NetworkConfig: Prefabs: undocumented", - "Unity.Netcode.NetworkPrefab: bool Equals(NetworkPrefab): undocumented", - "Unity.Netcode.NetworkPrefab: SourcePrefabGlobalObjectIdHash: undocumented", - "Unity.Netcode.NetworkPrefab: TargetPrefabGlobalObjectIdHash: undocumented", - "Unity.Netcode.NetworkPrefab: bool Validate(int): undocumented", - "Unity.Netcode.NetworkPrefab: string ToString(): undocumented", - "Unity.Netcode.NetworkPrefabs: Prefabs: undocumented", - "Unity.Netcode.NetworkPrefabs: void Finalize(): undocumented", - "Unity.Netcode.NetworkPrefabs: void Initialize(bool): missing ", - "Unity.Netcode.NetworkPrefabs: bool Add(NetworkPrefab): missing ", - "Unity.Netcode.NetworkPrefabs: bool Add(NetworkPrefab): missing ", - "Unity.Netcode.NetworkPrefabs: void Remove(NetworkPrefab): missing ", - "Unity.Netcode.NetworkPrefabs: void Remove(GameObject): missing ", + "Unity.Netcode.NetworkConfig: Prefabs: undocumented", "Unity.Netcode.ConnectionEventData: EventType: undocumented", "Unity.Netcode.RpcException: undocumented", "Unity.Netcode.RpcException: .ctor(string): undocumented", From 40c6e58c3f1ac2af65b13f11c776d5e85f5b1687 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 7 Apr 2025 14:54:39 +0200 Subject: [PATCH 05/25] AnticipatedNetworkVariable corrected --- .../AnticipatedNetworkVariable.cs | 60 ++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs index 94625722e3..b53ce853e5 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs @@ -4,10 +4,21 @@ namespace Unity.Netcode { - + /// + /// Defines how anticipated network variables handle authoritative updates that are older than the current anticipated state + /// public enum StaleDataHandling { + /// + /// Ignores authoritative updates that are older than the current anticipated state. + /// The anticipated value will not be replaced until a newer authoritative update is received. + /// Ignore, + + /// + /// Applies authoritative updates even if they are older than the current anticipated state. + /// This triggers reanticipation to calculate a new anticipated value based on the authoritative state. + /// Reanticipate } @@ -85,6 +96,12 @@ public class AnticipatedNetworkVariable : NetworkVariableBase #pragma warning restore IDE0001 public StaleDataHandling StaleDataHandling; + /// + /// Delegate for handling changes in the authoritative value + /// + /// The network variable that changed + /// The previous value before the change + /// The new value after the change public delegate void OnAuthoritativeValueChangedDelegate(AnticipatedNetworkVariable variable, in T previousValue, in T newValue); /// @@ -121,6 +138,9 @@ public void ResetAnticipation() private AnticipatedObject m_AnticipatedObject; + /// + /// Initializes the network variable, setting up initial values and registering with the anticipation system + /// public override void OnInitialize() { m_AuthoritativeValue.Initialize(m_NetworkBehaviour); @@ -133,6 +153,10 @@ public override void OnInitialize() } } + /// + /// Checks if the current value has changed enough from its last synchronized value to warrant a new network update + /// + /// True if the value should be synchronized, false otherwise public override bool ExceedsDirtinessThreshold() { return m_AuthoritativeValue.ExceedsDirtinessThreshold(); @@ -227,6 +251,10 @@ public T AuthoritativeValue /// See , , , and so on /// for examples. /// + /// The authoritative value to interpolate from + /// The anticipated value to interpolate to + /// The interpolation factor between 0 and 1 + /// The interpolated value public delegate T SmoothDelegate(T authoritativeValue, T anticipatedValue, float amount); private SmoothDelegate m_SmoothDelegate = null; @@ -242,6 +270,9 @@ public AnticipatedNetworkVariable(T value = default, }; } + /// + /// Updates the smooth interpolation state if active + /// public void Update() { if (m_CurrentSmoothTime < m_SmoothDuration) @@ -253,6 +284,9 @@ public void Update() } } + /// + /// Releases all resources used by this network variable + /// public override void Dispose() { if (m_IsDisposed) @@ -357,26 +391,45 @@ public void Smooth(in T from, in T to, float durationSeconds, SmoothDelegate how m_HasSmoothValues = true; } + /// + /// Checks if the variable has been modified since the last network synchronization + /// + /// True if the variable needs to be synchronized, false otherwise public override bool IsDirty() { return m_AuthoritativeValue.IsDirty(); } + /// + /// Resets the dirty state after network synchronization + /// public override void ResetDirty() { m_AuthoritativeValue.ResetDirty(); } + /// + /// Writes only the changes in the variable's value to the network stream + /// + /// Buffer to write the delta to public override void WriteDelta(FastBufferWriter writer) { m_AuthoritativeValue.WriteDelta(writer); } + /// + /// Writes the complete state of the variable to the network stream + /// + /// Buffer to write the field to public override void WriteField(FastBufferWriter writer) { m_AuthoritativeValue.WriteField(writer); } + /// + /// Reads the complete state of the variable from the network stream + /// + /// Buffer to read the field from public override void ReadField(FastBufferReader reader) { m_AuthoritativeValue.ReadField(reader); @@ -384,6 +437,11 @@ public override void ReadField(FastBufferReader reader) NetworkVariableSerialization.Duplicate(m_AnticipatedValue, ref m_PreviousAnticipatedValue); } + /// + /// Reads changes in the variable's value from the network stream + /// + /// Buffer to read the delta from + /// Whether to maintain the dirty state after reading public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta) { m_AuthoritativeValue.ReadDelta(reader, keepDirtyDelta); From 0917354964cc990190f0c347191b972a8370aceb Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 13:26:11 +0200 Subject: [PATCH 06/25] pvpException file corrections after AnticipatedNetworkVariable changes --- pvpExceptions.json | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/pvpExceptions.json b/pvpExceptions.json index 2f603b040c..094ad41482 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -52,23 +52,6 @@ "Unity.Netcode.StaleDataHandling: undocumented", "Unity.Netcode.StaleDataHandling: Ignore: undocumented", "Unity.Netcode.StaleDataHandling: Reanticipate: undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: void OnInitialize(): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: bool ExceedsDirtinessThreshold(): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: .ctor(T, StaleDataHandling): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: void Update(): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: void Dispose(): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: void Finalize(): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: bool IsDirty(): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: void ResetDirty(): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: void WriteDelta(FastBufferWriter): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: void WriteField(FastBufferWriter): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: void ReadField(FastBufferReader): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable: void ReadDelta(FastBufferReader, bool): undocumented", - "Unity.Netcode.AnticipatedNetworkVariable.OnAuthoritativeValueChangedDelegate: undocumented", - "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", - "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", - "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", - "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", "Unity.Netcode.NetworkList: void Finalize(): undocumented", "Unity.Netcode.NetworkVariable: CheckExceedsDirtinessThreshold: undocumented", "Unity.Netcode.NetworkVariable: bool ExceedsDirtinessThreshold(): undocumented", From cdc75608085114b4f7489f89460a6d12a53e7166 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 10:49:42 +0200 Subject: [PATCH 07/25] NetworkVariable corrections and added inheritdocs when API is override --- .../AnticipatedNetworkVariable.cs | 34 ++++--------------- .../NetworkVariable/NetworkVariable.cs | 20 +++++++++++ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs index b53ce853e5..fce8c058f0 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs @@ -284,9 +284,7 @@ public void Update() } } - /// - /// Releases all resources used by this network variable - /// + /// public override void Dispose() { if (m_IsDisposed) @@ -391,45 +389,31 @@ public void Smooth(in T from, in T to, float durationSeconds, SmoothDelegate how m_HasSmoothValues = true; } - /// - /// Checks if the variable has been modified since the last network synchronization - /// - /// True if the variable needs to be synchronized, false otherwise + /// public override bool IsDirty() { return m_AuthoritativeValue.IsDirty(); } - /// - /// Resets the dirty state after network synchronization - /// + /// public override void ResetDirty() { m_AuthoritativeValue.ResetDirty(); } - /// - /// Writes only the changes in the variable's value to the network stream - /// - /// Buffer to write the delta to + /// public override void WriteDelta(FastBufferWriter writer) { m_AuthoritativeValue.WriteDelta(writer); } - /// - /// Writes the complete state of the variable to the network stream - /// - /// Buffer to write the field to + /// public override void WriteField(FastBufferWriter writer) { m_AuthoritativeValue.WriteField(writer); } - /// - /// Reads the complete state of the variable from the network stream - /// - /// Buffer to read the field from + /// public override void ReadField(FastBufferReader reader) { m_AuthoritativeValue.ReadField(reader); @@ -437,11 +421,7 @@ public override void ReadField(FastBufferReader reader) NetworkVariableSerialization.Duplicate(m_AnticipatedValue, ref m_PreviousAnticipatedValue); } - /// - /// Reads changes in the variable's value from the network stream - /// - /// Buffer to read the delta from - /// Whether to maintain the dirty state after reading + /// public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta) { m_AuthoritativeValue.ReadDelta(reader, keepDirtyDelta); diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs index 6d1d370316..b70084588e 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs @@ -22,10 +22,23 @@ public class NetworkVariable : NetworkVariableBase /// public OnValueChangedDelegate OnValueChanged; + /// + /// Delegate that determines if the difference between two values exceeds a threshold for network synchronization + /// + /// The previous value to compare against + /// The new value to compare + /// True if the difference exceeds the threshold and should be synchronized, false otherwise public delegate bool CheckExceedsDirtinessThresholdDelegate(in T previousValue, in T newValue); + /// + /// Delegate instance for checking if value changes exceed the dirtiness threshold + /// public CheckExceedsDirtinessThresholdDelegate CheckExceedsDirtinessThreshold; + /// + /// Determines if the current value has changed enough from its previous value to warrant network synchronization + /// + /// True if the value should be synchronized, false otherwise public override bool ExceedsDirtinessThreshold() { if (CheckExceedsDirtinessThreshold != null && m_HasPreviousValue) @@ -36,6 +49,9 @@ public override bool ExceedsDirtinessThreshold() return true; } + /// + /// Initializes the NetworkVariable by setting up initial and previous values + /// public override void OnInitialize() { base.OnInitialize(); @@ -171,6 +187,7 @@ internal ref T RefValue() return ref m_InternalValue; } + /// public override void Dispose() { if (m_IsDisposed) @@ -201,6 +218,9 @@ public override void Dispose() m_PreviousValue = default; } + /// + /// Finalizer that ensures proper cleanup of resources + /// ~NetworkVariable() { Dispose(); From 4aa8320e136f71f6553d1c9d24018f93558ed279 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 13:29:38 +0200 Subject: [PATCH 08/25] pvpExceptions update after cherry pick --- pvpExceptions.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pvpExceptions.json b/pvpExceptions.json index 094ad41482..3b6da38a30 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -53,13 +53,6 @@ "Unity.Netcode.StaleDataHandling: Ignore: undocumented", "Unity.Netcode.StaleDataHandling: Reanticipate: undocumented", "Unity.Netcode.NetworkList: void Finalize(): undocumented", - "Unity.Netcode.NetworkVariable: CheckExceedsDirtinessThreshold: undocumented", - "Unity.Netcode.NetworkVariable: bool ExceedsDirtinessThreshold(): undocumented", - "Unity.Netcode.NetworkVariable: void OnInitialize(): undocumented", - "Unity.Netcode.NetworkVariable: bool CheckDirtyState(bool): missing ", - "Unity.Netcode.NetworkVariable: void Dispose(): undocumented", - "Unity.Netcode.NetworkVariable: void Finalize(): undocumented", - "Unity.Netcode.NetworkVariable.CheckExceedsDirtinessThresholdDelegate: undocumented", "Unity.Netcode.NetworkVariableUpdateTraits: undocumented", "Unity.Netcode.NetworkVariableUpdateTraits: MinSecondsBetweenUpdates: undocumented", "Unity.Netcode.NetworkVariableUpdateTraits: MaxSecondsBetweenUpdates: undocumented", From 35dad813cfa037360724759420aa6db071f94d74 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 7 Apr 2025 14:30:33 +0200 Subject: [PATCH 09/25] RpcParams corrections --- .../Runtime/Messaging/RpcParams.cs | 57 ++++++++++++++++++- pvpExceptions.json | 12 ---- 2 files changed, 56 insertions(+), 13 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs index 7eb1a18009..b302e3f8f7 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs @@ -3,22 +3,54 @@ namespace Unity.Netcode { + /// + /// Specifies how RPC messages should be handled in terms of local execution timing + /// public enum LocalDeferMode { + /// + /// Uses the default behavior for RPC message handling + /// Default, + + /// + /// Defers the local execution of the RPC until the next network tick + /// Defer, + + /// + /// Executes the RPC immediately on the local client without waiting for network synchronization + /// SendImmediate } + /// - /// Generic RPC + /// Generic RPC. Defines parameters for sending Remote Procedure Calls (RPCs) in the network system /// public struct RpcSendParams { + /// + /// Specifies the target that will receive this RPC + /// public BaseRpcTarget Target; + /// + /// Controls how the RPC is handled for local execution timing + /// public LocalDeferMode LocalDeferMode; + /// + /// Implicitly converts a BaseRpcTarget to RpcSendParams + /// + /// The RPC target to convert + /// A new RpcSendParams instance with the specified target public static implicit operator RpcSendParams(BaseRpcTarget target) => new RpcSendParams { Target = target }; + + /// + /// Implicitly converts a LocalDeferMode to RpcSendParams + /// + /// The defer mode to convert + /// A new RpcSendParams instance with the specified defer mode public static implicit operator RpcSendParams(LocalDeferMode deferMode) => new RpcSendParams { LocalDeferMode = deferMode }; } @@ -51,9 +83,32 @@ public struct RpcParams /// public RpcReceiveParams Receive; + /// + /// Implicitly converts RpcSendParams to RpcParams + /// + /// The send parameters to convert + /// A new RpcParams instance with the specified send parameters public static implicit operator RpcParams(RpcSendParams send) => new RpcParams { Send = send }; + + /// + /// Implicitly converts a BaseRpcTarget to RpcParams + /// + /// The RPC target to convert + /// A new RpcParams instance with the specified target in its send parameters public static implicit operator RpcParams(BaseRpcTarget target) => new RpcParams { Send = new RpcSendParams { Target = target } }; + + /// + /// Implicitly converts a LocalDeferMode to RpcParams + /// + /// The defer mode to convert + /// A new RpcParams instance with the specified defer mode in its send parameters public static implicit operator RpcParams(LocalDeferMode deferMode) => new RpcParams { Send = new RpcSendParams { LocalDeferMode = deferMode } }; + + /// + /// Implicitly converts RpcReceiveParams to RpcParams + /// + /// The receive parameters to convert + /// A new RpcParams instance with the specified receive parameters public static implicit operator RpcParams(RpcReceiveParams receive) => new RpcParams { Receive = receive }; } diff --git a/pvpExceptions.json b/pvpExceptions.json index 3b6da38a30..ecf4211a49 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -37,18 +37,6 @@ "Unity.Netcode.ServerRpcAttribute: RequireOwnership: undocumented", "Unity.Netcode.ServerRpcAttribute: .ctor(): undocumented", "Unity.Netcode.ClientRpcAttribute: .ctor(): undocumented", - "Unity.Netcode.LocalDeferMode: undocumented", - "Unity.Netcode.LocalDeferMode: Default: undocumented", - "Unity.Netcode.LocalDeferMode: Defer: undocumented", - "Unity.Netcode.LocalDeferMode: SendImmediate: undocumented", - "Unity.Netcode.RpcSendParams: Target: undocumented", - "Unity.Netcode.RpcSendParams: LocalDeferMode: undocumented", - "Unity.Netcode.RpcSendParams: RpcSendParams op_Implicit(BaseRpcTarget): undocumented", - "Unity.Netcode.RpcSendParams: RpcSendParams op_Implicit(LocalDeferMode): undocumented", - "Unity.Netcode.RpcParams: RpcParams op_Implicit(RpcSendParams): undocumented", - "Unity.Netcode.RpcParams: RpcParams op_Implicit(BaseRpcTarget): undocumented", - "Unity.Netcode.RpcParams: RpcParams op_Implicit(LocalDeferMode): undocumented", - "Unity.Netcode.RpcParams: RpcParams op_Implicit(RpcReceiveParams): undocumented", "Unity.Netcode.StaleDataHandling: undocumented", "Unity.Netcode.StaleDataHandling: Ignore: undocumented", "Unity.Netcode.StaleDataHandling: Reanticipate: undocumented", From 86f224c5afb6dd2e306fb66e558a415f59550b84 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 13:35:28 +0200 Subject: [PATCH 10/25] NetworkTransport corrections --- .../Runtime/Transports/NetworkTransport.cs | 4 ++++ pvpExceptions.json | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs b/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs index 7127279cda..eaa12089fe 100644 --- a/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs +++ b/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs @@ -28,6 +28,10 @@ public abstract class NetworkTransport : MonoBehaviour /// /// Delegate for transport network events /// + /// The type of network event that occurred + /// The ID of the client associated with this event + /// The data payload received with this event + /// The time when this event was received public delegate void TransportEventDelegate(NetworkEvent eventType, ulong clientId, ArraySegment payload, float receiveTime); /// diff --git a/pvpExceptions.json b/pvpExceptions.json index ecf4211a49..26975b166c 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -47,10 +47,6 @@ "Unity.Netcode.NetworkVariableBase: NetworkBehaviour GetBehaviour(): undocumented", "Unity.Netcode.NetworkVariableBase: void MarkNetworkBehaviourDirty(): undocumented", "Unity.Netcode.NetworkSceneManager: void SetClientSynchronizationMode(LoadSceneMode): XML is not well-formed: Expected an end tag for element 'summary'", - "Unity.Netcode.NetworkTransport.TransportEventDelegate: missing ", - "Unity.Netcode.NetworkTransport.TransportEventDelegate: missing ", - "Unity.Netcode.NetworkTransport.TransportEventDelegate: missing ", - "Unity.Netcode.NetworkTransport.TransportEventDelegate: missing ", "Unity.Netcode.Transports.UTP.UnityTransport.ConnectionAddressData: IsIpv6: undocumented", "Unity.Netcode.TestHelpers.Runtime.ObjectNameIdentifier: undocumented", From ec8041d887ed534c74f553177109628e8cc33b60 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 13:48:27 +0200 Subject: [PATCH 11/25] Bunch of API additions --- .../Runtime/Messaging/CustomMessageManager.cs | 2 + .../Runtime/Messaging/RpcAttributes.cs | 43 +++++++++++++++++++ .../NetworkVariable/NetworkVariableBase.cs | 20 ++++++++- .../Runtime/Transports/UTP/UnityTransport.cs | 6 +++ pvpExceptions.json | 33 ++++---------- 5 files changed, 77 insertions(+), 27 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/CustomMessageManager.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/CustomMessageManager.cs index 98c344fa19..d7b58ad977 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/CustomMessageManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/CustomMessageManager.cs @@ -139,6 +139,8 @@ public void SendUnnamedMessage(ulong clientId, FastBufferWriter messageBuffer, N /// /// Delegate used to handle named messages /// + /// The client identifier of the message sender + /// The buffer containing the message data to be read public delegate void HandleNamedMessageDelegate(ulong senderClientId, FastBufferReader messagePayload); private Dictionary m_NamedMessageHandlers32 = new Dictionary(); diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs index acb6289b5b..39432097d4 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs @@ -25,11 +25,29 @@ public enum RpcDelivery public class RpcAttribute : Attribute { // Must match the set of parameters below + /// + /// Parameters that define the behavior of an RPC + /// public struct RpcAttributeParams { + /// + /// The delivery method for the RPC + /// public RpcDelivery Delivery; + + /// + /// When true, only the owner of the object can execute this RPC + /// public bool RequireOwnership; + + /// + /// When true, local execution of the RPC is deferred until the next network tick + /// public bool DeferLocal; + + /// + /// When true, allows the RPC target to be overridden at runtime + /// public bool AllowTargetOverride; } @@ -38,10 +56,26 @@ public struct RpcAttributeParams /// Type of RPC delivery method /// public RpcDelivery Delivery = RpcDelivery.Reliable; + + /// + /// When true, only the owner of the object can execute this RPC + /// public bool RequireOwnership; + + /// + /// When true, local execution of the RPC is deferred until the next network tick + /// public bool DeferLocal; + + /// + /// When true, allows the RPC target to be overridden at runtime + /// public bool AllowTargetOverride; + /// + /// Initializes a new instance of the RpcAttribute with the specified target + /// + /// The target for this RPC public RpcAttribute(SendTo target) { } @@ -60,8 +94,14 @@ private RpcAttribute() [AttributeUsage(AttributeTargets.Method)] public class ServerRpcAttribute : RpcAttribute { + /// + /// When true, only the owner of the NetworkObject can invoke this ServerRpc + /// public new bool RequireOwnership; + /// + /// Initializes a new instance of ServerRpcAttribute configured to target the server + /// public ServerRpcAttribute() : base(SendTo.Server) { @@ -75,6 +115,9 @@ public ServerRpcAttribute() : base(SendTo.Server) [AttributeUsage(AttributeTargets.Method)] public class ClientRpcAttribute : RpcAttribute { + /// + /// Initializes a new instance of ClientRpcAttribute configured to target all non-server clients + /// public ClientRpcAttribute() : base(SendTo.NotServer) { diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs index c6db156f81..a1d5623119 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs @@ -3,11 +3,20 @@ namespace Unity.Netcode { + /// + /// Defines timing constraints for network variable updates + /// public struct NetworkVariableUpdateTraits { + /// + /// The minimum amount of time that must pass between sending updates. If this amount of time has not passed since the last update, dirtiness will be ignored. + /// [Tooltip("The minimum amount of time that must pass between sending updates. If this amount of time has not passed since the last update, dirtiness will be ignored.")] public float MinSecondsBetweenUpdates; + /// + /// The maximum amount of time that a variable can be dirty without sending an update. If this amount of time has passed since the last update, an update will be sent even if the dirtiness threshold has not been met. + /// [Tooltip("The maximum amount of time that a variable can be dirty without sending an update. If this amount of time has passed since the last update, an update will be sent even if the dirtiness threshold has not been met.")] public float MaxSecondsBetweenUpdates; } @@ -40,6 +49,10 @@ public abstract class NetworkVariableBase : IDisposable // this NetworkVariableBase property instance will not update until the last session time used. internal bool HasBeenInitialized { get; private set; } + /// + /// Gets the NetworkBehaviour instance associated with this network variable + /// + /// The NetworkBehaviour that owns this network variable public NetworkBehaviour GetBehaviour() { return m_NetworkBehaviour; @@ -97,7 +110,7 @@ public void Initialize(NetworkBehaviour networkBehaviour) if (!m_NetworkBehaviour.NetworkObject.NetworkManagerOwner) { // Exit early if there has yet to be a NetworkManagerOwner assigned - // to the NetworkObject. This is ok because Initialize is invoked + // to the NetworkObject. This is ok because Initialize is invoked // multiple times until it is considered "initialized". return; } @@ -240,6 +253,9 @@ internal void UpdateLastSentTime() LastUpdateSent = m_NetworkBehaviour.NetworkManager.NetworkTimeSystem.LocalTime; } + /// + /// Marks the associated NetworkBehaviour as dirty, indicating it needs synchronization + /// protected void MarkNetworkBehaviourDirty() { if (m_NetworkBehaviour == null) @@ -374,7 +390,7 @@ internal ulong OwnerClientId() /// This should be always invoked (client & server) to assure the previous values are set /// !! IMPORTANT !! /// When a server forwards delta updates to connected clients, it needs to preserve the previous dirty value(s) - /// until it is done serializing all valid NetworkVariable field deltas (relative to each client). This is invoked + /// until it is done serializing all valid NetworkVariable field deltas (relative to each client). This is invoked /// after it is done forwarding the deltas at the end of the method. /// internal virtual void PostDeltaRead() diff --git a/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs b/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs index 8a8afcdbac..3ba82432f4 100644 --- a/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs +++ b/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs @@ -358,6 +358,12 @@ public NetworkEndpoint ListenEndPoint } } + /// + /// Gets whether the configured server address is an IPv6 address + /// + /// + /// True if the Address property contains a valid IPv6 address, false if it's empty or an IPv4 address + /// public bool IsIpv6 => !string.IsNullOrEmpty(Address) && ParseNetworkEndpoint(Address, Port, true).Family == NetworkFamily.Ipv6; } diff --git a/pvpExceptions.json b/pvpExceptions.json index 26975b166c..a7a2ec1d0e 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -12,42 +12,25 @@ }, "PVP-151-1": { "errors": [ - "Unity.Netcode.NetworkConfig: Prefabs: undocumented", + "Unity.Netcode.NetworkConfig: Prefabs: undocumented", + "Unity.Netcode.ConnectionEventData: EventType: undocumented", + "Unity.Netcode.RpcException: undocumented", "Unity.Netcode.RpcException: .ctor(string): undocumented", + "Unity.Netcode.NetworkManager: void NetworkUpdate(NetworkUpdateStage): undocumented", "Unity.Netcode.NetworkManager.ReanticipateDelegate: undocumented", + "Unity.Netcode.NetworkObject: NetworkBehaviour GetNetworkBehaviourAtOrderIndex(ushort): undocumented", "Unity.Netcode.NetworkObject.VisibilityDelegate: missing ", "Unity.Netcode.NetworkObject.SpawnDelegate: missing ", - "Unity.Netcode.CustomMessagingManager.HandleNamedMessageDelegate: missing ", - "Unity.Netcode.CustomMessagingManager.HandleNamedMessageDelegate: missing ", + "Unity.Netcode.GenerateSerializationForGenericParameterAttribute: .ctor(int): undocumented", + "Unity.Netcode.GenerateSerializationForTypeAttribute: .ctor(Type): undocumented", - "Unity.Netcode.RpcAttribute: RequireOwnership: undocumented", - "Unity.Netcode.RpcAttribute: DeferLocal: undocumented", - "Unity.Netcode.RpcAttribute: AllowTargetOverride: undocumented", - "Unity.Netcode.RpcAttribute: .ctor(SendTo): undocumented", - "Unity.Netcode.RpcAttribute.RpcAttributeParams: undocumented", - "Unity.Netcode.RpcAttribute.RpcAttributeParams: Delivery: undocumented", - "Unity.Netcode.RpcAttribute.RpcAttributeParams: RequireOwnership: undocumented", - "Unity.Netcode.RpcAttribute.RpcAttributeParams: DeferLocal: undocumented", - "Unity.Netcode.RpcAttribute.RpcAttributeParams: AllowTargetOverride: undocumented", - "Unity.Netcode.ServerRpcAttribute: RequireOwnership: undocumented", - "Unity.Netcode.ServerRpcAttribute: .ctor(): undocumented", - "Unity.Netcode.ClientRpcAttribute: .ctor(): undocumented", - "Unity.Netcode.StaleDataHandling: undocumented", - "Unity.Netcode.StaleDataHandling: Ignore: undocumented", - "Unity.Netcode.StaleDataHandling: Reanticipate: undocumented", + "Unity.Netcode.NetworkList: void Finalize(): undocumented", - "Unity.Netcode.NetworkVariableUpdateTraits: undocumented", - "Unity.Netcode.NetworkVariableUpdateTraits: MinSecondsBetweenUpdates: undocumented", - "Unity.Netcode.NetworkVariableUpdateTraits: MaxSecondsBetweenUpdates: undocumented", - "Unity.Netcode.NetworkVariableBase: NetworkBehaviour GetBehaviour(): undocumented", - "Unity.Netcode.NetworkVariableBase: void MarkNetworkBehaviourDirty(): undocumented", - "Unity.Netcode.NetworkSceneManager: void SetClientSynchronizationMode(LoadSceneMode): XML is not well-formed: Expected an end tag for element 'summary'", - "Unity.Netcode.Transports.UTP.UnityTransport.ConnectionAddressData: IsIpv6: undocumented", "Unity.Netcode.TestHelpers.Runtime.ObjectNameIdentifier: undocumented", "Unity.Netcode.TestHelpers.Runtime.ObjectNameIdentifier: void OnNetworkSpawn(): undocumented", From 6e84ac0e4189b4ff85db9628b4cb3ba4ecd5e8d7 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 14:00:37 +0200 Subject: [PATCH 12/25] corrected all 151-1 PVP APIs marked --- .../Connection/NetworkConnectionManager.cs | 5 ++++- .../Runtime/Core/NetworkBehaviour.cs | 7 +++++++ .../Runtime/Core/NetworkManager.cs | 8 ++++++++ .../Runtime/Core/NetworkObject.cs | 7 +++++++ ...rializationForGenericParameterAttribute.cs | 4 ++++ .../GenerateSerializationForTypeAttribute.cs | 4 ++++ .../Collections/NetworkList.cs | 3 +++ pvpExceptions.json | 20 ------------------- 8 files changed, 37 insertions(+), 21 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs b/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs index fb56d762e5..97486a8ba7 100644 --- a/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs @@ -11,7 +11,7 @@ namespace Unity.Netcode { /// - /// The connection event type set within to signify the type of connection event notification received. + /// The connection event type set within to signify the type of connection event notification received. /// /// /// is returned as a parameter of the event notification. @@ -60,6 +60,9 @@ public enum ConnectionEvent /// public struct ConnectionEventData { + /// + /// The type of connection event that occurred + /// public ConnectionEvent EventType; /// diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs index ba8e981795..98efb94b25 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs @@ -6,8 +6,15 @@ namespace Unity.Netcode { + /// + /// Exception thrown when an RPC (Remote Procedure Call) encounters an error during execution + /// public class RpcException : Exception { + /// + /// Initializes a new instance of the RpcException class with a specified error message + /// + /// The message that describes the error public RpcException(string message) : base(message) { diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs index 0aec58612f..5092390599 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs @@ -44,6 +44,10 @@ public class NetworkManager : MonoBehaviour, INetworkUpdateSystem #pragma warning restore IDE1006 // restore naming rule violation check + /// + /// Processes network-related updates for a specific update stage in the frame + /// + /// The current network update stage being processed public void NetworkUpdate(NetworkUpdateStage updateStage) { switch (updateStage) @@ -294,6 +298,10 @@ public event Action OnTransportFailure remove => ConnectionManager.OnTransportFailure -= value; } + /// + /// Delegate for handling network state reanticipation events + /// + /// The most recent round-trip time measurement in seconds between client and server public delegate void ReanticipateDelegate(double lastRoundTripTime); /// diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index 3c5551cd4b..0122b696bc 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -385,6 +385,7 @@ private GlobalObjectId GetGlobalId() /// Delegate type for checking visibility /// /// The clientId to check visibility for + /// True if the object should be visible to the specified client, false otherwise public delegate bool VisibilityDelegate(ulong clientId); /// @@ -396,6 +397,7 @@ private GlobalObjectId GetGlobalId() /// Delegate type for checking spawn options /// /// The clientId to check spawn options for + /// True if the object should be spawned for the specified client, false otherwise public delegate bool SpawnDelegate(ulong clientId); /// @@ -1556,6 +1558,11 @@ internal ushort GetNetworkBehaviourOrderIndex(NetworkBehaviour instance) return 0; } + /// + /// Gets a NetworkBehaviour component at the specified index in this object's NetworkBehaviour list + /// + /// The zero-based index of the NetworkBehaviour to retrieve + /// The NetworkBehaviour at the specified index, or null if the index is out of bounds public NetworkBehaviour GetNetworkBehaviourAtOrderIndex(ushort index) { if (index >= ChildNetworkBehaviours.Count) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs index a102f3666e..c8d4cedf45 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs @@ -74,6 +74,10 @@ public class GenerateSerializationForGenericParameterAttribute : Attribute { internal int ParameterIndex; + /// + /// Initializes a new instance of the attribute + /// + /// The zero-based index of the generic parameter that should be serialized public GenerateSerializationForGenericParameterAttribute(int parameterIndex) { ParameterIndex = parameterIndex; diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForTypeAttribute.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForTypeAttribute.cs index 81e55c00df..5bfff33864 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForTypeAttribute.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForTypeAttribute.cs @@ -18,6 +18,10 @@ public class GenerateSerializationForTypeAttribute : Attribute { internal Type Type; + /// + /// Initializes a new instance of the attribute + /// + /// The type that should have serialization code generated for it public GenerateSerializationForTypeAttribute(Type type) { Type = type; diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs index eaf06bbb67..2d00a4cf97 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs @@ -49,6 +49,9 @@ public NetworkList(IEnumerable values = default, } } + /// + /// Finalizer that ensures proper cleanup of network list resources + /// ~NetworkList() { Dispose(); diff --git a/pvpExceptions.json b/pvpExceptions.json index a7a2ec1d0e..bfca45c47a 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -12,26 +12,6 @@ }, "PVP-151-1": { "errors": [ - "Unity.Netcode.NetworkConfig: Prefabs: undocumented", - - "Unity.Netcode.ConnectionEventData: EventType: undocumented", - - "Unity.Netcode.RpcException: undocumented", - "Unity.Netcode.RpcException: .ctor(string): undocumented", - - "Unity.Netcode.NetworkManager: void NetworkUpdate(NetworkUpdateStage): undocumented", - "Unity.Netcode.NetworkManager.ReanticipateDelegate: undocumented", - - "Unity.Netcode.NetworkObject: NetworkBehaviour GetNetworkBehaviourAtOrderIndex(ushort): undocumented", - "Unity.Netcode.NetworkObject.VisibilityDelegate: missing ", - "Unity.Netcode.NetworkObject.SpawnDelegate: missing ", - - "Unity.Netcode.GenerateSerializationForGenericParameterAttribute: .ctor(int): undocumented", - - "Unity.Netcode.GenerateSerializationForTypeAttribute: .ctor(Type): undocumented", - - "Unity.Netcode.NetworkList: void Finalize(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.ObjectNameIdentifier: undocumented", "Unity.Netcode.TestHelpers.Runtime.ObjectNameIdentifier: void OnNetworkSpawn(): undocumented", "Unity.Netcode.TestHelpers.Runtime.ObjectNameIdentifier: void RegisterAndLabelNetworkObject(): undocumented", From 2f2cadaa392e069ff2f08c033085d7067ef9f7f0 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 14:37:40 +0200 Subject: [PATCH 13/25] Few new corrections --- .../Runtime/Configuration/NetworkPrefab.cs | 4 ++-- .../TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs | 3 +-- .../Tests/Runtime/Components/BufferDataValidationComponent.cs | 1 + .../Runtime/NetworkVariableBaseInitializesWhenPersisted.cs | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs index c101104269..c6f30d2835 100644 --- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs +++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs @@ -74,7 +74,7 @@ public bool Equals(NetworkPrefab other) /// /// Gets the GlobalObjectIdHash of the source prefab based on the current override settings /// - /// The hash value identifying the source prefab + /// The hash value identifying the source prefab /// Thrown when required prefab references are missing or invalid /// Thrown when Override has an invalid value public uint SourcePrefabGlobalObjectIdHash @@ -112,7 +112,7 @@ public uint SourcePrefabGlobalObjectIdHash /// /// Gets the GlobalObjectIdHash of the target prefab when using prefab overrides /// - /// The hash value identifying the target prefab, or 0 if no override is set + /// The hash value identifying the target prefab, or 0 if no override is set /// Thrown when required prefab references are missing or invalid /// Thrown when Override has an invalid value public uint TargetPrefabGlobalObjectIdHash diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs index d09736a387..8e55718b90 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs @@ -615,10 +615,9 @@ public static IEnumerator WaitForClientConnected(NetworkManager client, ResultWr /// /// Similar to WaitForClientConnected, this waits for multiple clients to be connected. /// - /// The clients to be connected + /// Array of clients to wait for /// The result. If null, it will automatically assert< /// Maximum time in seconds to wait for the object to be found. - /// public static IEnumerator WaitForClientsConnected(NetworkManager[] clients, ResultWrapper result = null, float timeout = DefaultTimeout) { // Make sure none are the host client diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs index 0e2b7fd869..8647f586d2 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs @@ -54,6 +54,7 @@ private void Start() /// /// Returns back whether the test has completed the total number of iterations /// + /// True if the test has exceeded maximum buffer size or failed, false otherwise public bool IsTestComplete() { if (m_CurrentBufferSize > MaximumBufferSize || TestFailed) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs index 2ce7186db6..6996cb70f4 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs @@ -335,6 +335,8 @@ public void Initialize(NetworkManager networkManager) /// This validates that the instances persisted to the next test set and persisted /// between network sessions /// + /// The minimum number of times each instance should have been spawned + /// True if all instances meet the minimum spawn count requirement, false otherwise public bool ValidateInstanceSpawnCount(int minCount) { // First pass we should have no instances From fae73a58f0d92ef8a4c57766872a521234df142b Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 14:46:18 +0200 Subject: [PATCH 14/25] more corrections --- .../Runtime/NetworkVariable/AnticipatedNetworkVariable.cs | 8 ++++++++ .../Runtime/NetworkVariable/NetworkVariable.cs | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs index fce8c058f0..9100259a23 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs @@ -259,6 +259,11 @@ public T AuthoritativeValue private SmoothDelegate m_SmoothDelegate = null; + /// + /// Initializes a new instance of the AnticipatedNetworkVariable class + /// + /// The initial value for the network variable. Defaults to the type's default value if not specified. + /// Determines how the variable handles authoritative updates that are older than the current anticipated state. Defaults to StaleDataHandling.Ignore. public AnticipatedNetworkVariable(T value = default, StaleDataHandling staleDataHandling = StaleDataHandling.Ignore) : base() @@ -334,6 +339,9 @@ public override void Dispose() } } + /// + /// Finalizer that ensures proper cleanup of network variable resources + /// ~AnticipatedNetworkVariable() { Dispose(); diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs index b70084588e..bd629f0155 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs @@ -106,7 +106,7 @@ public void Reset(T value = default) // The introduction of standard .NET collections caused an issue with permissions since there is no way to detect changes in the // collection without doing a full comparison. While this approach does consume more memory per collection instance, it is the // lowest risk approach to resolving the issue where a client with no write permissions could make changes to a collection locally - // which can cause a myriad of issues. + // which can cause a myriad of issues. private protected T m_InternalOriginalValue; private protected T m_PreviousValue; @@ -151,11 +151,12 @@ public virtual T Value /// Invoke this method to check if a collection's items are dirty. /// The default behavior is to exit early if the is already dirty. /// + /// when true, this check will force a full item collection check even if the NetworkVariable is already dirty + /// True if the variable is dirty and needs synchronization, false if clean or client lacks write permissions /// /// This is to be used as a way to check if a containing a managed collection has any changees to the collection items.
/// If you invoked this when a collection is dirty, it will not trigger the unless you set forceCheck param to true.
///
- /// when true, this check will force a full item collection check even if the NetworkVariable is already dirty public bool CheckDirtyState(bool forceCheck = false) { var isDirty = base.IsDirty(); @@ -333,7 +334,7 @@ public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta) /// This should be always invoked (client & server) to assure the previous values are set /// !! IMPORTANT !! /// When a server forwards delta updates to connected clients, it needs to preserve the previous dirty value(s) - /// until it is done serializing all valid NetworkVariable field deltas (relative to each client). This is invoked + /// until it is done serializing all valid NetworkVariable field deltas (relative to each client). This is invoked /// after it is done forwarding the deltas at the end of the method. /// internal override void PostDeltaRead() From 412edb7b2f96672f7f16b67535bca81e7ae1abfb Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 14:52:30 +0200 Subject: [PATCH 15/25] corrections --- .../Runtime/Configuration/NetworkConfig.cs | 3 +++ .../TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs index 7c3cb964af..85f9acd311 100644 --- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs +++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs @@ -31,6 +31,9 @@ public class NetworkConfig [Tooltip("When set, NetworkManager will automatically create and spawn the assigned player prefab. This can be overridden by adding it to the NetworkPrefabs list and selecting override.")] public GameObject PlayerPrefab; + /// + /// The collection of network prefabs available for spawning across the network + /// [SerializeField] public NetworkPrefabs Prefabs = new NetworkPrefabs(); diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs index 8e55718b90..15081cae6f 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs @@ -425,6 +425,7 @@ private static void SceneManagerValidationAndTestRunnerInitialization(NetworkMan /// The Server NetworkManager /// The Clients NetworkManager /// called immediately after server is started and before client(s) are started + /// True if the network instances were started successfully, throws InvalidOperationException if already started public static bool Start(bool host, NetworkManager server, NetworkManager[] clients, BeforeClientStartCallback callback = null) { if (s_IsStarted) @@ -616,7 +617,7 @@ public static IEnumerator WaitForClientConnected(NetworkManager client, ResultWr /// Similar to WaitForClientConnected, this waits for multiple clients to be connected. /// /// Array of clients to wait for - /// The result. If null, it will automatically assert< + /// The result. If null, it will automatically assert /// Maximum time in seconds to wait for the object to be found. public static IEnumerator WaitForClientsConnected(NetworkManager[] clients, ResultWrapper result = null, float timeout = DefaultTimeout) { From 281f06da191d33ddd29e2b86e4b19e4c3eeda052 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 14:56:15 +0200 Subject: [PATCH 16/25] correction --- .../TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs index 15081cae6f..89319a0d3d 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs @@ -619,6 +619,7 @@ public static IEnumerator WaitForClientConnected(NetworkManager client, ResultWr /// Array of clients to wait for /// The result. If null, it will automatically assert /// Maximum time in seconds to wait for the object to be found. + /// An IEnumerator that yields until all clients are connected or timeout is reached public static IEnumerator WaitForClientsConnected(NetworkManager[] clients, ResultWrapper result = null, float timeout = DefaultTimeout) { // Make sure none are the host client From bf31b1724d0265296ca6d8749971d15a99b05899 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 23 Jun 2025 09:49:14 -0500 Subject: [PATCH 17/25] Update NetworkList.cs Adjusting constructor and destructor XML API. --- .../Runtime/NetworkVariable/Collections/NetworkList.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs index 2d00a4cf97..0d88a2abad 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs @@ -26,7 +26,7 @@ public class NetworkList : NetworkVariableBase where T : unmanaged, IEquatabl public event OnListChangedDelegate OnListChanged; /// - /// Creates a + /// Constructor for /// public NetworkList() { } @@ -50,7 +50,7 @@ public NetworkList(IEnumerable values = default, } /// - /// Finalizer that ensures proper cleanup of network list resources + /// The destructor for . /// ~NetworkList() { From d52e5a79e845beca427781bb07a390c40f542660 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 23 Jun 2025 09:52:36 -0500 Subject: [PATCH 18/25] Update NetworkVariableBase.cs Minor adjustment to XML API --- .../Runtime/NetworkVariable/NetworkVariableBase.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs index c68a887e86..8b86d356ad 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs @@ -50,9 +50,9 @@ public abstract class NetworkVariableBase : IDisposable internal bool HasBeenInitialized { get; private set; } /// - /// Gets the NetworkBehaviour instance associated with this network variable + /// Gets the instance associated with this network variable /// - /// The NetworkBehaviour that owns this network variable + /// The that owns this network variable public NetworkBehaviour GetBehaviour() { return m_NetworkBehaviour; @@ -254,7 +254,7 @@ internal void UpdateLastSentTime() } /// - /// Marks the associated NetworkBehaviour as dirty, indicating it needs synchronization + /// Marks the associated as dirty, indicating it needs synchronization /// protected void MarkNetworkBehaviourDirty() { From dfd57a332e367e58ba5209447efdf02e62e1d966 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 23 Jun 2025 09:53:54 -0500 Subject: [PATCH 19/25] Update NetworkTransport.cs Adding period at end of each param XML API description. --- .../Runtime/Transports/NetworkTransport.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs b/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs index eaa12089fe..9fac4ac58a 100644 --- a/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs +++ b/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs @@ -28,10 +28,10 @@ public abstract class NetworkTransport : MonoBehaviour /// /// Delegate for transport network events /// - /// The type of network event that occurred - /// The ID of the client associated with this event - /// The data payload received with this event - /// The time when this event was received + /// The type of network event that occurred. + /// The ID of the client associated with this event. + /// The data payload received with this event. + /// The time when this event was received. public delegate void TransportEventDelegate(NetworkEvent eventType, ulong clientId, ArraySegment payload, float receiveTime); /// From 994aa55647744db3fa2f853415bf71f2436a0429 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 23 Jun 2025 09:55:08 -0500 Subject: [PATCH 20/25] Update UnityTransport.cs adding period in XML API update. --- .../Runtime/Transports/UTP/UnityTransport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs b/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs index 957988563c..bdd21e1f2e 100644 --- a/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs +++ b/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs @@ -385,7 +385,7 @@ public NetworkEndpoint ListenEndPoint /// Returns true if the end point address is of type . /// /// - /// True if the Address property contains a valid IPv6 address, false if it's empty or an IPv4 address + /// True if the Address property contains a valid IPv6 address, false if it's empty or an IPv4 address. /// public bool IsIpv6 => !string.IsNullOrEmpty(Address) && NetworkEndpoint.TryParse(Address, Port, out NetworkEndpoint _, NetworkFamily.Ipv6); } From 8d95b4e51c0bd4b4c508494788e9996b541ca7fc Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 23 Jun 2025 09:57:49 -0500 Subject: [PATCH 21/25] Update NetcodeIntegrationTestHelpers.cs adding period to end of sentences for XML API. --- .../Runtime/NetcodeIntegrationTestHelpers.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs index 89319a0d3d..5e63e2384f 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs @@ -421,11 +421,11 @@ private static void SceneManagerValidationAndTestRunnerInitialization(NetworkMan /// /// Starts NetworkManager instances created by the Create method. /// - /// Whether or not to create a Host instead of Server - /// The Server NetworkManager - /// The Clients NetworkManager - /// called immediately after server is started and before client(s) are started - /// True if the network instances were started successfully, throws InvalidOperationException if already started + /// Whether or not to create a Host instead of Server. + /// The Server NetworkManager. + /// The Clients NetworkManager. + /// called immediately after server is started and before client(s) are started. + /// True if the network instances were started successfully, throws InvalidOperationException if already started. public static bool Start(bool host, NetworkManager server, NetworkManager[] clients, BeforeClientStartCallback callback = null) { if (s_IsStarted) @@ -616,10 +616,10 @@ public static IEnumerator WaitForClientConnected(NetworkManager client, ResultWr /// /// Similar to WaitForClientConnected, this waits for multiple clients to be connected. /// - /// Array of clients to wait for - /// The result. If null, it will automatically assert + /// Array of clients to wait for. + /// The result. If null, it will automatically assert. /// Maximum time in seconds to wait for the object to be found. - /// An IEnumerator that yields until all clients are connected or timeout is reached + /// An IEnumerator that yields until all clients are connected or timeout is reached. public static IEnumerator WaitForClientsConnected(NetworkManager[] clients, ResultWrapper result = null, float timeout = DefaultTimeout) { // Make sure none are the host client From 5d6004fdf7ce92b6090070e78645de9960dc2f68 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 23 Jun 2025 09:59:59 -0500 Subject: [PATCH 22/25] Update BufferDataValidationComponent.cs minor adjustments to XML API update. --- .../Tests/Runtime/Components/BufferDataValidationComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs index 8647f586d2..f953f01ccf 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Components/BufferDataValidationComponent.cs @@ -54,7 +54,7 @@ private void Start() /// /// Returns back whether the test has completed the total number of iterations /// - /// True if the test has exceeded maximum buffer size or failed, false otherwise + /// True if the test has exceeded maximum buffer size or has already failed. False if the test is yet to complete and has not failed. public bool IsTestComplete() { if (m_CurrentBufferSize > MaximumBufferSize || TestFailed) From f6f94d17aa20b83007daf95e681f0c84b8e3b521 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 23 Jun 2025 10:01:41 -0500 Subject: [PATCH 23/25] Update NetworkVariableBaseInitializesWhenPersisted.cs minor XML API update. --- .../Runtime/NetworkVariableBaseInitializesWhenPersisted.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs index 6996cb70f4..20e60ee5f0 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs @@ -333,10 +333,10 @@ public void Initialize(NetworkManager networkManager) /// /// This validates that the instances persisted to the next test set and persisted - /// between network sessions + /// between network sessions. /// - /// The minimum number of times each instance should have been spawned - /// True if all instances meet the minimum spawn count requirement, false otherwise + /// The minimum number of times each instance should have been spawned. + /// True if all instances meet the minimum spawn count requirement or false if they do not. public bool ValidateInstanceSpawnCount(int minCount) { // First pass we should have no instances From 8b4e1cdf92b0234d91fa73fc6ef2843bbcefede4 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Mon, 23 Jun 2025 10:33:26 -0500 Subject: [PATCH 24/25] style Some additional minor updates to XML API. --- .../Runtime/Configuration/NetworkConfig.cs | 2 +- .../Runtime/Configuration/NetworkPrefab.cs | 32 ++--- .../Runtime/Configuration/NetworkPrefabs.cs | 46 +++---- .../Connection/NetworkConnectionManager.cs | 72 +++++----- .../Runtime/Core/NetworkBehaviour.cs | 8 +- .../Runtime/Core/NetworkManager.cs | 9 +- .../Runtime/Core/NetworkObject.cs | 24 ++-- .../Runtime/Messaging/CustomMessageManager.cs | 36 ++--- ...rializationForGenericParameterAttribute.cs | 4 +- .../GenerateSerializationForTypeAttribute.cs | 4 +- .../Runtime/Messaging/RpcAttributes.cs | 32 ++--- .../Runtime/Messaging/RpcParams.cs | 125 ++++++++++-------- .../AnticipatedNetworkVariable.cs | 44 +++--- .../Collections/NetworkList.cs | 12 +- 14 files changed, 226 insertions(+), 224 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs index 85f9acd311..250f092d74 100644 --- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs +++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs @@ -32,7 +32,7 @@ public class NetworkConfig public GameObject PlayerPrefab; /// - /// The collection of network prefabs available for spawning across the network + /// The collection of network prefabs available for spawning across the network. /// [SerializeField] public NetworkPrefabs Prefabs = new NetworkPrefabs(); diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs index c6f30d2835..5b02d51dea 100644 --- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs +++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs @@ -58,10 +58,10 @@ public class NetworkPrefab public GameObject OverridingTargetPrefab; /// - /// Compares this NetworkPrefab with another to determine equality + /// Compares this NetworkPrefab with another to determine equality. /// - /// The NetworkPrefab to compare against - /// True if all fields match between the two NetworkPrefabs, false otherwise + /// The NetworkPrefab to compare against. + /// True if all fields match between the two NetworkPrefabs, false otherwise. public bool Equals(NetworkPrefab other) { return Override == other.Override && @@ -72,11 +72,11 @@ public bool Equals(NetworkPrefab other) } /// - /// Gets the GlobalObjectIdHash of the source prefab based on the current override settings + /// Gets the GlobalObjectIdHash of the source prefab based on the current override settings. /// - /// The hash value identifying the source prefab - /// Thrown when required prefab references are missing or invalid - /// Thrown when Override has an invalid value + /// The hash value identifying the source prefab. + /// Thrown when required prefab references are missing or invalid. + /// Thrown when Override has an invalid value. public uint SourcePrefabGlobalObjectIdHash { get @@ -110,11 +110,11 @@ public uint SourcePrefabGlobalObjectIdHash } /// - /// Gets the GlobalObjectIdHash of the target prefab when using prefab overrides + /// Gets the GlobalObjectIdHash of the target prefab when using prefab overrides. /// - /// The hash value identifying the target prefab, or 0 if no override is set - /// Thrown when required prefab references are missing or invalid - /// Thrown when Override has an invalid value + /// The hash value identifying the target prefab, or 0 if no override is set. + /// Thrown when required prefab references are missing or invalid. + /// Thrown when Override has an invalid value. public uint TargetPrefabGlobalObjectIdHash { get @@ -140,10 +140,10 @@ public uint TargetPrefabGlobalObjectIdHash } /// - /// Validates the NetworkPrefab configuration to ensure all required fields are properly set + /// Validates the NetworkPrefab configuration to ensure all required fields are properly set. /// - /// Optional index used for error reporting when validating lists of prefabs - /// True if the NetworkPrefab is valid and ready for use, false otherwise + /// Optional index used for error reporting when validating lists of prefabs. + /// True if the NetworkPrefab is valid and ready for use, false otherwise. public bool Validate(int index = -1) { NetworkObject networkObject; @@ -247,9 +247,9 @@ public bool Validate(int index = -1) } /// - /// Returns a string representation of this NetworkPrefab's source and target hash values + /// Returns a string representation of this NetworkPrefab's source and target hash values. /// - /// A string containing the source and target hash values + /// A string containing the source and target hash values. public override string ToString() { return $"{{SourceHash: {SourceHashToOverride}, TargetHash: {TargetPrefabGlobalObjectIdHash}}}"; diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs index 6e801f5b61..aea5cda9c7 100644 --- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs +++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs @@ -34,13 +34,13 @@ public class NetworkPrefabs /// This is used for the legacy way of spawning NetworkPrefabs with an override when manually instantiating and spawning. /// To handle multiple source NetworkPrefab overrides that all point to the same target NetworkPrefab use /// - /// or + /// or . /// [NonSerialized] public Dictionary OverrideToNetworkPrefab = new Dictionary(); /// - /// Gets the read-only list of all registered network prefabs + /// Gets the read-only list of all registered network prefabs. /// public IReadOnlyList Prefabs => m_Prefabs; @@ -66,7 +66,7 @@ private void RemoveTriggeredByNetworkPrefabList(NetworkPrefab networkPrefab) } /// - /// Finalizer that ensures proper cleanup of network prefab resources + /// Destructor that cleans up network prefab resources. /// ~NetworkPrefabs() { @@ -74,8 +74,7 @@ private void RemoveTriggeredByNetworkPrefabList(NetworkPrefab networkPrefab) } /// - /// Deregister from add and remove events - /// Clear the list + /// Deregister from add and remove events and clear the events. /// internal void Shutdown() { @@ -90,7 +89,7 @@ internal void Shutdown() /// Processes the if one is present for use during runtime execution, /// else processes . /// - /// When true, logs warnings about invalid prefabs that are removed during initialization + /// When true, logs warnings about invalid prefabs that are removed during initialization. public void Initialize(bool warnInvalid = true) { m_Prefabs.Clear(); @@ -161,13 +160,12 @@ public void Initialize(bool warnInvalid = true) } /// - /// Add a new NetworkPrefab instance to the list + /// Add a new NetworkPrefab instance to the list. /// - /// The NetworkPrefab to add + /// The to add. /// True if the prefab was successfully added, false if it was invalid or already registered /// - /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually. - /// + /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
/// Any modifications made here are not persisted. Permanent configuration changes should be done /// through the scriptable object property. ///
@@ -184,12 +182,11 @@ public bool Add(NetworkPrefab networkPrefab) } /// - /// Remove a NetworkPrefab instance from the list + /// Remove a NetworkPrefab instance from the list. /// - /// The NetworkPrefab to remove + /// The to remove. /// - /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually. - /// + /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
/// Any modifications made here are not persisted. Permanent configuration changes should be done /// through the scriptable object property. ///
@@ -207,12 +204,11 @@ public void Remove(NetworkPrefab prefab) } /// - /// Remove a NetworkPrefab instance with matching from the list + /// Remove a NetworkPrefab instance with matching from the list. /// - /// The GameObject to match against for removal + /// The to match against for removal. /// - /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually. - /// + /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
/// Any modifications made here are not persisted. Permanent configuration changes should be done /// through the scriptable object property. ///
@@ -243,10 +239,10 @@ public void Remove(GameObject prefab) } /// - /// Check if the given GameObject is present as a prefab within the list + /// Check if the given GameObject is present as a prefab within the list. /// - /// The prefab to check - /// Whether or not the prefab exists + /// The prefab to check. + /// True if the prefab exists or false if it does not. public bool Contains(GameObject prefab) { for (int i = 0; i < m_Prefabs.Count; i++) @@ -262,10 +258,10 @@ public bool Contains(GameObject prefab) } /// - /// Check if the given NetworkPrefab is present within the list + /// Check if the given NetworkPrefab is present within the list. /// - /// The prefab to check - /// Whether or not the prefab exists + /// The prefab to check. + /// True if the prefab exists or false if it does not. public bool Contains(NetworkPrefab prefab) { for (int i = 0; i < m_Prefabs.Count; i++) @@ -280,7 +276,7 @@ public bool Contains(NetworkPrefab prefab) } /// - /// Configures for the given + /// Configures for the given . /// private bool AddPrefabRegistration(NetworkPrefab networkPrefab) { diff --git a/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs b/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs index 97486a8ba7..13747b78f6 100644 --- a/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs @@ -61,16 +61,15 @@ public enum ConnectionEvent public struct ConnectionEventData { /// - /// The type of connection event that occurred + /// The type of connection event that occurred. /// public ConnectionEvent EventType; /// - /// The client ID for the client that just connected + /// The client ID for the client that just connected.
/// For the and - /// events on the client side, this will be LocalClientId. - /// On the server side, this will be the ID of the client that just connected. - /// + /// events on the client side, this will be LocalClientId.
+ /// On the server side, this will be the ID of the client that just connected.
/// For the and /// events on the client side, this will be the client ID assigned by the server to the remote peer. ///
@@ -86,10 +85,10 @@ public struct ConnectionEventData /// /// The NGO connection manager handles: - /// - Client Connections - /// - Client Approval - /// - Processing s. - /// - Client Disconnection + /// - Client Connections.
+ /// - Client Approval.
+ /// - Processing s.
+ /// - Client Disconnection.
///
public sealed class NetworkConnectionManager { @@ -102,7 +101,7 @@ public sealed class NetworkConnectionManager /// /// When disconnected from the server, the server may send a reason. If a reason was sent, this property will - /// tell client code what the reason was. It should be queried after the OnClientDisconnectCallback is called + /// tell client code what the reason was. It should be queried after the OnClientDisconnectCallback is called. /// public string DisconnectReason { get; internal set; } @@ -229,8 +228,8 @@ internal void InvokeOnPeerDisconnectedCallback(ulong clientId) public event Action OnTransportFailure; /// - /// Is true when a server or host is listening for connections. - /// Is true when a client is connecting or connected to a network session. + /// Is true when a server or host is listening for connections.
+ /// Is true when a client is connecting or connected to a network session.
/// Is false when not listening, connecting, or connected. ///
public bool IsListening { get; internal set; } @@ -250,7 +249,7 @@ internal void InvokeOnPeerDisconnectedCallback(ulong clientId) /// /// Use and to add or remove - /// Use to internally access the pending client dictionary + /// Use to internally access the pending client dictionary. /// private Dictionary m_PendingClients = new Dictionary(); @@ -260,7 +259,7 @@ internal void InvokeOnPeerDisconnectedCallback(ulong clientId) /// /// Client-Side: - /// Starts the client-side approval timeout coroutine + /// Starts the client-side approval timeout coroutine. /// /// internal void StartClientApprovalCoroutine(ulong clientId) @@ -284,7 +283,7 @@ internal void StopClientApprovalCoroutine() /// /// Server-Side: - /// Handles the issue with populating NetworkManager.PendingClients + /// Handles the issue with populating . /// internal void AddPendingClient(ulong clientId) { @@ -300,7 +299,7 @@ internal void AddPendingClient(ulong clientId) /// /// Server-Side: - /// Handles the issue with depopulating NetworkManager.PendingClients + /// Handles the issue with depopulating . /// internal void RemovePendingClient(ulong clientId) { @@ -313,7 +312,7 @@ internal void RemovePendingClient(ulong clientId) } /// - /// Used to generate client identifiers + /// Used to generate client identifiers. /// private ulong m_NextClientId = 1; @@ -360,7 +359,7 @@ internal ulong ClientIdToTransportId(ulong clientId) } /// - /// Gets the networkId of the server + /// Gets the networkId of the server. /// internal ulong ServerTransportId => GetServerTransportId(); @@ -382,7 +381,7 @@ private ulong GetServerTransportId() } /// - /// Handles cleaning up the transport id/client id tables after receiving a disconnect event from transport + /// Handles cleaning up the transport id/client id tables after receiving a disconnect event from transport. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] internal ulong TransportIdCleanUp(ulong transportId) @@ -419,10 +418,10 @@ internal void PollAndHandleNetworkEvents() } /// - /// Event driven NetworkTransports (like UnityTransport) NetworkEvent handling + /// Event driven NetworkTransports (like UnityTransport) NetworkEvent handling. /// /// - /// Polling NetworkTransports invoke this directly + /// Polling NetworkTransports invoke this directly. /// internal void HandleNetworkEvent(NetworkEvent networkEvent, ulong transportClientId, ArraySegment payload, float receiveTime) { @@ -601,7 +600,7 @@ internal void TransportFailureEventHandler(bool duringStart = false) /// /// Client-Side: - /// Upon transport connecting, the client will send a connection request + /// Upon transport connecting, the client will send a connection request. /// private void SendConnectionRequest() { @@ -632,7 +631,7 @@ private void SendConnectionRequest() } /// - /// Approval time out coroutine + /// Approval time out coroutine. /// private IEnumerator ApprovalTimeout(ulong clientId) { @@ -707,7 +706,7 @@ private IEnumerator ApprovalTimeout(ulong clientId) /// /// Server-Side: - /// Handles approval while processing a client connection request + /// Handles approval while processing a client connection request. /// internal void ApproveConnection(ref ConnectionRequestMessage connectionRequestMessage, ref NetworkContext context) { @@ -726,7 +725,7 @@ internal void ApproveConnection(ref ConnectionRequestMessage connectionRequestMe /// /// Server-Side: - /// Processes pending approvals and removes any stale pending clients + /// Processes pending approvals and removes any stale pending clients. /// internal void ProcessPendingApprovals() { @@ -763,10 +762,11 @@ internal void ProcessPendingApprovals() } /// - /// Server Side: Handles the approval of a client + /// Server Side: + /// Handles the approval of a client. /// /// - /// This will spawn the player prefab as well as start client synchronization if is enabled + /// This will spawn the player prefab as well as start client synchronization if is enabled. /// internal void HandleConnectionApproval(ulong ownerClientId, NetworkManager.ConnectionApprovalResponse response) { @@ -886,10 +886,10 @@ internal void HandleConnectionApproval(ulong ownerClientId, NetworkManager.Conne } /// - /// Spawns the newly approved player + /// Spawns the newly approved player. /// - /// new player client identifier - /// the prefab GlobalObjectIdHash value for this player + /// new player client identifier. + /// the prefab GlobalObjectIdHash value for this player. internal void ApprovedPlayerSpawn(ulong clientId, uint playerPrefabHash) { foreach (var clientPair in ConnectedClients) @@ -918,7 +918,7 @@ internal void ApprovedPlayerSpawn(ulong clientId, uint playerPrefabHash) /// /// Server-Side: - /// Creates a new and handles updating the associated + /// Creates a new and handles updating the associated. /// connected clients lists. /// internal NetworkClient AddClient(ulong clientId) @@ -944,7 +944,7 @@ internal NetworkClient AddClient(ulong clientId) /// /// Server-Side: - /// Invoked when a client is disconnected from a server-host + /// Invoked when a client is disconnected from a server-host. /// internal void OnClientDisconnectFromServer(ulong clientId) { @@ -1067,7 +1067,7 @@ internal void OnClientDisconnectFromServer(ulong clientId) /// /// Server-Side: - /// Invoked when disconnecting a remote client + /// Invoked when disconnecting a remote client. /// internal void DisconnectRemoteClient(ulong clientId) { @@ -1106,9 +1106,9 @@ internal void DisconnectClient(ulong clientId, string reason = null) } /// - /// Should be invoked when starting a server-host or client + /// Should be invoked when starting a server-host or client. /// - /// + /// The that is initializing this instance. internal void Initialize(NetworkManager networkManager) { // Prepare for a new session @@ -1133,7 +1133,7 @@ internal void Initialize(NetworkManager networkManager) } /// - /// Should be called when shutting down the NetworkManager + /// Should be called when shutting down the NetworkManager. /// internal void Shutdown() { diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs index 3db09bcc31..7ce31f5871 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs @@ -7,14 +7,14 @@ namespace Unity.Netcode { /// - /// Exception thrown when an RPC (Remote Procedure Call) encounters an error during execution + /// Exception thrown when an RPC (Remote Procedure Call) encounters an error during execution. /// public class RpcException : Exception { /// - /// Initializes a new instance of the RpcException class with a specified error message + /// Initializes a new instance of the RpcException class with a specified error message. /// - /// The message that describes the error + /// The message that describes the error. public RpcException(string message) : base(message) { @@ -22,7 +22,7 @@ public RpcException(string message) : base(message) } /// - /// The base class to override to write network code. Inherits MonoBehaviour + /// The base class to override to write network code. Inherits from . /// public abstract class NetworkBehaviour : MonoBehaviour { diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs index 9478a9de31..47840f91d8 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs @@ -44,10 +44,7 @@ public class NetworkManager : MonoBehaviour, INetworkUpdateSystem #pragma warning restore IDE1006 // restore naming rule violation check - /// - /// Processes network-related updates for a specific update stage in the frame - /// - /// The current network update stage being processed + /// public void NetworkUpdate(NetworkUpdateStage updateStage) { switch (updateStage) @@ -299,9 +296,9 @@ public event Action OnTransportFailure } /// - /// Delegate for handling network state reanticipation events + /// Delegate for handling network state reanticipation events. /// - /// The most recent round-trip time measurement in seconds between client and server + /// The most recent round-trip time measurement in seconds between client and server. public delegate void ReanticipateDelegate(double lastRoundTripTime); /// diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index 2c735cc6f2..3a5a1984c0 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -385,31 +385,31 @@ private GlobalObjectId GetGlobalId() public bool SpawnWithObservers = true; /// - /// Delegate type for checking visibility + /// Delegate type for checking visibility. /// - /// The clientId to check visibility for - /// True if the object should be visible to the specified client, false otherwise + /// The clientId being checked for visibility. + /// True if the object should be visible to the specified client and false if it should not. public delegate bool VisibilityDelegate(ulong clientId); /// - /// Delegate invoked when the netcode needs to know if the object should be visible to a client, if null it will assume true + /// Delegate invoked when the netcode needs to know if the object should be visible to a client, if null it will assume true. /// public VisibilityDelegate CheckObjectVisibility = null; /// - /// Delegate type for checking spawn options + /// Delegate type for checking spawn options. /// - /// The clientId to check spawn options for - /// True if the object should be spawned for the specified client, false otherwise + /// The clientId being checked for visibility. + /// True if the object should be visible to the specified client and false if it should not. public delegate bool SpawnDelegate(ulong clientId); /// - /// Delegate invoked when the netcode needs to know if it should include the transform when spawning the object, if null it will assume true + /// Delegate invoked when the netcode needs to know if it should include the transform when spawning the object, if null it will assume true. /// public SpawnDelegate IncludeTransformWhenSpawning = null; /// - /// Whether or not to destroy this object if it's owner is destroyed. + /// Whether or not to destroy this object if it's owner is destroyed.
/// If true, the objects ownership will be given to the server. ///
public bool DontDestroyWithOwner; @@ -1604,10 +1604,10 @@ internal ushort GetNetworkBehaviourOrderIndex(NetworkBehaviour instance) } /// - /// Gets a NetworkBehaviour component at the specified index in this object's NetworkBehaviour list + /// Gets a NetworkBehaviour component at the specified index in this object's NetworkBehaviour list. /// - /// The zero-based index of the NetworkBehaviour to retrieve - /// The NetworkBehaviour at the specified index, or null if the index is out of bounds + /// The zero-based index of the NetworkBehaviour to retrieve. + /// The NetworkBehaviour at the specified index, or null if the index is out of bounds. public NetworkBehaviour GetNetworkBehaviourAtOrderIndex(ushort index) { if (index >= ChildNetworkBehaviours.Count) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/CustomMessageManager.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/CustomMessageManager.cs index d7b58ad977..d9cfeb5a16 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/CustomMessageManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/CustomMessageManager.cs @@ -19,14 +19,14 @@ internal CustomMessagingManager(NetworkManager networkManager) } /// - /// Delegate used for incoming unnamed messages + /// Delegate used for incoming unnamed messages. /// - /// The clientId that sent the message - /// The stream containing the message data + /// The clientId that sent the message. + /// The stream containing the message data. public delegate void UnnamedMessageDelegate(ulong clientId, FastBufferReader reader); /// - /// Event invoked when unnamed messages arrive + /// Event invoked when unnamed messages arrive. /// public event UnnamedMessageDelegate OnUnnamedMessage; @@ -46,21 +46,21 @@ internal void InvokeUnnamedMessage(ulong clientId, FastBufferReader reader, int } /// - /// Sends unnamed message to all clients + /// Sends unnamed message to all clients. /// - /// The message stream containing the data - /// The delivery type (QoS) to send data with + /// The message stream containing the data. + /// The delivery type (QoS) used to send the data. public void SendUnnamedMessageToAll(FastBufferWriter messageBuffer, NetworkDelivery networkDelivery = NetworkDelivery.ReliableSequenced) { SendUnnamedMessage(m_NetworkManager.ConnectedClientsIds, messageBuffer, networkDelivery); } /// - /// Sends unnamed message to a list of clients + /// Sends unnamed message to a list of clients. /// - /// The clients to send to, sends to everyone if null - /// The message stream containing the data - /// The delivery type (QoS) to send data with + /// The clients to send to, sends to everyone if null. + /// The message stream containing the data. + /// The delivery type (QoS) used to send the data. public void SendUnnamedMessage(IReadOnlyList clientIds, FastBufferWriter messageBuffer, NetworkDelivery networkDelivery = NetworkDelivery.ReliableSequenced) { if (!m_NetworkManager.IsServer) @@ -103,11 +103,11 @@ public void SendUnnamedMessage(IReadOnlyList clientIds, FastBufferWriter } /// - /// Sends a unnamed message to a specific client + /// Sends a unnamed message to a specific client. /// - /// The client to send the message to - /// The message stream containing the data - /// The delivery type (QoS) to send data with + /// The client identifier to send the message to. + /// The message stream containing the data. + /// The delivery type (QoS) used to send the data. public void SendUnnamedMessage(ulong clientId, FastBufferWriter messageBuffer, NetworkDelivery networkDelivery = NetworkDelivery.ReliableSequenced) { ValidateMessageSize(messageBuffer, networkDelivery, isNamed: false); @@ -137,10 +137,10 @@ public void SendUnnamedMessage(ulong clientId, FastBufferWriter messageBuffer, N } /// - /// Delegate used to handle named messages + /// Delegate used to handle named messages. /// - /// The client identifier of the message sender - /// The buffer containing the message data to be read + /// The client identifier of the message sender. + /// The buffer containing the message data to be read. public delegate void HandleNamedMessageDelegate(ulong senderClientId, FastBufferReader messagePayload); private Dictionary m_NamedMessageHandlers32 = new Dictionary(); diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs index c8d4cedf45..7a1515b664 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs @@ -75,9 +75,9 @@ public class GenerateSerializationForGenericParameterAttribute : Attribute internal int ParameterIndex; /// - /// Initializes a new instance of the attribute + /// Initializes a new instance of the attribute. /// - /// The zero-based index of the generic parameter that should be serialized + /// The zero-based index of the generic parameter that should be serialized. public GenerateSerializationForGenericParameterAttribute(int parameterIndex) { ParameterIndex = parameterIndex; diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForTypeAttribute.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForTypeAttribute.cs index 5bfff33864..40581ba192 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForTypeAttribute.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForTypeAttribute.cs @@ -19,9 +19,9 @@ public class GenerateSerializationForTypeAttribute : Attribute internal Type Type; /// - /// Initializes a new instance of the attribute + /// Initializes a new instance of the attribute. /// - /// The type that should have serialization code generated for it + /// The type that should have serialization code generated for it. public GenerateSerializationForTypeAttribute(Type type) { Type = type; diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs index 39432097d4..081c4aeea5 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs @@ -3,17 +3,17 @@ namespace Unity.Netcode { /// - /// RPC delivery types + /// RPC delivery types. /// public enum RpcDelivery { /// - /// Reliable delivery + /// Reliable delivery. /// Reliable = 0, /// - /// Unreliable delivery + /// Unreliable delivery. /// Unreliable } @@ -26,54 +26,54 @@ public class RpcAttribute : Attribute { // Must match the set of parameters below /// - /// Parameters that define the behavior of an RPC + /// Parameters that define the behavior of an RPC. /// public struct RpcAttributeParams { /// - /// The delivery method for the RPC + /// The delivery method for the RPC. /// public RpcDelivery Delivery; /// - /// When true, only the owner of the object can execute this RPC + /// When true, only the owner of the object can execute this RPC. /// public bool RequireOwnership; /// - /// When true, local execution of the RPC is deferred until the next network tick + /// When true, local execution of the RPC is deferred until the next network tick. /// public bool DeferLocal; /// - /// When true, allows the RPC target to be overridden at runtime + /// When true, allows the RPC target to be overridden at runtime. /// public bool AllowTargetOverride; } // Must match the fields in RemoteAttributeParams /// - /// Type of RPC delivery method + /// Type of RPC delivery method. /// public RpcDelivery Delivery = RpcDelivery.Reliable; /// - /// When true, only the owner of the object can execute this RPC + /// When true, only the owner of the object can execute this RPC. /// public bool RequireOwnership; /// - /// When true, local execution of the RPC is deferred until the next network tick + /// When true, local execution of the RPC is deferred until the next network tick. /// public bool DeferLocal; /// - /// When true, allows the RPC target to be overridden at runtime + /// When true, allows the RPC target to be overridden at runtime. /// public bool AllowTargetOverride; /// - /// Initializes a new instance of the RpcAttribute with the specified target + /// Initializes a new instance of the RpcAttribute with the specified target. /// /// The target for this RPC public RpcAttribute(SendTo target) @@ -95,12 +95,12 @@ private RpcAttribute() public class ServerRpcAttribute : RpcAttribute { /// - /// When true, only the owner of the NetworkObject can invoke this ServerRpc + /// When true, only the owner of the NetworkObject can invoke this ServerRpc. /// public new bool RequireOwnership; /// - /// Initializes a new instance of ServerRpcAttribute configured to target the server + /// Initializes a new instance of ServerRpcAttribute configured to target the server. /// public ServerRpcAttribute() : base(SendTo.Server) { @@ -116,7 +116,7 @@ public ServerRpcAttribute() : base(SendTo.Server) public class ClientRpcAttribute : RpcAttribute { /// - /// Initializes a new instance of ClientRpcAttribute configured to target all non-server clients + /// Initializes a new instance of ClientRpcAttribute configured to target all non-server clients. /// public ClientRpcAttribute() : base(SendTo.NotServer) { diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs index b302e3f8f7..de5679a60e 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs @@ -4,201 +4,210 @@ namespace Unity.Netcode { /// - /// Specifies how RPC messages should be handled in terms of local execution timing + /// Specifies how RPC messages should be handled in terms of local execution timing. /// public enum LocalDeferMode { /// - /// Uses the default behavior for RPC message handling + /// Uses the default behavior for RPC message handling. /// Default, /// - /// Defers the local execution of the RPC until the next network tick + /// Defers the local execution of the RPC until the next network tick. /// Defer, /// - /// Executes the RPC immediately on the local client without waiting for network synchronization + /// Executes the RPC immediately on the local client without waiting for network synchronization. /// SendImmediate } /// - /// Generic RPC. Defines parameters for sending Remote Procedure Calls (RPCs) in the network system + /// Generic RPC. Defines parameters for sending Remote Procedure Calls (RPCs) in the network system. /// public struct RpcSendParams { /// - /// Specifies the target that will receive this RPC + /// Specifies the target that will receive this RPC. /// public BaseRpcTarget Target; /// - /// Controls how the RPC is handled for local execution timing + /// Controls how the RPC is handled for local execution timing. /// public LocalDeferMode LocalDeferMode; /// - /// Implicitly converts a BaseRpcTarget to RpcSendParams + /// Implicitly converts a BaseRpcTarget to RpcSendParams. /// - /// The RPC target to convert - /// A new RpcSendParams instance with the specified target + /// The RPC target to convert. + /// A new RpcSendParams instance with the specified target. public static implicit operator RpcSendParams(BaseRpcTarget target) => new RpcSendParams { Target = target }; /// - /// Implicitly converts a LocalDeferMode to RpcSendParams + /// Implicitly converts a LocalDeferMode to RpcSendParams. /// - /// The defer mode to convert - /// A new RpcSendParams instance with the specified defer mode + /// The defer mode to convert. + /// A new RpcSendParams instance with the specified defer mode. public static implicit operator RpcSendParams(LocalDeferMode deferMode) => new RpcSendParams { LocalDeferMode = deferMode }; } /// - /// The receive parameters for server-side remote procedure calls + /// The receive parameters for server-side remote procedure calls. /// public struct RpcReceiveParams { /// - /// Server-Side RPC - /// The client identifier of the sender + /// 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 + /// Server-Side RPC
+ /// Can be used with any sever-side remote procedure call.
///
+ /// + /// Note: typically this is use primarily for the . + /// public struct RpcParams { /// - /// The server RPC send parameters (currently a place holder) + /// The server RPC send parameters (currently a place holder). /// public RpcSendParams Send; /// - /// The client RPC receive parameters provides you with the sender's identifier + /// The client RPC receive parameters provides you with the sender's identifier. /// public RpcReceiveParams Receive; /// - /// Implicitly converts RpcSendParams to RpcParams + /// Implicitly converts RpcSendParams to RpcParams. /// - /// The send parameters to convert - /// A new RpcParams instance with the specified send parameters + /// The send parameters to convert. + /// A new RpcParams instance with the specified send parameters. public static implicit operator RpcParams(RpcSendParams send) => new RpcParams { Send = send }; /// - /// Implicitly converts a BaseRpcTarget to RpcParams + /// Implicitly converts a BaseRpcTarget to RpcParams. /// - /// The RPC target to convert - /// A new RpcParams instance with the specified target in its send parameters + /// The RPC target to convert. + /// A new RpcParams instance with the specified target in its send parameters. public static implicit operator RpcParams(BaseRpcTarget target) => new RpcParams { Send = new RpcSendParams { Target = target } }; /// - /// Implicitly converts a LocalDeferMode to RpcParams + /// Implicitly converts a LocalDeferMode to RpcParams. /// - /// The defer mode to convert - /// A new RpcParams instance with the specified defer mode in its send parameters + /// The defer mode to convert. + /// A new RpcParams instance with the specified defer mode in its send parameters. public static implicit operator RpcParams(LocalDeferMode deferMode) => new RpcParams { Send = new RpcSendParams { LocalDeferMode = deferMode } }; /// - /// Implicitly converts RpcReceiveParams to RpcParams + /// Implicitly converts RpcReceiveParams to RpcParams. /// - /// The receive parameters to convert - /// A new RpcParams instance with the specified receive parameters + /// The receive parameters to convert. + /// A new RpcParams instance with the specified receive parameters. public static implicit operator RpcParams(RpcReceiveParams receive) => new RpcParams { Receive = receive }; } /// - /// Server-Side RPC - /// Place holder. + /// 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 + /// so this structure is a place holder. ///
public struct ServerRpcSendParams { } /// - /// The receive parameters for server-side remote procedure calls + /// The receive parameters for server-side remote procedure calls. /// public struct ServerRpcReceiveParams { /// - /// Server-Side RPC - /// The client identifier of the sender + /// 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 + /// 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) + /// The server RPC send parameters (currently a place holder). /// public ServerRpcSendParams Send; /// - /// The client RPC receive parameters provides you with the sender's identifier + /// The client RPC receive parameters provides you with the sender's identifier. /// public ServerRpcReceiveParams Receive; } /// - /// Client-Side RPC + /// 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: + /// 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 + /// 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 + /// 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 + /// 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 + /// 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). + /// 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 + /// 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) + /// The client RPC receive parameters (currently a place holder). /// public ClientRpcReceiveParams Receive; } diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs index 9100259a23..f9a92f050d 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs @@ -5,7 +5,7 @@ namespace Unity.Netcode { /// - /// Defines how anticipated network variables handle authoritative updates that are older than the current anticipated state + /// Defines how anticipated network variables handle authoritative updates that are older than the current anticipated state. /// public enum StaleDataHandling { @@ -97,11 +97,11 @@ public class AnticipatedNetworkVariable : NetworkVariableBase public StaleDataHandling StaleDataHandling; /// - /// Delegate for handling changes in the authoritative value + /// Delegate for handling changes in the authoritative value. /// - /// The network variable that changed - /// The previous value before the change - /// The new value after the change + /// The network variable that changed. + /// The previous value before the change. + /// The new value after the change. public delegate void OnAuthoritativeValueChangedDelegate(AnticipatedNetworkVariable variable, in T previousValue, in T newValue); /// @@ -139,7 +139,7 @@ public void ResetAnticipation() private AnticipatedObject m_AnticipatedObject; /// - /// Initializes the network variable, setting up initial values and registering with the anticipation system + /// Initializes the network variable, setting up initial values and registering with the anticipation system. /// public override void OnInitialize() { @@ -154,9 +154,9 @@ public override void OnInitialize() } /// - /// Checks if the current value has changed enough from its last synchronized value to warrant a new network update + /// Checks if the current value has changed enough from its last synchronized value to warrant a new network update. /// - /// True if the value should be synchronized, false otherwise + /// True if the value should be synchronized or false if it should not. public override bool ExceedsDirtinessThreshold() { return m_AuthoritativeValue.ExceedsDirtinessThreshold(); @@ -181,7 +181,7 @@ public override bool ExceedsDirtinessThreshold() /// Indicates whether this variable currently needs /// reanticipation. If this is true, the anticipated value /// has been overwritten by the authoritative value from the - /// server; the previous anticipated value is stored in + /// server; the previous anticipated value is stored in . /// public bool ShouldReanticipate { @@ -201,7 +201,7 @@ public bool ShouldReanticipate /// Sets the current value of the variable on the expectation that the authority will set the variable /// to the same value within one network round trip (i.e., in response to an RPC). /// - /// The anticipated value that is expected to be confirmed by the authority + /// The anticipated value that is expected to be confirmed by the authority. public void Anticipate(T value) { if (m_NetworkBehaviour.NetworkManager.ShutdownInProgress || !m_NetworkBehaviour.NetworkManager.IsListening) @@ -221,8 +221,8 @@ public void Anticipate(T value) #pragma warning disable IDE0001 /// - /// Retrieves or sets the underlying authoritative value. - /// Note that only a client or server with write permissions to this variable may set this value. + /// Retrieves or sets the underlying authoritative value.
+ /// Note that only a client or server with write permissions to this variable may set this value.
/// When this variable has been anticipated, this value will alawys return the most recent authoritative /// state, which is updated even if is . ///
@@ -251,16 +251,16 @@ public T AuthoritativeValue /// See , , , and so on /// for examples. /// - /// The authoritative value to interpolate from - /// The anticipated value to interpolate to - /// The interpolation factor between 0 and 1 - /// The interpolated value + /// The authoritative value to interpolate from. + /// The anticipated value to interpolate to. + /// The interpolation factor between 0 and 1. + /// The interpolated value. public delegate T SmoothDelegate(T authoritativeValue, T anticipatedValue, float amount); private SmoothDelegate m_SmoothDelegate = null; /// - /// Initializes a new instance of the AnticipatedNetworkVariable class + /// Initializes a new instance of the AnticipatedNetworkVariable class. /// /// The initial value for the network variable. Defaults to the type's default value if not specified. /// Determines how the variable handles authoritative updates that are older than the current anticipated state. Defaults to StaleDataHandling.Ignore. @@ -276,7 +276,7 @@ public AnticipatedNetworkVariable(T value = default, } /// - /// Updates the smooth interpolation state if active + /// Updates the smooth interpolation state if active. /// public void Update() { @@ -340,7 +340,7 @@ public override void Dispose() } /// - /// Finalizer that ensures proper cleanup of network variable resources + /// Finalizer that ensures proper cleanup of network variable resources. /// ~AnticipatedNetworkVariable() { @@ -374,9 +374,9 @@ private void OnValueChangedInternal(T previousValue, T newValue) /// Interpolate this variable from to over of /// real time. The duration uses , so it is affected by . /// - /// The starting value for the interpolation - /// The target value to interpolate towards - /// The duration of the interpolation in seconds + /// The starting value for the interpolation. + /// The target value to interpolate towards. + /// The duration of the interpolation in seconds. /// A delegate that defines how the interpolation should be performed between the two values. It provides a function to interpolate between two values based on a percentage. public void Smooth(in T from, in T to, float durationSeconds, SmoothDelegate how) { diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs index 0d88a2abad..ef8f526cc4 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs @@ -5,9 +5,9 @@ namespace Unity.Netcode { /// - /// Event based NetworkVariable container for syncing Lists + /// Event based NetworkVariable container for syncing Lists. /// - /// The type for the list + /// The type for the list. [GenerateSerializationForGenericParameter(0)] public class NetworkList : NetworkVariableBase where T : unmanaged, IEquatable { @@ -15,18 +15,18 @@ public class NetworkList : NetworkVariableBase where T : unmanaged, IEquatabl private NativeList> m_DirtyEvents = new NativeList>(64, Allocator.Persistent); /// - /// Delegate type for list changed event + /// Delegate type for list changed event. /// - /// Struct containing information about the change event + /// Struct containing information about the change event. public delegate void OnListChangedDelegate(NetworkListEvent changeEvent); /// - /// The callback to be invoked when the list gets changed + /// The callback to be invoked when the list gets changed. /// public event OnListChangedDelegate OnListChanged; /// - /// Constructor for + /// Constructor for . /// public NetworkList() { } From 653d42c8d569db5640bf9c16063d9adaee3ee125 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Mon, 23 Jun 2025 10:38:12 -0500 Subject: [PATCH 25/25] style removing CR/LF. --- com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs index de5679a60e..82837df0f0 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcParams.cs @@ -197,7 +197,6 @@ public struct ClientRpcReceiveParams /// Note: Typically this is used primarily for sending to a specific list /// of clients as opposed to the default (all).
/// - ///
public struct ClientRpcParams {