From f74f6b5344ea605b668ad94b52e33c0e2267ce60 Mon Sep 17 00:00:00 2001 From: "unity-renovate[bot]" <120015202+unity-renovate[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 12:21:41 +0000 Subject: [PATCH 1/8] chore(deps): update bokken image package-ci/ubuntu-22.04 to v4.81.0 --- .yamato/project.metafile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.yamato/project.metafile b/.yamato/project.metafile index f434d36106..15c89a2bd4 100644 --- a/.yamato/project.metafile +++ b/.yamato/project.metafile @@ -24,7 +24,7 @@ small_agent_platform: - name: ubuntu type: Unity::VM - image: package-ci/ubuntu-22.04:v4.77.0 + image: package-ci/ubuntu-22.04:v4.81.0 flavor: b1.small @@ -39,13 +39,13 @@ test_platforms: default: - name: ubuntu type: Unity::VM - image: package-ci/ubuntu-22.04:v4.77.0 + image: package-ci/ubuntu-22.04:v4.81.0 flavor: b1.large standalone: StandaloneLinux64 desktop: - name: ubuntu type: Unity::VM - image: package-ci/ubuntu-22.04:v4.77.0 + image: package-ci/ubuntu-22.04:v4.81.0 flavor: b1.large smaller_flavor: b1.medium larger_flavor: b1.xlarge From 6e48e9deb6a60fc3dfe0ecb5a25636bb747c3240 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Fri, 23 Jan 2026 14:10:39 +0100 Subject: [PATCH 2/8] fixed standards error --- .../Editor/NetworkRigidbodyBaseEditor.cs | 5 ++++- .../Editor/NetworkTransformEditor.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Editor/NetworkRigidbodyBaseEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkRigidbodyBaseEditor.cs index 8ab99436d8..611c11ed27 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkRigidbodyBaseEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkRigidbodyBaseEditor.cs @@ -33,7 +33,10 @@ private void DisplayNetworkRigidbodyProperties() public override void OnInspectorGUI() { var networkRigidbodyBase = target as NetworkRigidbodyBase; - void SetExpanded(bool expanded) { networkRigidbodyBase.NetworkRigidbodyBaseExpanded = expanded; }; + void SetExpanded(bool expanded) + { + networkRigidbodyBase.NetworkRigidbodyBaseExpanded = expanded; + }; DrawFoldOutGroup(networkRigidbodyBase.GetType(), DisplayNetworkRigidbodyProperties, networkRigidbodyBase.NetworkRigidbodyBaseExpanded, SetExpanded); base.OnInspectorGUI(); } diff --git a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs index b5def1f138..8dfd8ab72b 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs @@ -307,7 +307,10 @@ private void DrawToggleProperty(Rect rect, string label, SerializedProperty prop public override void OnInspectorGUI() { var networkTransform = target as NetworkTransform; - void SetExpanded(bool expanded) { networkTransform.NetworkTransformExpanded = expanded; }; + void SetExpanded(bool expanded) + { + networkTransform.NetworkTransformExpanded = expanded; + }; DrawFoldOutGroup(networkTransform.GetType(), DisplayNetworkTransformProperties, networkTransform.NetworkTransformExpanded, SetExpanded); base.OnInspectorGUI(); } From 642f22b942d914dc571e9b3394fdff8e940462b7 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Fri, 23 Jan 2026 15:11:19 +0100 Subject: [PATCH 3/8] temp fix for standards --- .yamato/project-standards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/project-standards.yml b/.yamato/project-standards.yml index 6a70daf149..a9a6d12b86 100644 --- a/.yamato/project-standards.yml +++ b/.yamato/project-standards.yml @@ -47,7 +47,7 @@ standards_{{ platform.name }}_{{ project.name }}_{{ editor }}: - unity-downloader-cli --fast --wait -u {{ editor }} -c editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloads basic editor - .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit # This command is used to invoke Unity in a "headless" mode. It's used to sync the project - - dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --check # Runs standards check + - dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix # Runs standards check {% endfor -%} {% endfor -%} {% endfor -%} \ No newline at end of file From c17adada504f9fb7c92cf13062a7acff3d85f27e Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Fri, 23 Jan 2026 15:41:53 +0100 Subject: [PATCH 4/8] Modified standards check to print the diff to ease fixing and corrected files --- .yamato/project-standards.yml | 3 +- .../Editor/NetworkRigidbodyBaseEditor.cs | 3 +- .../Editor/NetworkTransformEditor.cs | 3 +- .../Runtime/Core/NetworkObject.cs | 63 +++++++++++++++---- 4 files changed, 56 insertions(+), 16 deletions(-) diff --git a/.yamato/project-standards.yml b/.yamato/project-standards.yml index a9a6d12b86..e917a359c1 100644 --- a/.yamato/project-standards.yml +++ b/.yamato/project-standards.yml @@ -47,7 +47,8 @@ standards_{{ platform.name }}_{{ project.name }}_{{ editor }}: - unity-downloader-cli --fast --wait -u {{ editor }} -c editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloads basic editor - .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit # This command is used to invoke Unity in a "headless" mode. It's used to sync the project - - dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix # Runs standards check + - dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix # Auto-fix formatting issues + - git diff --exit-code || (echo "ERROR: Code formatting issues found. Run 'dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix' locally and commit the changes." && exit 1) # Fail if formatter made any changes {% endfor -%} {% endfor -%} {% endfor -%} \ No newline at end of file diff --git a/com.unity.netcode.gameobjects/Editor/NetworkRigidbodyBaseEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkRigidbodyBaseEditor.cs index 611c11ed27..40c15fc4fc 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkRigidbodyBaseEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkRigidbodyBaseEditor.cs @@ -36,7 +36,8 @@ public override void OnInspectorGUI() void SetExpanded(bool expanded) { networkRigidbodyBase.NetworkRigidbodyBaseExpanded = expanded; - }; + } + DrawFoldOutGroup(networkRigidbodyBase.GetType(), DisplayNetworkRigidbodyProperties, networkRigidbodyBase.NetworkRigidbodyBaseExpanded, SetExpanded); base.OnInspectorGUI(); } diff --git a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs index 8dfd8ab72b..62d565e753 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs @@ -310,7 +310,8 @@ public override void OnInspectorGUI() void SetExpanded(bool expanded) { networkTransform.NetworkTransformExpanded = expanded; - }; + } + DrawFoldOutGroup(networkTransform.GetType(), DisplayNetworkTransformProperties, networkTransform.NetworkTransformExpanded, SetExpanded); base.OnInspectorGUI(); } diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index cbcd40ed4d..1e786c0055 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -504,7 +504,8 @@ public void DeferDespawn(int tickOffset, bool destroy = true) /// In order for this status to be applied, the the must have the /// flag set and a non-owner client must have sent a request via . /// - public bool IsRequestInProgress => ((OwnershipStatusExtended)Ownership).HasFlag(OwnershipStatusExtended.Requested); + public bool IsRequestInProgress => + ((OwnershipStatusExtended)Ownership).HasFlag(OwnershipStatusExtended.Requested); /// /// Determines whether a NetworkObject can be distributed to other clients during @@ -2906,18 +2907,54 @@ internal struct SerializedObject internal ushort GetBitsetRepresentation() { ushort bitset = 0; - if (IsPlayerObject) { bitset |= k_IsPlayerObject; }; - if (HasParent) { bitset |= k_HasParent; }; - if (IsSceneObject) { bitset |= k_IsSceneObject; }; - if (HasTransform) { bitset |= k_HasTransform; }; - if (IsLatestParentSet) { bitset |= k_IsLatestParentSet; }; - if (WorldPositionStays) { bitset |= k_WorldPositionStays; }; - if (DestroyWithScene) { bitset |= k_DestroyWithScene; }; - if (DontDestroyWithOwner) { bitset |= k_DontDestroyWithOwner; }; - if (HasOwnershipFlags) { bitset |= k_HasOwnershipFlags; }; - if (SyncObservers) { bitset |= k_SyncObservers; }; - if (SpawnWithObservers) { bitset |= k_SpawnWithObservers; }; - if (HasInstantiationData) { bitset |= k_HasInstantiationData; }; + if (IsPlayerObject) + { + bitset |= k_IsPlayerObject; + } + if (HasParent) + { + bitset |= k_HasParent; + } + if (IsSceneObject) + { + bitset |= k_IsSceneObject; + } + if (HasTransform) + { + bitset |= k_HasTransform; + } + if (IsLatestParentSet) + { + bitset |= k_IsLatestParentSet; + } + if (WorldPositionStays) + { + bitset |= k_WorldPositionStays; + } + if (DestroyWithScene) + { + bitset |= k_DestroyWithScene; + } + if (DontDestroyWithOwner) + { + bitset |= k_DontDestroyWithOwner; + } + if (HasOwnershipFlags) + { + bitset |= k_HasOwnershipFlags; + } + if (SyncObservers) + { + bitset |= k_SyncObservers; + } + if (SpawnWithObservers) + { + bitset |= k_SpawnWithObservers; + } + if (HasInstantiationData) + { + bitset |= k_HasInstantiationData; + } return bitset; } From 4ef931c6f49b753b417a6a80a6a20d56a8daa522 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Fri, 23 Jan 2026 15:55:43 +0100 Subject: [PATCH 5/8] fix linter --- .yamato/project-standards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/project-standards.yml b/.yamato/project-standards.yml index e917a359c1..246ab6f905 100644 --- a/.yamato/project-standards.yml +++ b/.yamato/project-standards.yml @@ -48,7 +48,7 @@ standards_{{ platform.name }}_{{ project.name }}_{{ editor }}: - unity-downloader-cli --fast --wait -u {{ editor }} -c editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloads basic editor - .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit # This command is used to invoke Unity in a "headless" mode. It's used to sync the project - dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix # Auto-fix formatting issues - - git diff --exit-code || (echo "ERROR: Code formatting issues found. Run 'dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix' locally and commit the changes." && exit 1) # Fail if formatter made any changes + - 'git diff --exit-code || (echo "ERROR: Code formatting issues found. Run dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix locally and commit the changes." && exit 1)' # Fail if formatter made any changes {% endfor -%} {% endfor -%} {% endfor -%} \ No newline at end of file From 1f847741c01420b0f3b9b23351b07eeae620b983 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Fri, 23 Jan 2026 16:44:49 +0100 Subject: [PATCH 6/8] Fixed standard issues --- .../Runtime/Components/NetworkAnimator.cs | 7 +- .../RigidbodyContactEventManager.cs | 6 +- .../Runtime/Core/NetworkManager.cs | 12 +- .../Runtime/Core/NetworkUpdateLoop.cs | 2 +- .../IDeferredNetworkMessageManager.cs | 8 +- .../Runtime/Messaging/INetworkHooks.cs | 24 +-- .../Runtime/Messaging/INetworkMessage.cs | 8 +- .../Messaging/INetworkMessageProvider.cs | 2 +- .../Messaging/INetworkMessageSender.cs | 2 +- .../Messaging/RpcTargets/IGroupRpcTarget.cs | 6 +- .../RpcTargets/IIndividualRpcTarget.cs | 4 +- .../Runtime/Metrics/INetworkMetrics.cs | 68 ++++---- .../SceneManagement/ISceneManagerHandler.cs | 26 +-- .../Serialization/INetworkSerializable.cs | 2 +- .../Runtime/Serialization/IReaderWriter.cs | 152 +++++++++--------- .../Runtime/Timing/IRealTimeProvider.cs | 10 +- .../UTP/INetworkStreamDriverConstructor.cs | 2 +- .../TestHelpers/ConditionalPredicate.cs | 6 +- .../Scripts/MenuManagement/SceneReference.cs | 4 +- .../Tests/Manual/Scripts/IPlayerMovement.cs | 2 +- 20 files changed, 173 insertions(+), 180 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs b/com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs index 2cde6a1be6..b939717f6d 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs @@ -754,11 +754,8 @@ static AnimationParamEnumWrapper() /// private void SpawnCleanup() { - if (m_NetworkAnimatorStateChangeHandler != null) - { - m_NetworkAnimatorStateChangeHandler.DeregisterUpdate(); - m_NetworkAnimatorStateChangeHandler = null; - } + m_NetworkAnimatorStateChangeHandler?.DeregisterUpdate(); + m_NetworkAnimatorStateChangeHandler = null; } public override void OnDestroy() diff --git a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs index 0d6e3d494d..bf54c4d964 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs @@ -38,7 +38,7 @@ public interface IContactEventHandler /// /// Should return a . /// - Rigidbody GetRigidbody(); + public Rigidbody GetRigidbody(); /// /// Invoked by the instance. @@ -49,7 +49,7 @@ public interface IContactEventHandler /// The world space location of the contact event. /// Will be set if this is a collision stay contact event (i.e. it is not the first contact event and continually has contact) /// The average normal of the collision stay contact over time. - void ContactEvent(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default); + public void ContactEvent(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default); } /// @@ -62,7 +62,7 @@ public interface IContactEventHandlerWithInfo : IContactEventHandler /// Invoked by for each set of contact events it is processing (prior to processing). /// /// - ContactEventHandlerInfo GetContactEventHandlerInfo(); + public ContactEventHandlerInfo GetContactEventHandlerInfo(); } /// diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs index 66f1a67e3b..3eeab3649c 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs @@ -1623,12 +1623,8 @@ internal void ShutdownInternal() // Shutdown connection manager last which shuts down transport ConnectionManager.Shutdown(); - - if (MessageManager != null) - { - MessageManager.Dispose(); - MessageManager = null; - } + MessageManager?.Dispose(); + MessageManager = null; // Let the NetworkSceneManager clean up its two SceneEvenData instances SceneManager?.Dispose(); @@ -1745,9 +1741,9 @@ private void OnDestroy() /// internal interface INetworkManagerHelper { - bool NotifyUserOfNestedNetworkManager(NetworkManager networkManager, bool ignoreNetworkManagerCache = false, bool editorTest = false); + public bool NotifyUserOfNestedNetworkManager(NetworkManager networkManager, bool ignoreNetworkManagerCache = false, bool editorTest = false); - void CheckAndNotifyUserNetworkObjectRemoved(NetworkManager networkManager, bool editorTest = false); + public void CheckAndNotifyUserNetworkObjectRemoved(NetworkManager networkManager, bool editorTest = false); internal NetcodeAnalytics Analytics(); } diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkUpdateLoop.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkUpdateLoop.cs index 5f60e748be..c48dea0333 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkUpdateLoop.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkUpdateLoop.cs @@ -15,7 +15,7 @@ public interface INetworkUpdateSystem /// The update method that is being executed in the context of related . /// /// The that is being executed. - void NetworkUpdate(NetworkUpdateStage updateStage); + public void NetworkUpdate(NetworkUpdateStage updateStage); } /// diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/IDeferredNetworkMessageManager.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/IDeferredNetworkMessageManager.cs index 0f55de95c2..910021f606 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/IDeferredNetworkMessageManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/IDeferredNetworkMessageManager.cs @@ -18,20 +18,20 @@ internal enum TriggerType /// There is a one second maximum lifetime of triggers to avoid memory leaks. After one second has passed /// without the requested object ID being spawned, the triggers for it are automatically deleted. /// - void DeferMessage(TriggerType trigger, ulong key, FastBufferReader reader, ref NetworkContext context, string messageType = null); + public void DeferMessage(TriggerType trigger, ulong key, FastBufferReader reader, ref NetworkContext context, string messageType = null); /// /// Cleans up any trigger that's existed for more than a second. /// These triggers were probably for situations where a request was received after a despawn rather than before a spawn. /// - void CleanupStaleTriggers(); + public void CleanupStaleTriggers(); - void ProcessTriggers(TriggerType trigger, ulong key); + public void ProcessTriggers(TriggerType trigger, ulong key); /// /// Cleans up any trigger that's existed for more than a second. /// These triggers were probably for situations where a request was received after a despawn rather than before a spawn. /// - void CleanupAllTriggers(); + public void CleanupAllTriggers(); } } diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkHooks.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkHooks.cs index 7543a11255..20789df764 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkHooks.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkHooks.cs @@ -15,7 +15,7 @@ internal interface INetworkHooks /// The destination clientId /// The message being sent /// - void OnBeforeSendMessage(ulong clientId, ref T message, NetworkDelivery delivery) where T : INetworkMessage; + public void OnBeforeSendMessage(ulong clientId, ref T message, NetworkDelivery delivery) where T : INetworkMessage; /// /// Called after an individual message is sent. @@ -24,7 +24,7 @@ internal interface INetworkHooks /// The message being sent /// /// Number of bytes in the message, not including the message header - void OnAfterSendMessage(ulong clientId, ref T message, NetworkDelivery delivery, int messageSizeBytes) where T : INetworkMessage; + public void OnAfterSendMessage(ulong clientId, ref T message, NetworkDelivery delivery, int messageSizeBytes) where T : INetworkMessage; /// /// Called before an individual message is received. @@ -32,7 +32,7 @@ internal interface INetworkHooks /// The source clientId /// The type of the message being sent /// Number of bytes in the message, not including the message header - void OnBeforeReceiveMessage(ulong senderId, Type messageType, int messageSizeBytes); + public void OnBeforeReceiveMessage(ulong senderId, Type messageType, int messageSizeBytes); /// /// Called after an individual message is received. @@ -40,7 +40,7 @@ internal interface INetworkHooks /// The source clientId /// The type of the message being sent /// Number of bytes in the message, not including the message header - void OnAfterReceiveMessage(ulong senderId, Type messageType, int messageSizeBytes); + public void OnAfterReceiveMessage(ulong senderId, Type messageType, int messageSizeBytes); /// /// Called before a batch of messages is sent @@ -49,7 +49,7 @@ internal interface INetworkHooks /// Number of messages in the batch /// Number of bytes in the batch, including the batch header /// - void OnBeforeSendBatch(ulong clientId, int messageCount, int batchSizeInBytes, NetworkDelivery delivery); + public void OnBeforeSendBatch(ulong clientId, int messageCount, int batchSizeInBytes, NetworkDelivery delivery); /// /// Called after a batch of messages is sent @@ -58,7 +58,7 @@ internal interface INetworkHooks /// Number of messages in the batch /// Number of bytes in the batch, including the batch header /// - void OnAfterSendBatch(ulong clientId, int messageCount, int batchSizeInBytes, NetworkDelivery delivery); + public void OnAfterSendBatch(ulong clientId, int messageCount, int batchSizeInBytes, NetworkDelivery delivery); /// /// Called before a batch of messages is received @@ -66,7 +66,7 @@ internal interface INetworkHooks /// The source clientId /// Number of messages in the batch /// Number of bytes in the batch, including the batch header - void OnBeforeReceiveBatch(ulong senderId, int messageCount, int batchSizeInBytes); + public void OnBeforeReceiveBatch(ulong senderId, int messageCount, int batchSizeInBytes); /// /// Called after a batch of messages is received @@ -74,7 +74,7 @@ internal interface INetworkHooks /// The source clientId /// Number of messages in the batch /// Number of bytes in the batch, including the batch header - void OnAfterReceiveBatch(ulong senderId, int messageCount, int batchSizeInBytes); + public void OnAfterReceiveBatch(ulong senderId, int messageCount, int batchSizeInBytes); /// @@ -84,7 +84,7 @@ internal interface INetworkHooks /// The type of the message /// /// - bool OnVerifyCanSend(ulong destinationId, Type messageType, NetworkDelivery delivery); + public bool OnVerifyCanSend(ulong destinationId, Type messageType, NetworkDelivery delivery); /// /// Called before a message is received. If this returns false, the message will be discarded. @@ -94,7 +94,7 @@ internal interface INetworkHooks /// The FastBufferReader containing the message /// The NetworkContext the message is being processed in /// - bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReader messageContent, ref NetworkContext context); + public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReader messageContent, ref NetworkContext context); /// /// Called after a message is serialized, but before it's handled. @@ -103,7 +103,7 @@ internal interface INetworkHooks /// The message object /// The network context the message is being ahandled in /// - void OnBeforeHandleMessage(ref T message, ref NetworkContext context) where T : INetworkMessage; + public void OnBeforeHandleMessage(ref T message, ref NetworkContext context) where T : INetworkMessage; /// /// Called after a message is serialized and handled. @@ -112,6 +112,6 @@ internal interface INetworkHooks /// The message object /// The network context the message is being ahandled in /// - void OnAfterHandleMessage(ref T message, ref NetworkContext context) where T : INetworkMessage; + public void OnAfterHandleMessage(ref T message, ref NetworkContext context) where T : INetworkMessage; } } diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessage.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessage.cs index fc1d41d372..fe481d25f5 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessage.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessage.cs @@ -39,10 +39,10 @@ namespace Unity.Netcode /// internal interface INetworkMessage { - void Serialize(FastBufferWriter writer, int targetVersion); - bool Deserialize(FastBufferReader reader, ref NetworkContext context, int receivedMessageVersion); - void Handle(ref NetworkContext context); - int Version { get; } + public void Serialize(FastBufferWriter writer, int targetVersion); + public bool Deserialize(FastBufferReader reader, ref NetworkContext context, int receivedMessageVersion); + public void Handle(ref NetworkContext context); + public int Version { get; } } diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessageProvider.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessageProvider.cs index dcd0c1b2aa..bc731fe262 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessageProvider.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessageProvider.cs @@ -4,6 +4,6 @@ namespace Unity.Netcode { internal interface INetworkMessageProvider { - List GetMessages(); + public List GetMessages(); } } diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessageSender.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessageSender.cs index 5f20746976..f915bb0ced 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessageSender.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/INetworkMessageSender.cs @@ -2,6 +2,6 @@ namespace Unity.Netcode { internal interface INetworkMessageSender { - void Send(ulong clientId, NetworkDelivery delivery, FastBufferWriter batchData); + public void Send(ulong clientId, NetworkDelivery delivery, FastBufferWriter batchData); } } diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/IGroupRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/IGroupRpcTarget.cs index 88aac5073e..fadcfe8d42 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/IGroupRpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/IGroupRpcTarget.cs @@ -2,8 +2,8 @@ namespace Unity.Netcode { internal interface IGroupRpcTarget { - void Add(ulong clientId); - void Clear(); - BaseRpcTarget Target { get; } + public void Add(ulong clientId); + public void Clear(); + public BaseRpcTarget Target { get; } } } diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/IIndividualRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/IIndividualRpcTarget.cs index 0e654a8328..81bca626c2 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/IIndividualRpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/IIndividualRpcTarget.cs @@ -2,7 +2,7 @@ namespace Unity.Netcode { internal interface IIndividualRpcTarget { - void SetClientId(ulong clientId); - BaseRpcTarget Target { get; } + public void SetClientId(ulong clientId); + public BaseRpcTarget Target { get; } } } diff --git a/com.unity.netcode.gameobjects/Runtime/Metrics/INetworkMetrics.cs b/com.unity.netcode.gameobjects/Runtime/Metrics/INetworkMetrics.cs index 96a99b5cef..57f208f432 100644 --- a/com.unity.netcode.gameobjects/Runtime/Metrics/INetworkMetrics.cs +++ b/com.unity.netcode.gameobjects/Runtime/Metrics/INetworkMetrics.cs @@ -4,97 +4,97 @@ namespace Unity.Netcode { internal interface INetworkMetrics { - void SetConnectionId(ulong connectionId); + public void SetConnectionId(ulong connectionId); - void TrackTransportBytesSent(long bytesCount); + public void TrackTransportBytesSent(long bytesCount); - void TrackTransportBytesReceived(long bytesCount); + public void TrackTransportBytesReceived(long bytesCount); - void TrackNetworkMessageSent(ulong receivedClientId, string messageType, long bytesCount); + public void TrackNetworkMessageSent(ulong receivedClientId, string messageType, long bytesCount); - void TrackNetworkMessageReceived(ulong senderClientId, string messageType, long bytesCount); + public void TrackNetworkMessageReceived(ulong senderClientId, string messageType, long bytesCount); - void TrackNamedMessageSent(ulong receiverClientId, string messageName, long bytesCount); + public void TrackNamedMessageSent(ulong receiverClientId, string messageName, long bytesCount); - void TrackNamedMessageSent(IReadOnlyCollection receiverClientIds, string messageName, long bytesCount); + public void TrackNamedMessageSent(IReadOnlyCollection receiverClientIds, string messageName, long bytesCount); - void TrackNamedMessageReceived(ulong senderClientId, string messageName, long bytesCount); + public void TrackNamedMessageReceived(ulong senderClientId, string messageName, long bytesCount); - void TrackUnnamedMessageSent(ulong receiverClientId, long bytesCount); + public void TrackUnnamedMessageSent(ulong receiverClientId, long bytesCount); - void TrackUnnamedMessageSent(IReadOnlyCollection receiverClientIds, long bytesCount); + public void TrackUnnamedMessageSent(IReadOnlyCollection receiverClientIds, long bytesCount); - void TrackUnnamedMessageReceived(ulong senderClientId, long bytesCount); + public void TrackUnnamedMessageReceived(ulong senderClientId, long bytesCount); - void TrackNetworkVariableDeltaSent( + public void TrackNetworkVariableDeltaSent( ulong receiverClientId, NetworkObject networkObject, string variableName, string networkBehaviourName, long bytesCount); - void TrackNetworkVariableDeltaReceived( + public void TrackNetworkVariableDeltaReceived( ulong senderClientId, NetworkObject networkObject, string variableName, string networkBehaviourName, long bytesCount); - void TrackOwnershipChangeSent(ulong receiverClientId, NetworkObject networkObject, long bytesCount); + public void TrackOwnershipChangeSent(ulong receiverClientId, NetworkObject networkObject, long bytesCount); - void TrackOwnershipChangeReceived(ulong senderClientId, NetworkObject networkObject, long bytesCount); + public void TrackOwnershipChangeReceived(ulong senderClientId, NetworkObject networkObject, long bytesCount); - void TrackObjectSpawnSent(ulong receiverClientId, NetworkObject networkObject, long bytesCount); + public void TrackObjectSpawnSent(ulong receiverClientId, NetworkObject networkObject, long bytesCount); - void TrackObjectSpawnReceived(ulong senderClientId, NetworkObject networkObject, long bytesCount); + public void TrackObjectSpawnReceived(ulong senderClientId, NetworkObject networkObject, long bytesCount); - void TrackObjectDestroySent(ulong receiverClientId, NetworkObject networkObject, long bytesCount); + public void TrackObjectDestroySent(ulong receiverClientId, NetworkObject networkObject, long bytesCount); - void TrackObjectDestroyReceived(ulong senderClientId, NetworkObject networkObject, long bytesCount); + public void TrackObjectDestroyReceived(ulong senderClientId, NetworkObject networkObject, long bytesCount); - void TrackRpcSent( + public void TrackRpcSent( ulong receiverClientId, NetworkObject networkObject, string rpcName, string networkBehaviourName, long bytesCount); - void TrackRpcSent( + public void TrackRpcSent( ulong[] receiverClientIds, NetworkObject networkObject, string rpcName, string networkBehaviourName, long bytesCount); - void TrackRpcReceived( + public void TrackRpcReceived( ulong senderClientId, NetworkObject networkObject, string rpcName, string networkBehaviourName, long bytesCount); - void TrackServerLogSent(ulong receiverClientId, uint logType, long bytesCount); + public void TrackServerLogSent(ulong receiverClientId, uint logType, long bytesCount); - void TrackServerLogReceived(ulong senderClientId, uint logType, long bytesCount); + public void TrackServerLogReceived(ulong senderClientId, uint logType, long bytesCount); - void TrackSceneEventSent(IReadOnlyList receiverClientIds, uint sceneEventType, string sceneName, long bytesCount); + public void TrackSceneEventSent(IReadOnlyList receiverClientIds, uint sceneEventType, string sceneName, long bytesCount); - void TrackSceneEventSent(ulong receiverClientId, uint sceneEventType, string sceneName, long bytesCount); + public void TrackSceneEventSent(ulong receiverClientId, uint sceneEventType, string sceneName, long bytesCount); - void TrackSceneEventReceived(ulong senderClientId, uint sceneEventType, string sceneName, long bytesCount); + public void TrackSceneEventReceived(ulong senderClientId, uint sceneEventType, string sceneName, long bytesCount); - void TrackPacketSent(uint packetCount); + public void TrackPacketSent(uint packetCount); - void TrackPacketReceived(uint packetCount); + public void TrackPacketReceived(uint packetCount); - void UpdateRttToServer(int rtt); + public void UpdateRttToServer(int rtt); - void UpdateNetworkObjectsCount(int count); + public void UpdateNetworkObjectsCount(int count); - void UpdateConnectionsCount(int count); + public void UpdateConnectionsCount(int count); - void UpdatePacketLoss(float packetLoss); + public void UpdatePacketLoss(float packetLoss); - void DispatchFrame(); + public void DispatchFrame(); } } diff --git a/com.unity.netcode.gameobjects/Runtime/SceneManagement/ISceneManagerHandler.cs b/com.unity.netcode.gameobjects/Runtime/SceneManagement/ISceneManagerHandler.cs index 7db174a47c..ac64d4fc38 100644 --- a/com.unity.netcode.gameobjects/Runtime/SceneManagement/ISceneManagerHandler.cs +++ b/com.unity.netcode.gameobjects/Runtime/SceneManagement/ISceneManagerHandler.cs @@ -10,29 +10,29 @@ namespace Unity.Netcode /// internal interface ISceneManagerHandler { - AsyncOperation LoadSceneAsync(string sceneName, LoadSceneMode loadSceneMode, SceneEventProgress sceneEventProgress); + public AsyncOperation LoadSceneAsync(string sceneName, LoadSceneMode loadSceneMode, SceneEventProgress sceneEventProgress); - AsyncOperation UnloadSceneAsync(Scene scene, SceneEventProgress sceneEventProgress); + public AsyncOperation UnloadSceneAsync(Scene scene, SceneEventProgress sceneEventProgress); - void PopulateLoadedScenes(ref Dictionary scenesLoaded, NetworkManager networkManager = null); - Scene GetSceneFromLoadedScenes(string sceneName, NetworkManager networkManager = null); + public void PopulateLoadedScenes(ref Dictionary scenesLoaded, NetworkManager networkManager = null); + public Scene GetSceneFromLoadedScenes(string sceneName, NetworkManager networkManager = null); - bool DoesSceneHaveUnassignedEntry(string sceneName, NetworkManager networkManager = null); + public bool DoesSceneHaveUnassignedEntry(string sceneName, NetworkManager networkManager = null); - void StopTrackingScene(NetworkSceneHandle handle, string name, NetworkManager networkManager = null); + public void StopTrackingScene(NetworkSceneHandle handle, string name, NetworkManager networkManager = null); - void StartTrackingScene(Scene scene, bool assigned, NetworkManager networkManager = null); + public void StartTrackingScene(Scene scene, bool assigned, NetworkManager networkManager = null); - void ClearSceneTracking(NetworkManager networkManager = null); + public void ClearSceneTracking(NetworkManager networkManager = null); - void UnloadUnassignedScenes(NetworkManager networkManager = null); + public void UnloadUnassignedScenes(NetworkManager networkManager = null); - void MoveObjectsFromSceneToDontDestroyOnLoad(ref NetworkManager networkManager, Scene scene); + public void MoveObjectsFromSceneToDontDestroyOnLoad(ref NetworkManager networkManager, Scene scene); - void SetClientSynchronizationMode(ref NetworkManager networkManager, LoadSceneMode mode); + public void SetClientSynchronizationMode(ref NetworkManager networkManager, LoadSceneMode mode); - bool ClientShouldPassThrough(string sceneName, bool isPrimaryScene, LoadSceneMode clientSynchronizationMode, NetworkManager networkManager); + public bool ClientShouldPassThrough(string sceneName, bool isPrimaryScene, LoadSceneMode clientSynchronizationMode, NetworkManager networkManager); - bool IsIntegrationTest(); + public bool IsIntegrationTest(); } } diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/INetworkSerializable.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/INetworkSerializable.cs index da68a378af..10a51e0673 100644 --- a/com.unity.netcode.gameobjects/Runtime/Serialization/INetworkSerializable.cs +++ b/com.unity.netcode.gameobjects/Runtime/Serialization/INetworkSerializable.cs @@ -13,6 +13,6 @@ public interface INetworkSerializable /// Either BufferSerializerReader or BufferSerializerWriter, depending whether the serializer /// is in read mode or write mode. /// - void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter; + public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter; } } diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/IReaderWriter.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/IReaderWriter.cs index 676d09cf69..a4b262567e 100644 --- a/com.unity.netcode.gameobjects/Runtime/Serialization/IReaderWriter.cs +++ b/com.unity.netcode.gameobjects/Runtime/Serialization/IReaderWriter.cs @@ -12,37 +12,37 @@ public interface IReaderWriter /// /// Check whether this implementation is a "reader" - if it's been constructed to deserialize data /// - bool IsReader { get; } + public bool IsReader { get; } /// /// Check whether this implementation is a "writer" - if it's been constructed to serialize data /// - bool IsWriter { get; } + public bool IsWriter { get; } /// /// Get the underlying FastBufferReader struct. /// Only valid when IsReader == true /// /// underlying FastBufferReader - FastBufferReader GetFastBufferReader(); + public FastBufferReader GetFastBufferReader(); /// /// Get the underlying FastBufferWriter struct. /// Only valid when IsWriter == true /// /// underlying FastBufferWriter - FastBufferWriter GetFastBufferWriter(); + public FastBufferWriter GetFastBufferWriter(); /// /// Read or write a string /// /// The value to read/write /// If true, characters will be limited to one-byte ASCII characters - void SerializeValue(ref string s, bool oneByteChars = false); + public void SerializeValue(ref string s, bool oneByteChars = false); /// /// Read or write a single byte /// /// The value to read/write - void SerializeValue(ref byte value); + public void SerializeValue(ref byte value); /// /// Read or write a primitive value (int, bool, etc) @@ -52,7 +52,7 @@ public interface IReaderWriter /// The value to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref T value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable, IEquatable; + public void SerializeValue(ref T value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable, IEquatable; /// /// Read or write an array of primitive values (int, bool, etc) @@ -62,7 +62,7 @@ public interface IReaderWriter /// The values to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref T[] value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable, IEquatable; + public void SerializeValue(ref T[] value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable, IEquatable; /// /// Read or write an enum value @@ -70,7 +70,7 @@ public interface IReaderWriter /// The value to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref T value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum; + public void SerializeValue(ref T value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum; /// /// Read or write an array of enum values @@ -78,7 +78,7 @@ public interface IReaderWriter /// The value to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref T[] value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum; + public void SerializeValue(ref T[] value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum; /// /// Read or write a struct value implementing ISerializeByMemcpy @@ -86,7 +86,7 @@ public interface IReaderWriter /// The value to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref T value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy; + public void SerializeValue(ref T value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy; /// /// Read or write an array of struct values implementing ISerializeByMemcpy @@ -94,7 +94,7 @@ public interface IReaderWriter /// The values to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref T[] value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy; + public void SerializeValue(ref T[] value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy; /// /// Read or write a NativeArray of struct values implementing ISerializeByMemcpy @@ -103,7 +103,7 @@ public interface IReaderWriter /// The allocator to use to construct the resulting NativeArray when reading /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref NativeArray value, Allocator allocator, FastBufferWriter.ForGeneric unused = default) where T : unmanaged; + public void SerializeValue(ref NativeArray value, Allocator allocator, FastBufferWriter.ForGeneric unused = default) where T : unmanaged; #if UNITY_NETCODE_NATIVE_COLLECTION_SUPPORT /// @@ -112,7 +112,7 @@ public interface IReaderWriter /// The values to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref NativeList value, FastBufferWriter.ForGeneric unused = default) where T : unmanaged; + public void SerializeValue(ref NativeList value, FastBufferWriter.ForGeneric unused = default) where T : unmanaged; #endif /// @@ -121,7 +121,7 @@ public interface IReaderWriter /// The value to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref T value, FastBufferWriter.ForNetworkSerializable unused = default) where T : INetworkSerializable, new(); + public void SerializeValue(ref T value, FastBufferWriter.ForNetworkSerializable unused = default) where T : INetworkSerializable, new(); /// /// Read or write an array of struct or class values implementing INetworkSerializable @@ -129,7 +129,7 @@ public interface IReaderWriter /// The values to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref T[] value, FastBufferWriter.ForNetworkSerializable unused = default) where T : INetworkSerializable, new(); + public void SerializeValue(ref T[] value, FastBufferWriter.ForNetworkSerializable unused = default) where T : INetworkSerializable, new(); /// /// Read or write a FixedString value @@ -137,7 +137,7 @@ public interface IReaderWriter /// The value to read/write /// An unused parameter used for enabling overload resolution based on generic constraints /// The type being serialized - void SerializeValue(ref T value, FastBufferWriter.ForFixedStrings unused = default) + public void SerializeValue(ref T value, FastBufferWriter.ForFixedStrings unused = default) where T : unmanaged, INativeList, IUTF8Bytes; /// @@ -146,7 +146,7 @@ void SerializeValue(ref T value, FastBufferWriter.ForFixedStrings unused = de /// The value to read/write /// The allocator to use to construct the resulting NativeArray when reading /// The type being serialized - void SerializeValue(ref NativeArray value, Allocator allocator) + public void SerializeValue(ref NativeArray value, Allocator allocator) where T : unmanaged, INativeList, IUTF8Bytes; #if UNITY_NETCODE_NATIVE_COLLECTION_SUPPORT @@ -155,7 +155,7 @@ void SerializeValue(ref NativeArray value, Allocator allocator) /// /// The value to read/write /// The type being serialized - void SerializeValue(ref NativeList value) + public void SerializeValue(ref NativeList value) where T : unmanaged, INativeList, IUTF8Bytes; #endif @@ -163,133 +163,133 @@ void SerializeValue(ref NativeList value) /// Read or write a Vector2 value /// /// The value to read/write - void SerializeValue(ref Vector2 value); + public void SerializeValue(ref Vector2 value); /// /// Read or write an array of Vector2 values /// /// The values to read/write - void SerializeValue(ref Vector2[] value); + public void SerializeValue(ref Vector2[] value); /// /// Read or write a Vector3 value /// /// The value to read/write - void SerializeValue(ref Vector3 value); + public void SerializeValue(ref Vector3 value); /// /// Read or write an array of Vector3 values /// /// The values to read/write - void SerializeValue(ref Vector3[] value); + public void SerializeValue(ref Vector3[] value); /// /// Read or write a Vector2Int value /// /// The value to read/write - void SerializeValue(ref Vector2Int value); + public void SerializeValue(ref Vector2Int value); /// /// Read or write an array of Vector2Int values /// /// The values to read/write - void SerializeValue(ref Vector2Int[] value); + public void SerializeValue(ref Vector2Int[] value); /// /// Read or write a Vector3Int value /// /// The value to read/write - void SerializeValue(ref Vector3Int value); + public void SerializeValue(ref Vector3Int value); /// /// Read or write an array of Vector3Int values /// /// The values to read/write - void SerializeValue(ref Vector3Int[] value); + public void SerializeValue(ref Vector3Int[] value); /// /// Read or write a Vector4 value /// /// The value to read/write - void SerializeValue(ref Vector4 value); + public void SerializeValue(ref Vector4 value); /// /// Read or write an array of Vector4 values /// /// The values to read/write - void SerializeValue(ref Vector4[] value); + public void SerializeValue(ref Vector4[] value); /// /// Read or write a Quaternion value /// /// The value to read/write - void SerializeValue(ref Quaternion value); + public void SerializeValue(ref Quaternion value); /// /// Read or write an array of Quaternion values /// /// The values to read/write - void SerializeValue(ref Quaternion[] value); + public void SerializeValue(ref Quaternion[] value); /// /// Read or write a Pose value /// /// The value to read/write - void SerializeValue(ref Pose value); + public void SerializeValue(ref Pose value); /// /// Read or write an array of Pose values /// /// The values to read/write - void SerializeValue(ref Pose[] value); + public void SerializeValue(ref Pose[] value); /// /// Read or write a Color value /// /// The value to read/write - void SerializeValue(ref Color value); + public void SerializeValue(ref Color value); /// /// Read or write an array of Color values /// /// The values to read/write - void SerializeValue(ref Color[] value); + public void SerializeValue(ref Color[] value); /// /// Read or write a Color32 value /// /// The value to read/write - void SerializeValue(ref Color32 value); + public void SerializeValue(ref Color32 value); /// /// Read or write an array of Color32 values /// /// The values to read/write - void SerializeValue(ref Color32[] value); + public void SerializeValue(ref Color32[] value); /// /// Read or write a Ray value /// /// The value to read/write - void SerializeValue(ref Ray value); + public void SerializeValue(ref Ray value); /// /// Read or write an array of Ray values /// /// The values to read/write - void SerializeValue(ref Ray[] value); + public void SerializeValue(ref Ray[] value); /// /// Read or write a Ray2D value /// /// The value to read/write - void SerializeValue(ref Ray2D value); + public void SerializeValue(ref Ray2D value); /// /// Read or write an array of Ray2D values /// /// The values to read/write - void SerializeValue(ref Ray2D[] value); + public void SerializeValue(ref Ray2D[] value); /// /// Read or write a NetworkSerializable value. @@ -297,7 +297,7 @@ void SerializeValue(ref NativeList value) /// /// The value to read/write /// The network serializable type - void SerializeNetworkSerializable(ref T value) where T : INetworkSerializable, new(); + public void SerializeNetworkSerializable(ref T value) where T : INetworkSerializable, new(); /// /// Performs an advance check to ensure space is available to read/write one or more values. @@ -310,7 +310,7 @@ void SerializeValue(ref NativeList value) /// True if there is sufficient space for the specified amount of bytes. /// False if there isn't enough space available. /// - bool PreCheck(int amount); + public bool PreCheck(int amount); /// /// Serialize a string, "pre-checked", which skips buffer checks. @@ -320,7 +320,7 @@ void SerializeValue(ref NativeList value) /// /// The value to read/write /// If true, characters will be limited to one-byte ASCII characters - void SerializeValuePreChecked(ref string s, bool oneByteChars = false); + public void SerializeValuePreChecked(ref string s, bool oneByteChars = false); /// /// Serialize a byte, "pre-checked", which skips buffer checks. @@ -329,7 +329,7 @@ void SerializeValue(ref NativeList value) /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref byte value); + public void SerializeValuePreChecked(ref byte value); /// /// Serialize a primitive, "pre-checked", which skips buffer checks. @@ -340,7 +340,7 @@ void SerializeValue(ref NativeList value) /// The type being serialized /// The value to read/write /// An unused parameter that can be used for enabling overload resolution based on generic constraints - void SerializeValuePreChecked(ref T value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable, IEquatable; + public void SerializeValuePreChecked(ref T value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable, IEquatable; /// /// Serialize an array of primitives, "pre-checked", which skips buffer checks. @@ -351,7 +351,7 @@ void SerializeValue(ref NativeList value) /// The type being serialized /// The values to read/write /// An unused parameter that can be used for enabling overload resolution based on generic constraints - void SerializeValuePreChecked(ref T[] value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable, IEquatable; + public void SerializeValuePreChecked(ref T[] value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable, IEquatable; /// /// Serialize an enum, "pre-checked", which skips buffer checks. @@ -362,7 +362,7 @@ void SerializeValue(ref NativeList value) /// The type being serialized /// The value to read/write /// An unused parameter that can be used for enabling overload resolution based on generic constraints - void SerializeValuePreChecked(ref T value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum; + public void SerializeValuePreChecked(ref T value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum; /// /// Serialize an array of enums, "pre-checked", which skips buffer checks. @@ -373,7 +373,7 @@ void SerializeValue(ref NativeList value) /// The type being serialized /// The values to read/write /// An unused parameter that can be used for enabling overload resolution based on generic constraints - void SerializeValuePreChecked(ref T[] value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum; + public void SerializeValuePreChecked(ref T[] value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum; /// /// Serialize a struct, "pre-checked", which skips buffer checks. @@ -384,7 +384,7 @@ void SerializeValue(ref NativeList value) /// The type being serialized /// The value to read/write /// An unused parameter that can be used for enabling overload resolution based on generic constraints - void SerializeValuePreChecked(ref T value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy; + public void SerializeValuePreChecked(ref T value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy; /// /// Serialize an array of structs, "pre-checked", which skips buffer checks. @@ -395,7 +395,7 @@ void SerializeValue(ref NativeList value) /// The type being serialized /// The values to read/write /// An unused parameter that can be used for enabling overload resolution based on generic constraints - void SerializeValuePreChecked(ref T[] value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy; + public void SerializeValuePreChecked(ref T[] value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy; /// /// Serialize a NativeArray of structs, "pre-checked", which skips buffer checks. @@ -407,7 +407,7 @@ void SerializeValue(ref NativeList value) /// The values to read/write /// The allocator to use to construct the resulting NativeArray when reading /// An unused parameter that can be used for enabling overload resolution based on generic constraints - void SerializeValuePreChecked(ref NativeArray value, Allocator allocator, FastBufferWriter.ForGeneric unused = default) where T : unmanaged; + public void SerializeValuePreChecked(ref NativeArray value, Allocator allocator, FastBufferWriter.ForGeneric unused = default) where T : unmanaged; #if UNITY_NETCODE_NATIVE_COLLECTION_SUPPORT /// @@ -419,7 +419,7 @@ void SerializeValue(ref NativeList value) /// The type being serialized /// The values to read/write /// An unused parameter that can be used for enabling overload resolution based on generic constraints - void SerializeValuePreChecked(ref NativeList value, FastBufferWriter.ForGeneric unused = default) where T : unmanaged; + public void SerializeValuePreChecked(ref NativeList value, FastBufferWriter.ForGeneric unused = default) where T : unmanaged; #endif /// @@ -431,7 +431,7 @@ void SerializeValue(ref NativeList value) /// The type being serialized /// The value to read/write /// An unused parameter that can be used for enabling overload resolution based on generic constraints - void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings unused = default) + public void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings unused = default) where T : unmanaged, INativeList, IUTF8Bytes; /// @@ -441,7 +441,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Vector2 value); + public void SerializeValuePreChecked(ref Vector2 value); /// /// Serialize a Vector2 array, "pre-checked", which skips buffer checks. @@ -450,7 +450,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The values to read/write - void SerializeValuePreChecked(ref Vector2[] value); + public void SerializeValuePreChecked(ref Vector2[] value); /// /// Serialize a Vector3, "pre-checked", which skips buffer checks. @@ -459,7 +459,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Vector3 value); + public void SerializeValuePreChecked(ref Vector3 value); /// /// Serialize a Vector3 array, "pre-checked", which skips buffer checks. @@ -468,7 +468,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The values to read/write - void SerializeValuePreChecked(ref Vector3[] value); + public void SerializeValuePreChecked(ref Vector3[] value); /// /// Serialize a Vector2Int, "pre-checked", which skips buffer checks. @@ -477,7 +477,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Vector2Int value); + public void SerializeValuePreChecked(ref Vector2Int value); /// /// Serialize a Vector2Int array, "pre-checked", which skips buffer checks. @@ -486,7 +486,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The values to read/write - void SerializeValuePreChecked(ref Vector2Int[] value); + public void SerializeValuePreChecked(ref Vector2Int[] value); /// /// Serialize a Vector3Int, "pre-checked", which skips buffer checks. @@ -495,7 +495,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Vector3Int value); + public void SerializeValuePreChecked(ref Vector3Int value); /// /// Serialize a Vector3Int array, "pre-checked", which skips buffer checks. @@ -504,7 +504,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Vector3Int[] value); + public void SerializeValuePreChecked(ref Vector3Int[] value); /// /// Serialize a Vector4, "pre-checked", which skips buffer checks. @@ -513,7 +513,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Vector4 value); + public void SerializeValuePreChecked(ref Vector4 value); /// /// Serialize a Vector4 array, "pre-checked", which skips buffer checks. @@ -522,7 +522,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Vector4[] value); + public void SerializeValuePreChecked(ref Vector4[] value); /// /// Serialize a Quaternion, "pre-checked", which skips buffer checks. @@ -531,7 +531,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Quaternion value); + public void SerializeValuePreChecked(ref Quaternion value); /// /// Serialize a Quaternion array, "pre-checked", which skips buffer checks. @@ -540,7 +540,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Quaternion[] value); + public void SerializeValuePreChecked(ref Quaternion[] value); /// /// Serialize a Pose, "pre-checked", which skips buffer checks. @@ -549,7 +549,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Pose value); + public void SerializeValuePreChecked(ref Pose value); /// /// Serialize a Pose array, "pre-checked", which skips buffer checks. @@ -558,7 +558,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Pose[] value); + public void SerializeValuePreChecked(ref Pose[] value); /// /// Serialize a Color, "pre-checked", which skips buffer checks. @@ -567,7 +567,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Color value); + public void SerializeValuePreChecked(ref Color value); /// /// Serialize a Color array, "pre-checked", which skips buffer checks. @@ -576,7 +576,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Color[] value); + public void SerializeValuePreChecked(ref Color[] value); /// /// Serialize a Color32, "pre-checked", which skips buffer checks. @@ -585,7 +585,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Color32 value); + public void SerializeValuePreChecked(ref Color32 value); /// /// Serialize a Color32 array, "pre-checked", which skips buffer checks. @@ -594,7 +594,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Color32[] value); + public void SerializeValuePreChecked(ref Color32[] value); /// /// Serialize a Ray, "pre-checked", which skips buffer checks. @@ -603,7 +603,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Ray value); + public void SerializeValuePreChecked(ref Ray value); /// /// Serialize a Ray array, "pre-checked", which skips buffer checks. @@ -612,7 +612,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Ray[] value); + public void SerializeValuePreChecked(ref Ray[] value); /// /// Serialize a Ray2D, "pre-checked", which skips buffer checks. @@ -621,7 +621,7 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Ray2D value); + public void SerializeValuePreChecked(ref Ray2D value); /// /// Serialize a Ray2D array, "pre-checked", which skips buffer checks. @@ -630,6 +630,6 @@ void SerializeValuePreChecked(ref T value, FastBufferWriter.ForFixedStrings u /// past the end of the buffer, which will cause memory corruption and undefined behavior. /// /// The value to read/write - void SerializeValuePreChecked(ref Ray2D[] value); + public void SerializeValuePreChecked(ref Ray2D[] value); } } diff --git a/com.unity.netcode.gameobjects/Runtime/Timing/IRealTimeProvider.cs b/com.unity.netcode.gameobjects/Runtime/Timing/IRealTimeProvider.cs index e6a32afa29..cd20e38a0b 100644 --- a/com.unity.netcode.gameobjects/Runtime/Timing/IRealTimeProvider.cs +++ b/com.unity.netcode.gameobjects/Runtime/Timing/IRealTimeProvider.cs @@ -2,10 +2,10 @@ namespace Unity.Netcode { internal interface IRealTimeProvider { - float RealTimeSinceStartup { get; } - float UnscaledTime { get; } - float UnscaledDeltaTime { get; } - float DeltaTime { get; } - float FixedDeltaTime { get; } + public float RealTimeSinceStartup { get; } + public float UnscaledTime { get; } + public float UnscaledDeltaTime { get; } + public float DeltaTime { get; } + public float FixedDeltaTime { get; } } } diff --git a/com.unity.netcode.gameobjects/Runtime/Transports/UTP/INetworkStreamDriverConstructor.cs b/com.unity.netcode.gameobjects/Runtime/Transports/UTP/INetworkStreamDriverConstructor.cs index 93203fec03..3b780035eb 100644 --- a/com.unity.netcode.gameobjects/Runtime/Transports/UTP/INetworkStreamDriverConstructor.cs +++ b/com.unity.netcode.gameobjects/Runtime/Transports/UTP/INetworkStreamDriverConstructor.cs @@ -69,7 +69,7 @@ public interface INetworkStreamDriverConstructor /// all of its traffic is delivered, and in the correct order too. There is no need for that /// pipeline to support fragmentation ( will handle that). /// - void CreateDriver( + public void CreateDriver( UnityTransport transport, out NetworkDriver driver, out NetworkPipeline unreliableFragmentedPipeline, diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/ConditionalPredicate.cs b/com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/ConditionalPredicate.cs index 097674d21a..e7d2c98c44 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/ConditionalPredicate.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/ConditionalPredicate.cs @@ -63,19 +63,19 @@ public interface IConditionalPredicate /// Test the conditions of the test to be reached /// /// or - bool HasConditionBeenReached(); + public bool HasConditionBeenReached(); /// /// Wait for condition has started /// - void Started(); + public void Started(); /// /// Wait for condition has finished:
/// Condition(s) met or timed out ///
/// or - void Finished(bool timedOut); + public void Finished(bool timedOut); } } diff --git a/testproject/Assets/Scripts/MenuManagement/SceneReference.cs b/testproject/Assets/Scripts/MenuManagement/SceneReference.cs index 7fed48716f..85e466d34a 100644 --- a/testproject/Assets/Scripts/MenuManagement/SceneReference.cs +++ b/testproject/Assets/Scripts/MenuManagement/SceneReference.cs @@ -64,6 +64,6 @@ public List GetReferencedScenes() public interface ISceneReference { - string GetDisplayName(); - List GetReferencedScenes(); + public string GetDisplayName(); + public List GetReferencedScenes(); } diff --git a/testproject/Assets/Tests/Manual/Scripts/IPlayerMovement.cs b/testproject/Assets/Tests/Manual/Scripts/IPlayerMovement.cs index 7c7b6499f9..4385b82fde 100644 --- a/testproject/Assets/Tests/Manual/Scripts/IPlayerMovement.cs +++ b/testproject/Assets/Tests/Manual/Scripts/IPlayerMovement.cs @@ -2,6 +2,6 @@ namespace TestProject.ManualTests { public interface IPlayerMovement { - void Move(int speed); + public void Move(int speed); } } From c85a3cc9c51668a7eaacfbf82b324656492cf687 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Fri, 23 Jan 2026 17:14:54 +0100 Subject: [PATCH 7/8] more fixes --- .yamato/project-standards.yml | 1 + .../Messaging/RpcTargets/AuthorityRpcTarget.cs | 15 ++++----------- .../Messaging/RpcTargets/NotMeRpcTarget.cs | 7 ++----- .../Messaging/RpcTargets/NotOwnerRpcTarget.cs | 7 ++----- .../Messaging/RpcTargets/NotServerRpcTarget.cs | 7 ++----- .../Messaging/RpcTargets/OwnerRpcTarget.cs | 7 ++----- .../Messaging/RpcTargets/ServerRpcTarget.cs | 15 ++++----------- .../Tests/Editor/Messaging/MessageSendingTests.cs | 7 ++----- 8 files changed, 19 insertions(+), 47 deletions(-) diff --git a/.yamato/project-standards.yml b/.yamato/project-standards.yml index 246ab6f905..916b5c359b 100644 --- a/.yamato/project-standards.yml +++ b/.yamato/project-standards.yml @@ -48,6 +48,7 @@ standards_{{ platform.name }}_{{ project.name }}_{{ editor }}: - unity-downloader-cli --fast --wait -u {{ editor }} -c editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloads basic editor - .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit # This command is used to invoke Unity in a "headless" mode. It's used to sync the project - dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix # Auto-fix formatting issues + - git checkout -- {{ project.path }}/Packages/manifest.json {{ project.path }}/Packages/packages-lock.json 2>/dev/null || true # Restore package files that Unity may have modified (we only want to check code formatting) - 'git diff --exit-code || (echo "ERROR: Code formatting issues found. Run dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix locally and commit the changes." && exit 1)' # Fail if formatter made any changes {% endfor -%} {% endfor -%} diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/AuthorityRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/AuthorityRpcTarget.cs index 30d22d4fcf..a3600851e2 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/AuthorityRpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/AuthorityRpcTarget.cs @@ -7,17 +7,10 @@ internal class AuthorityRpcTarget : ServerRpcTarget public override void Dispose() { - if (m_AuthorityTarget != null) - { - m_AuthorityTarget.Dispose(); - m_AuthorityTarget = null; - } - - if (m_DirectSendTarget != null) - { - m_DirectSendTarget.Dispose(); - m_DirectSendTarget = null; - } + m_AuthorityTarget?.Dispose(); + m_AuthorityTarget = null; + m_DirectSendTarget?.Dispose(); + m_DirectSendTarget = null; base.Dispose(); } diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotMeRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotMeRpcTarget.cs index 6148d3fa8f..f0e476cd76 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotMeRpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotMeRpcTarget.cs @@ -8,11 +8,8 @@ internal class NotMeRpcTarget : BaseRpcTarget public override void Dispose() { m_ServerRpcTarget.Dispose(); - if (m_GroupSendTarget != null) - { - m_GroupSendTarget.Target.Dispose(); - m_GroupSendTarget = null; - } + m_GroupSendTarget?.Target.Dispose(); + m_GroupSendTarget = null; } internal override void Send(NetworkBehaviour behaviour, ref RpcMessage message, NetworkDelivery delivery, RpcParams rpcParams) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotOwnerRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotOwnerRpcTarget.cs index 7dbb13f1a2..e9b535837c 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotOwnerRpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotOwnerRpcTarget.cs @@ -12,11 +12,8 @@ public override void Dispose() m_ServerRpcTarget.Dispose(); m_LocalSendRpcTarget.Dispose(); m_NotAuthorityRpcTarget.Dispose(); - if (m_GroupSendTarget != null) - { - m_GroupSendTarget.Target.Dispose(); - m_GroupSendTarget = null; - } + m_GroupSendTarget?.Target.Dispose(); + m_GroupSendTarget = null; } internal override void Send(NetworkBehaviour behaviour, ref RpcMessage message, NetworkDelivery delivery, RpcParams rpcParams) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotServerRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotServerRpcTarget.cs index 72a0f4b434..21be77ee31 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotServerRpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/NotServerRpcTarget.cs @@ -8,11 +8,8 @@ internal class NotServerRpcTarget : BaseRpcTarget public override void Dispose() { m_LocalSendRpcTarget.Dispose(); - if (m_GroupSendTarget != null) - { - m_GroupSendTarget.Target.Dispose(); - m_GroupSendTarget = null; - } + m_GroupSendTarget?.Target.Dispose(); + m_GroupSendTarget = null; } internal override void Send(NetworkBehaviour behaviour, ref RpcMessage message, NetworkDelivery delivery, RpcParams rpcParams) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/OwnerRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/OwnerRpcTarget.cs index e22c588ef3..3090eac585 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/OwnerRpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/OwnerRpcTarget.cs @@ -12,11 +12,8 @@ public override void Dispose() m_AuthorityRpcTarget.Dispose(); m_ServerRpcTarget.Dispose(); m_LocalRpcTarget.Dispose(); - if (m_UnderlyingTarget != null) - { - m_UnderlyingTarget.Target.Dispose(); - m_UnderlyingTarget = null; - } + m_UnderlyingTarget?.Target.Dispose(); + m_UnderlyingTarget = null; } internal override void Send(NetworkBehaviour behaviour, ref RpcMessage message, NetworkDelivery delivery, RpcParams rpcParams) diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/ServerRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/ServerRpcTarget.cs index 1b40931a5b..63380ce40c 100644 --- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/ServerRpcTarget.cs +++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/ServerRpcTarget.cs @@ -8,17 +8,10 @@ internal class ServerRpcTarget : BaseRpcTarget public override void Dispose() { - if (m_UnderlyingTarget != null) - { - m_UnderlyingTarget.Dispose(); - m_UnderlyingTarget = null; - } - - if (m_ProxyRpcTarget != null) - { - m_ProxyRpcTarget.Dispose(); - m_ProxyRpcTarget = null; - } + m_UnderlyingTarget?.Dispose(); + m_UnderlyingTarget = null; + m_ProxyRpcTarget?.Dispose(); + m_ProxyRpcTarget = null; } internal override void Send(NetworkBehaviour behaviour, ref RpcMessage message, NetworkDelivery delivery, RpcParams rpcParams) diff --git a/com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageSendingTests.cs b/com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageSendingTests.cs index 84967b7ee4..ae2a1e955e 100644 --- a/com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageSendingTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageSendingTests.cs @@ -333,11 +333,8 @@ private class TestNoHandlerMessageProvider : INetworkMessageProvider public void WhenReceivingAMessageWithoutAHandler_ExceptionIsLogged() { // If a NetworkMessageManager already exists then dispose of it before creating a new NetworkMessageManager (otherwise memory leak) - if (m_MessageManager != null) - { - m_MessageManager.Dispose(); - m_MessageManager = null; - } + m_MessageManager?.Dispose(); + m_MessageManager = null; // Since m_MessageManager is disposed during teardown we don't need to worry about that here. m_MessageManager = new NetworkMessageManager(new NopMessageSender(), this, new TestNoHandlerMessageProvider()); From ce9e6e5f2d017947ac0aecbf7d9f366e9c91b1e2 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Fri, 23 Jan 2026 17:23:48 +0100 Subject: [PATCH 8/8] exempted file --- .yamato/project-standards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/project-standards.yml b/.yamato/project-standards.yml index 916b5c359b..24380a152e 100644 --- a/.yamato/project-standards.yml +++ b/.yamato/project-standards.yml @@ -48,7 +48,7 @@ standards_{{ platform.name }}_{{ project.name }}_{{ editor }}: - unity-downloader-cli --fast --wait -u {{ editor }} -c editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloads basic editor - .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit # This command is used to invoke Unity in a "headless" mode. It's used to sync the project - dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix # Auto-fix formatting issues - - git checkout -- {{ project.path }}/Packages/manifest.json {{ project.path }}/Packages/packages-lock.json 2>/dev/null || true # Restore package files that Unity may have modified (we only want to check code formatting) + - git checkout -- {{ project.path }}/Packages/manifest.json {{ project.path }}/Packages/packages-lock.json {{ project.path }}/ProjectSettings/ProjectVersion.txt 2>/dev/null || true # Restore files that Unity may have modified (we only want to check code formatting) - 'git diff --exit-code || (echo "ERROR: Code formatting issues found. Run dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix locally and commit the changes." && exit 1)' # Fail if formatter made any changes {% endfor -%} {% endfor -%}