From 293f93a41ca3eb2a83bc780a45cbfb0738848b75 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 17 Feb 2025 12:32:55 +0100 Subject: [PATCH 01/12] Example correction --- .../Tests/Runtime/Timing/NetworkTimeSystemTests.cs | 2 +- pvpExceptions.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs index 2e6279999c..992dbb2293 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs @@ -28,7 +28,7 @@ public void Setup() /// /// Tests whether time is accessible and has correct values inside Update/FixedUpdate. - /// This test applies only when is 1. + /// This test applies only when is 1. /// /// An IEnumerator for the UnityTest coroutine that validates time values in the player loop. [UnityTest] diff --git a/pvpExceptions.json b/pvpExceptions.json index bab6a87515..4d81d6b6ca 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -59,8 +59,7 @@ "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'", - "Unity.Netcode.RuntimeTests.NetworkTimeSystemTests: IEnumerator PlayerLoopFixedTimeTest(): XML is not well-formed: End tag 'summary' does not match the start tag 'see'" + "Unity.Netcode.RuntimeTests.NetworkVariableBaseInitializesWhenPersisted.PrefabInstanceHandler: bool ValidateInstanceSpawnCount(int): XML is not well-formed: Expected an end tag for element 'summary'" ] }, "PVP-151-1": { From 6fa7a43ed1e9f66ff80d30bbd237225117e236b0 Mon Sep 17 00:00:00 2001 From: Emma Date: Tue, 25 Feb 2025 17:27:16 -0500 Subject: [PATCH 02/12] Fix all pvp exceptions in NetworkTransform and NetworkBehaviour --- .../Components/NetworkTransform.cs | 65 ++++++++++++------- .../Runtime/Core/NetworkBehaviour.cs | 32 +++++---- pvpExceptions.json | 28 -------- 3 files changed, 60 insertions(+), 65 deletions(-) diff --git a/com.unity.netcode.gameobjects/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Components/NetworkTransform.cs index 13f17e99e5..77a7f4293e 100644 --- a/com.unity.netcode.gameobjects/Components/NetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Components/NetworkTransform.cs @@ -66,7 +66,7 @@ public class NetworkTransform : NetworkBehaviour /// - The teleporting state update. /// - When using half float precision and the `NetworkDeltaPosition` delta exceeds the maximum delta forcing the axis in /// question to be collapsed into the core base position, this state update will be sent as reliable fragmented sequenced. - /// + /// /// In order to preserve a continual consistency of axial values when unreliable delta messaging is enabled (due to the /// possibility of dropping packets), NetworkTransform instances will send 1 axial frame synchronization update per /// second (only for the axis marked to synchronize are sent as reliable fragmented sequenced) as long as a delta state @@ -104,7 +104,7 @@ public struct NetworkTransformState : INetworkSerializable private const int k_ReliableSequenced = 0x00080000; private const int k_UseUnreliableDeltas = 0x00100000; private const int k_UnreliableFrameSync = 0x00200000; - private const int k_TrackStateId = 0x10000000; // (Internal Debugging) When set each state update will contain a state identifier + private const int k_TrackStateId = 0x10000000; // (Internal Debugging) When set each state update will contain a state identifier // Stores persistent and state relative flags private uint m_Bitset; @@ -459,10 +459,11 @@ internal set } /// - /// Returns whether this state update was a frame synchronization when - /// UseUnreliableDeltas is enabled. When set, the entire transform will + /// Returns whether this state update was a frame synchronization when + /// UseUnreliableDeltas is enabled. When set, the entire transform will /// be or has been synchronized. /// + /// if this state update was a frame synchronization; otherwise, . public bool IsUnreliableFrameSync() { return UnreliableFrameSync; @@ -475,6 +476,7 @@ public bool IsUnreliableFrameSync() /// /// Unreliable delivery will only be used if is set. /// + /// if this state was sent with reliable delivery; otherwise, . public bool IsReliableStateUpdate() { return ReliableSequenced; @@ -586,7 +588,7 @@ public Quaternion GetRotation() /// /// When there is no change in an updated state's position then there are no values to return. /// Checking for is one way to detect this. - /// When used with half precision it returns the half precision delta position state update + /// When used with half precision it returns the half precision delta position state update /// which will not be the full position. /// To get a NettworkTransform's full position, use and /// pass true as the parameter. @@ -661,6 +663,8 @@ public int GetNetworkTick() /// /// Serializes this /// + /// The type of the serializer. + /// The serializer used for reading or writing the state. public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { // Used to calculate the LastSerializedSize value @@ -897,7 +901,7 @@ public void NetworkSerialize(BufferSerializer serializer) where T : IReade if (HasScaleChange) { // If we are teleporting (which includes synchronizing) and the associated NetworkObject has a parent - // then we want to serialize the LossyScale since NetworkObject spawn order is not guaranteed + // then we want to serialize the LossyScale since NetworkObject spawn order is not guaranteed if (IsTeleportingNextFrame && IsParented) { serializer.SerializeValue(ref LossyScale); @@ -1419,9 +1423,8 @@ private bool ShouldSynchronizeHalfFloat(ulong targetClientId) /// /// If a derived class overrides this, then make sure to invoke this base method! /// - /// - /// - /// the clientId being synchronized (both reading and writing) + /// The type of the serializer. + /// The serializer used for reading or writing the state. protected override void OnSynchronize(ref BufferSerializer serializer) { m_CachedNetworkManager = NetworkManager; @@ -1575,11 +1578,11 @@ private void TryCommitTransform(ref Transform transformToCommit, bool synchroniz Debug.LogException(ex); } - // The below is part of assuring we only send a frame synch, when sending unreliable deltas, if + // The below is part of assuring we only send a frame synch, when sending unreliable deltas, if // we have already sent at least one unreliable delta state update. At this point in the callstack, // a delta state update has just been sent in the above UpdateTransformState() call and as long as // we didn't send a frame synch and we are not synchronizing then we know at least one unreliable - // delta has been sent. Under this scenario, we should start checking for this instance's alloted + // delta has been sent. Under this scenario, we should start checking for this instance's alloted // frame synch "tick slot". Once we send a frame synch, if no other deltas occur after that // (i.e. the object is at rest) then we will stop sending frame synch's until the object begins // moving, rotating, or scaling again. @@ -1862,7 +1865,7 @@ private bool ApplyTransformToNetworkStateWithInfo(ref NetworkTransformState netw networkState.NetworkDeltaPosition = m_HalfPositionState; - // If ownership offset is greater or we are doing an axial synchronization then synchronize the base position + // If ownership offset is greater or we are doing an axial synchronization then synchronize the base position if ((m_HalfFloatTargetTickOwnership > m_CachedNetworkManager.ServerTime.Tick || isAxisSync) && !networkState.IsTeleportingNextFrame) { networkState.SynchronizeBaseHalfFloat = true; @@ -2056,6 +2059,10 @@ private bool ApplyTransformToNetworkStateWithInfo(ref NetworkTransformState netw return isDirty; } + /// + /// Invoked whenever the transform has been updated. + /// This method can be overridden to handle any custom logic that needs to occur after the transform has been updated. + /// protected virtual void OnTransformUpdated() { @@ -2602,6 +2609,10 @@ protected virtual void OnNetworkTransformStateUpdated(ref NetworkTransformState } + /// + /// Invoked just before the transform state is updated. + /// This method can be overridden to handle any custom logic that needs to occur before the transform state is updated. + /// protected virtual void OnBeforeUpdateTransformState() { @@ -2816,6 +2827,12 @@ public override void OnGainedOwnership() base.OnGainedOwnership(); } + /// + /// Invoked when the ownership of the changes. + /// This method handles reinitialization when the local client gains or loses ownership of the . + /// + /// The client ID of the previous owner. + /// The client ID of the new owner. protected override void OnOwnershipChanged(ulong previous, ulong current) { // If we were the previous owner or the newly assigned owner then reinitialize @@ -2842,7 +2859,7 @@ protected virtual void OnInitialize(ref NetworkTransformState replicatedState) /// This method is only invoked by the owner /// Use: OnInitialize(ref NetworkTransformState replicatedState) to be notified on all instances /// - /// + /// The current after initializing. protected virtual void OnInitialize(ref NetworkVariable replicatedState) { @@ -2851,9 +2868,9 @@ protected virtual void OnInitialize(ref NetworkVariable r private int m_HalfFloatTargetTickOwnership; /// - /// The internal initialzation method to allow for internal API adjustments + /// The internal initialization method to allow for internal API adjustments /// - /// + /// Indicates whether the initialization is due to an ownership change. private void InternalInitialization(bool isOwnershipChange = false) { if (!IsSpawned) @@ -2956,11 +2973,11 @@ public override void OnNetworkObjectParentChanged(NetworkObject parentNetworkObj /// The parameters are broken up into pos / rot / scale on purpose so that the caller can perturb /// just the desired one(s) /// - /// new position to move to. Can be null - /// new rotation to rotate to. Can be null + /// new position to move to. Can be null. + /// new rotation to rotate to. Can be null. /// new scale to scale to. Can be null /// When true (the default) the will not be teleported and, if enabled, will interpolate. When false the will teleport/apply the parameters provided immediately. - /// + /// Thrown when the function is called on non-spawned object or, when it's called without proper authority public void SetState(Vector3? posIn = null, Quaternion? rotIn = null, Vector3? scaleIn = null, bool teleportDisabled = true) { if (!IsSpawned) @@ -3023,7 +3040,7 @@ private void SetStateInternal(Vector3 pos, Quaternion rot, Vector3 scale, bool s var transformToCommit = transform; - // Explicit set states are cumulative during a fractional tick period of time (i.e. each SetState invocation will + // Explicit set states are cumulative during a fractional tick period of time (i.e. each SetState invocation will // update the axial deltas to whatever changes are applied). As such, we need to preserve the dirty and explicit // state flags. var stateWasDirty = m_LocalAuthoritativeNetworkState.IsDirty; @@ -3111,7 +3128,9 @@ private void UpdateInterpolation() } } - /// + /// + /// This method is called once per frame. + /// /// /// If you override this method, be sure that: /// - Non-authority always invokes this base class method. @@ -3134,10 +3153,10 @@ protected virtual void Update() /// /// Teleport the transform to the given values without interpolating /// - /// new position to move to. - /// new rotation to rotate to. + /// new position to move to. + /// new rotation to rotate to. /// new scale to scale to. - /// + /// Thrown if teleporting is attempted on a non-authoritative side. public void Teleport(Vector3 newPosition, Quaternion newRotation, Vector3 newScale) { if (!CanCommitToTransform) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs index 2754fdf8c0..ba8e981795 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs @@ -492,15 +492,15 @@ internal bool IsBehaviourEditable() m_NetworkObject.NetworkManager.IsServer; } - /// TODO: this needs an overhaul. It's expensive, it's ja little naive in how it looks for networkObject in - /// its parent and worst, it creates a puzzle if you are a NetworkBehaviour wanting to see if you're live or not - /// (e.g. editor code). All you want to do is find out if NetworkManager is null, but to do that you - /// need NetworkObject, but if you try and grab NetworkObject and NetworkManager isn't up you'll get - /// the warning below. This is why IsBehaviourEditable had to be created. Matt was going to re-do - /// how NetworkObject works but it was close to the release and too risky to change /// /// Gets the NetworkObject that owns this NetworkBehaviour instance /// + // TODO: this needs an overhaul. It's expensive, it's ja little naive in how it looks for networkObject in + // its parent and worst, it creates a puzzle if you are a NetworkBehaviour wanting to see if you're live or not + // (e.g. editor code). All you want to do is find out if NetworkManager is null, but to do that you + // need NetworkObject, but if you try and grab NetworkObject and NetworkManager isn't up you'll get + // the warning below. This is why IsBehaviourEditable had to be created. Matt was going to re-do + // how NetworkObject works but it was close to the release and too risky to change public NetworkObject NetworkObject { get @@ -620,11 +620,11 @@ internal void UpdateNetworkProperties() /// A reference to is passed in as a parameter to determine the context of execution (IsServer/IsClient) /// /// - /// a ref to the since this is not yet set on the /// The will not have anything assigned to it at this point in time. /// Settings like ownership, NetworkBehaviourId, NetworkManager, and most other spawn related properties will not be set. /// This can be used to handle things like initializing/instantiating a NetworkVariable or the like. /// + /// a ref to the since this is not yet set on the protected virtual void OnNetworkPreSpawn(ref NetworkManager networkManager) { } /// @@ -654,11 +654,11 @@ protected virtual void OnNetworkPostSpawn() { } protected virtual void OnNetworkSessionSynchronized() { } /// - /// [Client & Server Side] + /// [Client and Server Side] /// When a scene is loaded an in-scene placed NetworkObjects are all spawned, this method is invoked on all of the newly spawned in-scene placed NetworkObjects. /// /// - /// This can be used to handle post scene loaded actions for in-scene placed NetworkObjcts where you might need to access a different NetworkObject and/or NetworkBehaviour not local to the current NetworkObject context. + /// This can be used to handle post scene loaded actions for in-scene placed NetworkObjects where you might need to access a different NetworkObject and/or NetworkBehaviour not local to the current NetworkObject context. /// protected virtual void OnInSceneObjectsSpawned() { } @@ -772,7 +772,7 @@ public virtual void OnGainedOwnership() { } internal void InternalOnGainedOwnership() { UpdateNetworkProperties(); - // New owners need to assure any NetworkVariables they have write permissions + // New owners need to assure any NetworkVariables they have write permissions // to are updated so the previous and original values are aligned with the // current value (primarily for collections). if (OwnerClientId == NetworkManager.LocalClientId) @@ -1220,10 +1220,10 @@ internal void SetNetworkVariableData(FastBufferReader reader, ulong clientId) } /// - /// Gets the local instance of a object with a given NetworkId + /// Gets the local instance of a with a given NetworkId. /// - /// - /// + /// The NetworkId of the to retrieve. + /// Returns the with the specified NetworkId, or null if not found. protected NetworkObject GetNetworkObject(ulong networkId) { return NetworkManager.SpawnManager.SpawnedObjects.TryGetValue(networkId, out NetworkObject networkObject) ? networkObject : null; @@ -1246,12 +1246,16 @@ protected NetworkObject GetNetworkObject(ulong networkId) /// Either BufferSerializerReader or BufferSerializerWriter, depending whether the serializer /// is in read mode or write mode. /// - /// the relative client identifier being synchronized protected virtual void OnSynchronize(ref BufferSerializer serializer) where T : IReaderWriter { } + /// + /// Invoked when the network anticipates a change in the state of the object. + /// This method can be used to handle any logic that needs to occur when the network predicts a state change. + /// + /// The last round trip time in seconds. public virtual void OnReanticipate(double lastRoundTripTime) { diff --git a/pvpExceptions.json b/pvpExceptions.json index 1bbacb0a04..fdcc6d2290 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -7,23 +7,6 @@ }, "PVP-150-1": { "errors": [ - "Unity.Netcode.Components.NetworkTransform: void OnSynchronize(ref BufferSerializer): empty tag", - "Unity.Netcode.Components.NetworkTransform: void OnSynchronize(ref BufferSerializer): empty tag", - "Unity.Netcode.Components.NetworkTransform: void OnSynchronize(ref BufferSerializer): unexpected ", - "Unity.Netcode.Components.NetworkTransform: void OnInitialize(ref NetworkVariable): empty tag", - "Unity.Netcode.Components.NetworkTransform: void SetState(Vector3?, Quaternion?, Vector3?, bool): empty tag", - "Unity.Netcode.Components.NetworkTransform: void SetState(Vector3?, Quaternion?, Vector3?, bool): empty tag", - "Unity.Netcode.Components.NetworkTransform: void SetState(Vector3?, Quaternion?, Vector3?, bool): text or XML content outside a top-level tag", - "Unity.Netcode.Components.NetworkTransform: void Update(): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.Components.NetworkTransform: void Teleport(Vector3, Quaternion, Vector3): empty tag", - "Unity.Netcode.Components.NetworkTransform: void Teleport(Vector3, Quaternion, Vector3): empty tag", - "Unity.Netcode.Components.NetworkTransform: void Teleport(Vector3, Quaternion, Vector3): text or XML content outside a top-level tag", - "Unity.Netcode.NetworkBehaviour: NetworkObject: text or XML content outside a top-level tag", - "Unity.Netcode.NetworkBehaviour: void OnNetworkPreSpawn(ref NetworkManager): in block context (only allowed in top-level context)", - "Unity.Netcode.NetworkBehaviour: void OnInSceneObjectsSpawned(): XML is not well-formed: Whitespace is not allowed at this location", - "Unity.Netcode.NetworkBehaviour: NetworkObject GetNetworkObject(ulong): empty tag", - "Unity.Netcode.NetworkBehaviour: NetworkObject GetNetworkObject(ulong): empty tag", - "Unity.Netcode.NetworkBehaviour: void OnSynchronize(ref BufferSerializer): unexpected ", "Unity.Netcode.NetworkList: .ctor(IEnumerable, NetworkVariableReadPermission, NetworkVariableWritePermission): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", "Unity.Netcode.NetworkList: .ctor(IEnumerable, NetworkVariableReadPermission, NetworkVariableWritePermission): empty tag", "Unity.Netcode.NetworkList: IEnumerator GetEnumerator(): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", @@ -86,14 +69,6 @@ "Unity.Netcode.Components.NetworkDeltaPosition: void NetworkSerialize(BufferSerializer): missing ", "Unity.Netcode.Components.NetworkDeltaPosition: Vector3 GetConvertedDelta(): missing ", "Unity.Netcode.Components.NetworkDeltaPosition: Vector3 GetDeltaPosition(): missing ", - "Unity.Netcode.Components.NetworkTransform: void OnTransformUpdated(): undocumented", - "Unity.Netcode.Components.NetworkTransform: void OnBeforeUpdateTransformState(): undocumented", - "Unity.Netcode.Components.NetworkTransform: void OnOwnershipChanged(ulong, ulong): undocumented", - "Unity.Netcode.Components.NetworkTransform: void Update(): missing ", - "Unity.Netcode.Components.NetworkTransform.NetworkTransformState: bool IsUnreliableFrameSync(): missing ", - "Unity.Netcode.Components.NetworkTransform.NetworkTransformState: bool IsReliableStateUpdate(): missing ", - "Unity.Netcode.Components.NetworkTransform.NetworkTransformState: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.NetworkTransform.NetworkTransformState: void NetworkSerialize(BufferSerializer): missing ", "Unity.Netcode.Editor.AnticipatedNetworkTransformEditor: HideInterpolateValue: undocumented", "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: undocumented", "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: NetworkPrefabsPath: undocumented", @@ -120,9 +95,6 @@ "Unity.Netcode.ConnectionEventData: EventType: undocumented", "Unity.Netcode.RpcException: undocumented", "Unity.Netcode.RpcException: .ctor(string): undocumented", - "Unity.Netcode.NetworkBehaviour: void OnNetworkPreSpawn(ref NetworkManager): missing ", - "Unity.Netcode.NetworkBehaviour: void OnInSceneObjectsSpawned(): XML is not well-formed: Whitespace is not allowed at this location", - "Unity.Netcode.NetworkBehaviour: void OnReanticipate(double): undocumented", "Unity.Netcode.NetworkManager: void NetworkUpdate(NetworkUpdateStage): undocumented", "Unity.Netcode.NetworkManager.ReanticipateDelegate: undocumented", "Unity.Netcode.NetworkObject: NetworkBehaviour GetNetworkBehaviourAtOrderIndex(ushort): undocumented", From 69be216c54ba5e8bf3abcc93d85320279df3fe23 Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 27 Feb 2025 18:06:04 -0500 Subject: [PATCH 03/12] Update NetworkList --- .../Collections/NetworkList.cs | 118 ++++++++++++------ pvpExceptions.json | 35 ------ 2 files changed, 81 insertions(+), 72 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs index 35c38c88a6..5ee8ad3247 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs @@ -26,14 +26,14 @@ public class NetworkList : NetworkVariableBase where T : unmanaged, IEquatabl public event OnListChangedDelegate OnListChanged; /// - /// Constructor method for + /// Creates a /// public NetworkList() { } - /// - /// - /// - /// + /// + /// An optional collection of initial values to populate the list. If null, the list will start empty. + /// The read permission level for the network list. Determines who can read the list (e.g., server-only or everyone). Default is defined by DefaultReadPerm + /// The write permission level for the network list. Determines who can modify the list (e.g., server-only or specific clients). Default is defined by DefaultWritePerm. public NetworkList(IEnumerable values = default, NetworkVariableReadPermission readPerm = DefaultReadPerm, NetworkVariableWritePermission writePerm = DefaultWritePerm) @@ -54,7 +54,7 @@ public NetworkList(IEnumerable values = default, Dispose(); } - /// + /// public override void ResetDirty() { base.ResetDirty(); @@ -64,7 +64,7 @@ public override void ResetDirty() } } - /// + /// public override bool IsDirty() { // we call the base class to allow the SetDirty() mechanism to work @@ -76,7 +76,7 @@ internal void MarkNetworkObjectDirty() MarkNetworkBehaviourDirty(); } - /// + /// public override void WriteDelta(FastBufferWriter writer) { @@ -132,7 +132,7 @@ public override void WriteDelta(FastBufferWriter writer) } } - /// + /// public override void WriteField(FastBufferWriter writer) { writer.WriteValueSafe((ushort)m_List.Length); @@ -142,7 +142,7 @@ public override void WriteField(FastBufferWriter writer) } } - /// + /// public override void ReadField(FastBufferReader reader) { m_List.Clear(); @@ -155,15 +155,15 @@ public override void ReadField(FastBufferReader reader) } } - /// + /// public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta) { - /// This is only invoked by and the only time - /// keepDirtyDelta is set is when it is the server processing. To be able to handle previous - /// versions, we use IsServer to keep the dirty states received and the keepDirtyDelta to - /// actually mark this as dirty and add it to the list of s to - /// be updated. With the forwarding of deltas being handled by , - /// once all clients have been forwarded the dirty events, we clear them by invoking . + // This is only invoked by and the only time + // keepDirtyDelta is set is when it is the server processing. To be able to handle previous + // versions, we use IsServer to keep the dirty states received and the keepDirtyDelta to + // actually mark this as dirty and add it to the list of s to + // be updated. With the forwarding of deltas being handled by , + // once all clients have been forwarded the dirty events, we clear them by invoking . var isServer = m_NetworkManager.IsServer; reader.ReadValueSafe(out ushort deltaCount); for (int i = 0; i < deltaCount; i++) @@ -394,7 +394,7 @@ public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta) } } - /// + /// /// /// For NetworkList, we just need to reset dirty if a server has read deltas /// @@ -406,13 +406,22 @@ internal override void PostDeltaRead() } } - /// + /// + /// Returns an enumerator that iterates through the . + /// + /// An enumerator for the . public IEnumerator GetEnumerator() { return m_List.GetEnumerator(); } - /// + /// + /// Adds an item to the end of the . + /// + /// The item to be added to the list. + /// + /// This method checks for write permissions before adding the item. + /// public void Add(T item) { // check write permissions @@ -434,7 +443,12 @@ public void Add(T item) HandleAddListEvent(listEvent); } - /// + /// + /// Removes all items from the . + /// + /// + /// This method checks for write permissions before clearing the list. + /// public void Clear() { // check write permissions @@ -454,14 +468,25 @@ public void Clear() HandleAddListEvent(listEvent); } - /// + /// + /// Determines whether the contains a specific value. + /// + /// The object to locate in the . + /// if the is found in the ; otherwise, . public bool Contains(T item) { int index = m_List.IndexOf(item); return index != -1; } - /// + /// + /// Removes the first occurrence of a specific object from the . + /// + /// + /// This method checks for write permissions before removing the item. + /// + /// The object to remove from the list. + /// if the item was successfully removed from the list; otherwise, . public bool Remove(T item) { // check write permissions @@ -488,16 +513,29 @@ public bool Remove(T item) return true; } - /// + /// + /// Gets the number of elements contained in the . + /// public int Count => m_List.Length; - /// + /// + /// Determines the index of a specific in the . + /// + /// The object to remove from the list. + /// The index of the if found in the list; otherwise, -1. public int IndexOf(T item) { return m_List.IndexOf(item); } - /// + /// + /// Inserts to the at the specified . + /// + /// + /// This method checks for write permissions before inserting the item. + /// + /// The index at which the item should be inserted. + /// The item to insert. public void Insert(int index, T item) { // check write permissions @@ -527,7 +565,13 @@ public void Insert(int index, T item) HandleAddListEvent(listEvent); } - /// + /// + /// Removes the item at the specified index. + /// + /// + /// This method checks for write permissions before removing the item. + /// + /// The index of the element to remove. public void RemoveAt(int index) { // check write permissions @@ -550,7 +594,14 @@ public void RemoveAt(int index) HandleAddListEvent(listEvent); } - /// + /// + /// Gets or sets the element at the specified index in the . + /// + /// + /// This method checks for write permissions before setting the value. + /// + /// The zero-based index of the element to get or set. + /// The element at the specified index. public T this[int index] { get => m_List[index]; @@ -586,16 +637,9 @@ private void HandleAddListEvent(NetworkListEvent listEvent) } /// - /// This is actually unused left-over from a previous interface + /// This method should not be used. It is left over from a previous interface. /// - public int LastModifiedTick - { - get - { - // todo: implement proper network tick for NetworkList - return NetworkTickSystem.NoTick; - } - } + public int LastModifiedTick => NetworkTickSystem.NoTick; /// /// Overridden implementation. diff --git a/pvpExceptions.json b/pvpExceptions.json index fdcc6d2290..ed09b41afc 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -7,18 +7,6 @@ }, "PVP-150-1": { "errors": [ - "Unity.Netcode.NetworkList: .ctor(IEnumerable, NetworkVariableReadPermission, NetworkVariableWritePermission): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: .ctor(IEnumerable, NetworkVariableReadPermission, NetworkVariableWritePermission): empty tag", - "Unity.Netcode.NetworkList: IEnumerator GetEnumerator(): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: void Add(T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: void Clear(): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: bool Contains(T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: bool Remove(T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: Count: cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: int IndexOf(T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: void Insert(int, T): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: void RemoveAt(int): cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", - "Unity.Netcode.NetworkList: this[int]: cannot auto-inheritdoc (not an override or interface implementation); must specify 'cref'", "Unity.Netcode.UserNetworkVariableSerialization: empty tag", "Unity.Netcode.UserNetworkVariableSerialization.DuplicateValueDelegate: unexpected ", "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedByMemcpy(): empty tag", @@ -148,30 +136,7 @@ "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", "Unity.Netcode.AnticipatedNetworkVariable.SmoothDelegate: missing ", - "Unity.Netcode.NetworkList: .ctor(IEnumerable, NetworkVariableReadPermission, NetworkVariableWritePermission): missing ", "Unity.Netcode.NetworkList: void Finalize(): undocumented", - "Unity.Netcode.NetworkList: IEnumerator GetEnumerator(): missing ", - "Unity.Netcode.NetworkList: IEnumerator GetEnumerator(): missing ", - "Unity.Netcode.NetworkList: void Add(T): missing ", - "Unity.Netcode.NetworkList: void Add(T): missing ", - "Unity.Netcode.NetworkList: void Clear(): missing ", - "Unity.Netcode.NetworkList: bool Contains(T): missing ", - "Unity.Netcode.NetworkList: bool Contains(T): missing ", - "Unity.Netcode.NetworkList: bool Contains(T): missing ", - "Unity.Netcode.NetworkList: bool Remove(T): missing ", - "Unity.Netcode.NetworkList: bool Remove(T): missing ", - "Unity.Netcode.NetworkList: bool Remove(T): missing ", - "Unity.Netcode.NetworkList: Count: missing ", - "Unity.Netcode.NetworkList: int IndexOf(T): missing ", - "Unity.Netcode.NetworkList: int IndexOf(T): missing ", - "Unity.Netcode.NetworkList: int IndexOf(T): missing ", - "Unity.Netcode.NetworkList: void Insert(int, T): missing ", - "Unity.Netcode.NetworkList: void Insert(int, T): missing ", - "Unity.Netcode.NetworkList: void Insert(int, T): missing ", - "Unity.Netcode.NetworkList: void RemoveAt(int): missing ", - "Unity.Netcode.NetworkList: void RemoveAt(int): missing ", - "Unity.Netcode.NetworkList: this[int]: missing ", - "Unity.Netcode.NetworkList: this[int]: missing ", "Unity.Netcode.NetworkVariable: CheckExceedsDirtinessThreshold: undocumented", "Unity.Netcode.NetworkVariable: bool ExceedsDirtinessThreshold(): undocumented", "Unity.Netcode.NetworkVariable: void OnInitialize(): undocumented", From 3177f032bcc2df51255799b1a27cadc894d4eb08 Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 27 Feb 2025 18:16:55 -0500 Subject: [PATCH 04/12] Update NetworkList[index] doc comment --- .../Runtime/NetworkVariable/Collections/NetworkList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs index 5ee8ad3247..eaf06bbb67 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs @@ -601,7 +601,7 @@ public void RemoveAt(int index) /// This method checks for write permissions before setting the value. /// /// The zero-based index of the element to get or set. - /// The element at the specified index. + /// The element at the specified index. public T this[int index] { get => m_List[index]; From 84e90db734117d5abbcbb907bedad89971e4d9cc Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 27 Feb 2025 18:34:47 -0500 Subject: [PATCH 05/12] Fix NetworkVariableSerialization.cs --- .../NetworkVariableSerialization.cs | 65 ++++++++++--------- pvpExceptions.json | 4 -- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs index 312363e88f..3a20c9bf1d 100644 --- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs +++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs @@ -1022,7 +1022,7 @@ public void Duplicate(in NativeList value, ref NativeList duplicatedValue) /// /// Serializer for managed INetworkSerializable types, which differs from the unmanaged implementation in that it /// has to be null-aware - /// + /// internal class ManagedNetworkSerializableSerializer : INetworkVariableSerializer where T : class, INetworkSerializable, new() { public void Write(FastBufferWriter writer, ref T value) @@ -1095,7 +1095,7 @@ public void Duplicate(in T value, ref T duplicatedValue) /// extension methods. Finding those methods isn't achievable efficiently at runtime, so this allows /// users to tell NetworkVariable about those extension methods (or simply pass in a lambda) /// - /// + /// The type to be serialized. public class UserNetworkVariableSerialization { /// @@ -1110,6 +1110,7 @@ public class UserNetworkVariableSerialization /// /// The to write the value of type `T` /// The value of type `T` to be written + /// The previous value of type `T` to be compared. public delegate void WriteDeltaDelegate(FastBufferWriter writer, in T value, in T previousValue); /// @@ -1129,8 +1130,8 @@ public class UserNetworkVariableSerialization /// /// The read value delegate handler definition /// - /// The to read the value of type `T` - /// The value of type `T` to be read + /// The value of type `T` to be duplicated. + /// The duplicated value of type `T`. public delegate void DuplicateValueDelegate(in T value, ref T duplicatedValue); /// @@ -1273,18 +1274,18 @@ internal static void InitializeIntegerSerialization() } /// - /// Registeres an unmanaged type that will be serialized by a direct memcpy into a buffer + /// Registers an unmanaged type that will be serialized by a direct memcpy into a buffer /// - /// + /// The unmanaged type to be serialized public static void InitializeSerializer_UnmanagedByMemcpy() where T : unmanaged { NetworkVariableSerialization.Serializer = new UnmanagedTypeSerializer(); } /// - /// Registeres an unmanaged type that will be serialized by a direct memcpy into a buffer + /// Registers an unmanaged array type that will be serialized by a direct memcpy into a buffer /// - /// + /// The unmanaged type to be serialized public static void InitializeSerializer_UnmanagedByMemcpyArray() where T : unmanaged { NetworkVariableSerialization>.Serializer = new UnmanagedArraySerializer(); @@ -1292,27 +1293,28 @@ public static void InitializeSerializer_UnmanagedByMemcpyArray() where T : un #if UNITY_NETCODE_NATIVE_COLLECTION_SUPPORT /// - /// Registeres an unmanaged type that will be serialized by a direct memcpy into a buffer + /// Registers an unmanaged list type that will be serialized by a direct memcpy into a buffer /// - /// + /// The unmanaged type to be serialized public static void InitializeSerializer_UnmanagedByMemcpyList() where T : unmanaged { NetworkVariableSerialization>.Serializer = new UnmanagedListSerializer(); } /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of elements in the hash set. public static void InitializeSerializer_NativeHashSet() where T : unmanaged, IEquatable { NetworkVariableSerialization>.Serializer = new NativeHashSetSerializer(); } /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of keys in the hash map. + /// The type of values in the hash map. public static void InitializeSerializer_NativeHashMap() where TKey : unmanaged, IEquatable where TVal : unmanaged @@ -1322,27 +1324,28 @@ public static void InitializeSerializer_NativeHashMap() #endif /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of elements in the list. public static void InitializeSerializer_List() { NetworkVariableSerialization>.Serializer = new ListSerializer(); } /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of elements in the hash set. public static void InitializeSerializer_HashSet() where T : IEquatable { NetworkVariableSerialization>.Serializer = new HashSetSerializer(); } /// - /// Registeres a native hash set (this generic implementation works with all types) + /// Registers a native hash set (this generic implementation works with all types) /// - /// + /// The type of keys in the dictionary. + /// The type of values in the dictionary. public static void InitializeSerializer_Dictionary() where TKey : IEquatable { NetworkVariableSerialization>.Serializer = new DictionarySerializer(); @@ -1352,7 +1355,7 @@ public static void InitializeSerializer_Dictionary() where TKey : IE /// Registers an unmanaged type that implements INetworkSerializable and will be serialized through a call to /// NetworkSerialize /// - /// + /// The unmanaged type that implements INetworkSerializable. public static void InitializeSerializer_UnmanagedINetworkSerializable() where T : unmanaged, INetworkSerializable { NetworkVariableSerialization.Serializer = new UnmanagedNetworkSerializableSerializer(); @@ -1362,7 +1365,7 @@ public static void InitializeSerializer_UnmanagedINetworkSerializable() where /// Registers an unmanaged type that implements INetworkSerializable and will be serialized through a call to /// NetworkSerialize /// - /// + /// The unmanaged type that implements INetworkSerializable. public static void InitializeSerializer_UnmanagedINetworkSerializableArray() where T : unmanaged, INetworkSerializable { NetworkVariableSerialization>.Serializer = new UnmanagedNetworkSerializableArraySerializer(); @@ -1373,7 +1376,7 @@ public static void InitializeSerializer_UnmanagedINetworkSerializableArray() /// Registers an unmanaged type that implements INetworkSerializable and will be serialized through a call to /// NetworkSerialize /// - /// + /// The unmanaged type that implements INetworkSerializable. public static void InitializeSerializer_UnmanagedINetworkSerializableList() where T : unmanaged, INetworkSerializable { NetworkVariableSerialization>.Serializer = new UnmanagedNetworkSerializableListSerializer(); @@ -1384,7 +1387,7 @@ public static void InitializeSerializer_UnmanagedINetworkSerializableList() w /// Registers a managed type that implements INetworkSerializable and will be serialized through a call to /// NetworkSerialize /// - /// + /// The managed type that implements INetworkSerializable. public static void InitializeSerializer_ManagedINetworkSerializable() where T : class, INetworkSerializable, new() { NetworkVariableSerialization.Serializer = new ManagedNetworkSerializableSerializer(); @@ -1394,7 +1397,7 @@ public static void InitializeSerializer_UnmanagedINetworkSerializableList() w /// Registers a FixedString type that will be serialized through FastBufferReader/FastBufferWriter's FixedString /// serializers /// - /// + /// The FixedString type to be serialized. public static void InitializeSerializer_FixedString() where T : unmanaged, INativeList, IUTF8Bytes { NetworkVariableSerialization.Serializer = new FixedStringSerializer(); @@ -1404,7 +1407,7 @@ public static void InitializeSerializer_FixedString() where T : unmanaged, IN /// Registers a FixedString type that will be serialized through FastBufferReader/FastBufferWriter's FixedString /// serializers /// - /// + /// The FixedString type to be serialized. public static void InitializeSerializer_FixedStringArray() where T : unmanaged, INativeList, IUTF8Bytes { NetworkVariableSerialization>.Serializer = new FixedStringArraySerializer(); @@ -1415,7 +1418,7 @@ public static void InitializeSerializer_FixedStringArray() where T : unmanage /// Registers a FixedString type that will be serialized through FastBufferReader/FastBufferWriter's FixedString /// serializers /// - /// + /// The FixedString type to be serialized. public static void InitializeSerializer_FixedStringList() where T : unmanaged, INativeList, IUTF8Bytes { NetworkVariableSerialization>.Serializer = new FixedStringListSerializer(); @@ -1467,7 +1470,7 @@ public static void InitializeEqualityChecker_HashSet() where T : IEquatable /// Registers an unmanaged type that will be checked for equality using T.Equals() /// - /// The type of dictionary keys that implements IEquatable. + /// The type of dictionary keys that implements IEquatable. /// The type of dictionary values. public static void InitializeEqualityChecker_Dictionary() where TKey : IEquatable @@ -1495,7 +1498,7 @@ public static void InitializeEqualityChecker_NativeHashSet() where T : unmana /// /// Registers an unmanaged type that will be checked for equality using T.Equals() /// - /// The type of dictionary keys that implements IEquatable. + /// The type of dictionary keys that implements IEquatable. /// The type of dictionary values. public static void InitializeEqualityChecker_NativeHashMap() where TKey : unmanaged, IEquatable @@ -1562,6 +1565,9 @@ public static class NetworkVariableSerialization /// /// A callback to check if two values are equal. /// + /// The first value to compare. + /// The second value to compare. + /// True if the values are equal; otherwise, false. public delegate bool EqualsDelegate(ref T a, ref T b); /// @@ -1642,6 +1648,7 @@ public static void Read(FastBufferReader reader, ref T value) /// /// The FastBufferWriter to write the serialized data to. /// The value to serialize + /// The previous value of type `T` to be compared. public static void WriteDelta(FastBufferWriter writer, ref T value, ref T previousValue) { Serializer.WriteDelta(writer, ref value, ref previousValue); diff --git a/pvpExceptions.json b/pvpExceptions.json index ed09b41afc..42f9fa6e20 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -7,8 +7,6 @@ }, "PVP-150-1": { "errors": [ - "Unity.Netcode.UserNetworkVariableSerialization: empty tag", - "Unity.Netcode.UserNetworkVariableSerialization.DuplicateValueDelegate: unexpected ", "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedByMemcpy(): empty tag", "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedByMemcpyArray(): empty tag", "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_List(): empty tag", @@ -149,8 +147,6 @@ "Unity.Netcode.NetworkVariableUpdateTraits: MaxSecondsBetweenUpdates: undocumented", "Unity.Netcode.NetworkVariableBase: NetworkBehaviour GetBehaviour(): undocumented", "Unity.Netcode.NetworkVariableBase: void MarkNetworkBehaviourDirty(): undocumented", - "Unity.Netcode.UserNetworkVariableSerialization.WriteDeltaDelegate: missing ", - "Unity.Netcode.UserNetworkVariableSerialization.DuplicateValueDelegate: missing ", "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): missing ", "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): missing ", "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeEqualityChecker_Dictionary(): missing ", From fb6b34fbbdfb09efbcb1501356172bbc20a05866 Mon Sep 17 00:00:00 2001 From: "unity-renovate[bot]" <120015202+unity-renovate[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 09:45:58 +0100 Subject: [PATCH 06/12] chore(deps): update dependency recipeengine.modules.wrench to 0.10.41 (develop) (#3324) Updated wrench to 0.10.41 and regenerated recipes --- .yamato/wrench/api-validation-jobs.yml | 4 +- .yamato/wrench/package-pack-jobs.yml | 2 +- .yamato/wrench/preview-a-p-v.yml | 62 +++++++++++++------------- .yamato/wrench/promotion-jobs.yml | 8 ++-- .yamato/wrench/recipe-regeneration.yml | 4 +- .yamato/wrench/validation-jobs.yml | 60 ++++++++++++------------- .yamato/wrench/wrench_config.json | 2 +- Tools/CI/NGO.Cookbook.csproj | 2 +- 8 files changed, 72 insertions(+), 72 deletions(-) diff --git a/.yamato/wrench/api-validation-jobs.yml b/.yamato/wrench/api-validation-jobs.yml index c7f23fc179..94070dde5b 100644 --- a/.yamato/wrench/api-validation-jobs.yml +++ b/.yamato/wrench/api-validation-jobs.yml @@ -51,8 +51,8 @@ api_validation_-_netcode_gameobjects_-_2021_3_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 diff --git a/.yamato/wrench/package-pack-jobs.yml b/.yamato/wrench/package-pack-jobs.yml index 9ea7ac892f..143680f296 100644 --- a/.yamato/wrench/package-pack-jobs.yml +++ b/.yamato/wrench/package-pack-jobs.yml @@ -24,5 +24,5 @@ package_pack_-_netcode_gameobjects: UPMCI_ACK_LARGE_PACKAGE: 1 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 diff --git a/.yamato/wrench/preview-a-p-v.yml b/.yamato/wrench/preview-a-p-v.yml index b76f900c61..2d58b4a036 100644 --- a/.yamato/wrench/preview-a-p-v.yml +++ b/.yamato/wrench/preview-a-p-v.yml @@ -22,7 +22,7 @@ all_preview_apv_jobs: - path: .yamato/wrench/preview-a-p-v.yml#preview_apv_-_6000_2_-_windows metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 2021.3 manifest (MacOS). preview_apv_-_2021_3_-_macos: @@ -73,10 +73,10 @@ preview_apv_-_2021_3_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 2021.3 manifest (Ubuntu). preview_apv_-_2021_3_-_ubuntu: @@ -127,10 +127,10 @@ preview_apv_-_2021_3_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 2021.3 manifest (Windows). preview_apv_-_2021_3_-_windows: @@ -182,10 +182,10 @@ preview_apv_-_2021_3_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 2022.3 manifest (MacOS). preview_apv_-_2022_3_-_macos: @@ -236,10 +236,10 @@ preview_apv_-_2022_3_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 2022.3 manifest (Ubuntu). preview_apv_-_2022_3_-_ubuntu: @@ -290,10 +290,10 @@ preview_apv_-_2022_3_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 2022.3 manifest (Windows). preview_apv_-_2022_3_-_windows: @@ -345,10 +345,10 @@ preview_apv_-_2022_3_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 6000.0 manifest (MacOS). preview_apv_-_6000_0_-_macos: @@ -399,10 +399,10 @@ preview_apv_-_6000_0_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 6000.0 manifest (Ubuntu). preview_apv_-_6000_0_-_ubuntu: @@ -453,10 +453,10 @@ preview_apv_-_6000_0_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 6000.0 manifest (Windows). preview_apv_-_6000_0_-_windows: @@ -508,10 +508,10 @@ preview_apv_-_6000_0_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 6000.1 manifest (MacOS). preview_apv_-_6000_1_-_macos: @@ -562,10 +562,10 @@ preview_apv_-_6000_1_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 6000.1 manifest (Ubuntu). preview_apv_-_6000_1_-_ubuntu: @@ -616,10 +616,10 @@ preview_apv_-_6000_1_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 6000.1 manifest (Windows). preview_apv_-_6000_1_-_windows: @@ -671,10 +671,10 @@ preview_apv_-_6000_1_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 6000.2 manifest (MacOS). preview_apv_-_6000_2_-_macos: @@ -725,10 +725,10 @@ preview_apv_-_6000_2_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 6000.2 manifest (Ubuntu). preview_apv_-_6000_2_-_ubuntu: @@ -779,10 +779,10 @@ preview_apv_-_6000_2_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Functional tests for dependents found in the latest 6000.2 manifest (Windows). preview_apv_-_6000_2_-_windows: @@ -834,8 +834,8 @@ preview_apv_-_6000_2_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 diff --git a/.yamato/wrench/promotion-jobs.yml b/.yamato/wrench/promotion-jobs.yml index 43b3b81757..cdd7a8ae0d 100644 --- a/.yamato/wrench/promotion-jobs.yml +++ b/.yamato/wrench/promotion-jobs.yml @@ -148,10 +148,10 @@ publish_dry_run_netcode_gameobjects: unzip: true variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 # Publish for netcode.gameobjects to https://artifactory-slo.bf.unity3d.com/artifactory/api/npm/upm-npm publish_netcode_gameobjects: @@ -300,8 +300,8 @@ publish_netcode_gameobjects: unzip: true variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 diff --git a/.yamato/wrench/recipe-regeneration.yml b/.yamato/wrench/recipe-regeneration.yml index 299ecec419..d6e84df51b 100644 --- a/.yamato/wrench/recipe-regeneration.yml +++ b/.yamato/wrench/recipe-regeneration.yml @@ -11,7 +11,7 @@ test_-_wrench_jobs_up_to_date: commands: - command: dotnet run --project Tools\CI\NGO.Cookbook.csproj - command: |- - if [ -n "$(git status --porcelain)" ]; then + if [ -n "$(git status --porcelain -- .yamato/wrench)"]; then git status echo "Your repo is not clean - diff output:" git diff @@ -26,5 +26,5 @@ test_-_wrench_jobs_up_to_date: cancel_old_ci: true metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 diff --git a/.yamato/wrench/validation-jobs.yml b/.yamato/wrench/validation-jobs.yml index 1e52a5b58e..e334f9c3b0 100644 --- a/.yamato/wrench/validation-jobs.yml +++ b/.yamato/wrench/validation-jobs.yml @@ -60,10 +60,10 @@ validate_-_netcode_gameobjects_-_2021_3_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -126,10 +126,10 @@ validate_-_netcode_gameobjects_-_2021_3_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -192,10 +192,10 @@ validate_-_netcode_gameobjects_-_2021_3_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -258,10 +258,10 @@ validate_-_netcode_gameobjects_-_2022_3_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -324,10 +324,10 @@ validate_-_netcode_gameobjects_-_2022_3_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -390,10 +390,10 @@ validate_-_netcode_gameobjects_-_2022_3_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -456,10 +456,10 @@ validate_-_netcode_gameobjects_-_6000_0_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -522,10 +522,10 @@ validate_-_netcode_gameobjects_-_6000_0_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -588,10 +588,10 @@ validate_-_netcode_gameobjects_-_6000_0_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -654,10 +654,10 @@ validate_-_netcode_gameobjects_-_6000_1_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -720,10 +720,10 @@ validate_-_netcode_gameobjects_-_6000_1_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -786,10 +786,10 @@ validate_-_netcode_gameobjects_-_6000_1_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -852,10 +852,10 @@ validate_-_netcode_gameobjects_-_6000_2_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -918,10 +918,10 @@ validate_-_netcode_gameobjects_-_6000_2_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects @@ -984,10 +984,10 @@ validate_-_netcode_gameobjects_-_6000_2_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.40.0 + UPMPVP_CONTEXT_WRENCH: 0.10.41.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.40.0 + Wrench: 0.10.41.0 labels: - Packages:netcode.gameobjects diff --git a/.yamato/wrench/wrench_config.json b/.yamato/wrench/wrench_config.json index 551fc31e0f..4828f401fa 100644 --- a/.yamato/wrench/wrench_config.json +++ b/.yamato/wrench/wrench_config.json @@ -31,7 +31,7 @@ }, "publishing_job": ".yamato/wrench/promotion-jobs.yml#publish_netcode_gameobjects", "branch_pattern": "ReleaseSlash", - "wrench_version": "0.10.40.0", + "wrench_version": "0.10.41.0", "pvp_exemption_path": ".yamato/wrench/pvp-exemptions.json", "cs_project_path": "Tools\\CI\\NGO.Cookbook.csproj" } \ No newline at end of file diff --git a/Tools/CI/NGO.Cookbook.csproj b/Tools/CI/NGO.Cookbook.csproj index c6f2e29c41..2a506baab2 100644 --- a/Tools/CI/NGO.Cookbook.csproj +++ b/Tools/CI/NGO.Cookbook.csproj @@ -8,7 +8,7 @@ - + From b11c38ce80925db36bbfc4cc14d71eaec2801070 Mon Sep 17 00:00:00 2001 From: "unity-renovate[bot]" <120015202+unity-renovate[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:42:31 +0100 Subject: [PATCH 07/12] chore(deps): update dependency recipeengine.modules.wrench to 0.10.42 (develop) (#3327) Updated Wrench to 0.10.42 and regenerated recipes --- .yamato/wrench/api-validation-jobs.yml | 4 +- .yamato/wrench/package-pack-jobs.yml | 2 +- .yamato/wrench/preview-a-p-v.yml | 62 +++++++++++++------------- .yamato/wrench/promotion-jobs.yml | 8 ++-- .yamato/wrench/recipe-regeneration.yml | 4 +- .yamato/wrench/validation-jobs.yml | 60 ++++++++++++------------- .yamato/wrench/wrench_config.json | 2 +- Tools/CI/NGO.Cookbook.csproj | 2 +- 8 files changed, 72 insertions(+), 72 deletions(-) diff --git a/.yamato/wrench/api-validation-jobs.yml b/.yamato/wrench/api-validation-jobs.yml index 94070dde5b..00d8e3d94d 100644 --- a/.yamato/wrench/api-validation-jobs.yml +++ b/.yamato/wrench/api-validation-jobs.yml @@ -51,8 +51,8 @@ api_validation_-_netcode_gameobjects_-_2021_3_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 diff --git a/.yamato/wrench/package-pack-jobs.yml b/.yamato/wrench/package-pack-jobs.yml index 143680f296..6881d50692 100644 --- a/.yamato/wrench/package-pack-jobs.yml +++ b/.yamato/wrench/package-pack-jobs.yml @@ -24,5 +24,5 @@ package_pack_-_netcode_gameobjects: UPMCI_ACK_LARGE_PACKAGE: 1 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 diff --git a/.yamato/wrench/preview-a-p-v.yml b/.yamato/wrench/preview-a-p-v.yml index 2d58b4a036..37b3fb1ce3 100644 --- a/.yamato/wrench/preview-a-p-v.yml +++ b/.yamato/wrench/preview-a-p-v.yml @@ -22,7 +22,7 @@ all_preview_apv_jobs: - path: .yamato/wrench/preview-a-p-v.yml#preview_apv_-_6000_2_-_windows metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 2021.3 manifest (MacOS). preview_apv_-_2021_3_-_macos: @@ -73,10 +73,10 @@ preview_apv_-_2021_3_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 2021.3 manifest (Ubuntu). preview_apv_-_2021_3_-_ubuntu: @@ -127,10 +127,10 @@ preview_apv_-_2021_3_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 2021.3 manifest (Windows). preview_apv_-_2021_3_-_windows: @@ -182,10 +182,10 @@ preview_apv_-_2021_3_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 2022.3 manifest (MacOS). preview_apv_-_2022_3_-_macos: @@ -236,10 +236,10 @@ preview_apv_-_2022_3_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 2022.3 manifest (Ubuntu). preview_apv_-_2022_3_-_ubuntu: @@ -290,10 +290,10 @@ preview_apv_-_2022_3_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 2022.3 manifest (Windows). preview_apv_-_2022_3_-_windows: @@ -345,10 +345,10 @@ preview_apv_-_2022_3_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 6000.0 manifest (MacOS). preview_apv_-_6000_0_-_macos: @@ -399,10 +399,10 @@ preview_apv_-_6000_0_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 6000.0 manifest (Ubuntu). preview_apv_-_6000_0_-_ubuntu: @@ -453,10 +453,10 @@ preview_apv_-_6000_0_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 6000.0 manifest (Windows). preview_apv_-_6000_0_-_windows: @@ -508,10 +508,10 @@ preview_apv_-_6000_0_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 6000.1 manifest (MacOS). preview_apv_-_6000_1_-_macos: @@ -562,10 +562,10 @@ preview_apv_-_6000_1_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 6000.1 manifest (Ubuntu). preview_apv_-_6000_1_-_ubuntu: @@ -616,10 +616,10 @@ preview_apv_-_6000_1_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 6000.1 manifest (Windows). preview_apv_-_6000_1_-_windows: @@ -671,10 +671,10 @@ preview_apv_-_6000_1_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 6000.2 manifest (MacOS). preview_apv_-_6000_2_-_macos: @@ -725,10 +725,10 @@ preview_apv_-_6000_2_-_macos: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 6000.2 manifest (Ubuntu). preview_apv_-_6000_2_-_ubuntu: @@ -779,10 +779,10 @@ preview_apv_-_6000_2_-_ubuntu: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Functional tests for dependents found in the latest 6000.2 manifest (Windows). preview_apv_-_6000_2_-_windows: @@ -834,8 +834,8 @@ preview_apv_-_6000_2_-_windows: dependencies: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 diff --git a/.yamato/wrench/promotion-jobs.yml b/.yamato/wrench/promotion-jobs.yml index cdd7a8ae0d..a4f393614f 100644 --- a/.yamato/wrench/promotion-jobs.yml +++ b/.yamato/wrench/promotion-jobs.yml @@ -148,10 +148,10 @@ publish_dry_run_netcode_gameobjects: unzip: true variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 # Publish for netcode.gameobjects to https://artifactory-slo.bf.unity3d.com/artifactory/api/npm/upm-npm publish_netcode_gameobjects: @@ -300,8 +300,8 @@ publish_netcode_gameobjects: unzip: true variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 diff --git a/.yamato/wrench/recipe-regeneration.yml b/.yamato/wrench/recipe-regeneration.yml index d6e84df51b..ed1367053a 100644 --- a/.yamato/wrench/recipe-regeneration.yml +++ b/.yamato/wrench/recipe-regeneration.yml @@ -11,7 +11,7 @@ test_-_wrench_jobs_up_to_date: commands: - command: dotnet run --project Tools\CI\NGO.Cookbook.csproj - command: |- - if [ -n "$(git status --porcelain -- .yamato/wrench)"]; then + if [ -n "$(git status --porcelain -- .yamato/wrench)" ]; then git status echo "Your repo is not clean - diff output:" git diff @@ -26,5 +26,5 @@ test_-_wrench_jobs_up_to_date: cancel_old_ci: true metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 diff --git a/.yamato/wrench/validation-jobs.yml b/.yamato/wrench/validation-jobs.yml index e334f9c3b0..f82bb16364 100644 --- a/.yamato/wrench/validation-jobs.yml +++ b/.yamato/wrench/validation-jobs.yml @@ -60,10 +60,10 @@ validate_-_netcode_gameobjects_-_2021_3_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -126,10 +126,10 @@ validate_-_netcode_gameobjects_-_2021_3_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -192,10 +192,10 @@ validate_-_netcode_gameobjects_-_2021_3_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -258,10 +258,10 @@ validate_-_netcode_gameobjects_-_2022_3_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -324,10 +324,10 @@ validate_-_netcode_gameobjects_-_2022_3_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -390,10 +390,10 @@ validate_-_netcode_gameobjects_-_2022_3_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -456,10 +456,10 @@ validate_-_netcode_gameobjects_-_6000_0_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -522,10 +522,10 @@ validate_-_netcode_gameobjects_-_6000_0_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -588,10 +588,10 @@ validate_-_netcode_gameobjects_-_6000_0_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -654,10 +654,10 @@ validate_-_netcode_gameobjects_-_6000_1_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -720,10 +720,10 @@ validate_-_netcode_gameobjects_-_6000_1_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -786,10 +786,10 @@ validate_-_netcode_gameobjects_-_6000_1_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -852,10 +852,10 @@ validate_-_netcode_gameobjects_-_6000_2_-_macos: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -918,10 +918,10 @@ validate_-_netcode_gameobjects_-_6000_2_-_ubuntu: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects @@ -984,10 +984,10 @@ validate_-_netcode_gameobjects_-_6000_2_-_windows: - path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects variables: UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1 - UPMPVP_CONTEXT_WRENCH: 0.10.41.0 + UPMPVP_CONTEXT_WRENCH: 0.10.42.0 metadata: Job Maintainers: '#rm-packageworks' - Wrench: 0.10.41.0 + Wrench: 0.10.42.0 labels: - Packages:netcode.gameobjects diff --git a/.yamato/wrench/wrench_config.json b/.yamato/wrench/wrench_config.json index 4828f401fa..0008cc2089 100644 --- a/.yamato/wrench/wrench_config.json +++ b/.yamato/wrench/wrench_config.json @@ -31,7 +31,7 @@ }, "publishing_job": ".yamato/wrench/promotion-jobs.yml#publish_netcode_gameobjects", "branch_pattern": "ReleaseSlash", - "wrench_version": "0.10.41.0", + "wrench_version": "0.10.42.0", "pvp_exemption_path": ".yamato/wrench/pvp-exemptions.json", "cs_project_path": "Tools\\CI\\NGO.Cookbook.csproj" } \ No newline at end of file diff --git a/Tools/CI/NGO.Cookbook.csproj b/Tools/CI/NGO.Cookbook.csproj index 2a506baab2..3c9167ff3d 100644 --- a/Tools/CI/NGO.Cookbook.csproj +++ b/Tools/CI/NGO.Cookbook.csproj @@ -8,7 +8,7 @@ - + From 06129b8b7ec244f53a5e70a4179aee49aeecfee6 Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 3 Mar 2025 12:29:53 -0500 Subject: [PATCH 08/12] Fix NetworkObjectReference and NetcodeIntegrationTest --- .../Serialization/NetworkObjectReference.cs | 4 +- .../Runtime/NetcodeIntegrationTest.cs | 252 ++++++++++++++++-- 2 files changed, 230 insertions(+), 26 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkObjectReference.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkObjectReference.cs index c2f1ba46f1..980cf2928c 100644 --- a/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkObjectReference.cs +++ b/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkObjectReference.cs @@ -25,7 +25,7 @@ public ulong NetworkObjectId /// Creates a new instance of the struct. /// /// The to reference. - /// + /// Thrown if the is not spawned. public NetworkObjectReference(NetworkObject networkObject) { if (networkObject == null) @@ -46,7 +46,7 @@ public NetworkObjectReference(NetworkObject networkObject) /// Creates a new instance of the struct. /// /// The GameObject from which the component will be referenced. - /// + /// Thrown if the GameObject does not have a component or if the is not spawned. public NetworkObjectReference(GameObject gameObject) { if (gameObject == null) diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs index db88d77d5e..4b28d63e5d 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs @@ -25,9 +25,21 @@ public abstract class NetcodeIntegrationTest /// internal static bool IsRunning { get; private set; } + /// + /// A global instance of used to manage timeouts during integration tests. + /// protected static TimeoutHelper s_GlobalTimeoutHelper = new TimeoutHelper(8.0f); + + /// + /// A default wait time used to yield for one tick interval during integration tests. + /// This is calculated based on the default tick rate of the server's NetworkManager. + /// protected static WaitForSecondsRealtime s_DefaultWaitForTick = new WaitForSecondsRealtime(1.0f / k_DefaultTickRate); + /// + /// An instance of used to capture and assert log messages during integration tests. + /// This helps in verifying that expected log messages are produced and unexpected log messages are not. + /// public NetcodeLogAssert NetcodeLogAssert; /// @@ -41,6 +53,10 @@ public abstract class NetcodeIntegrationTest /// protected static Dictionary> s_GlobalNetworkObjects = new Dictionary>(); + /// + /// Registers a NetworkObject to the global list of spawned NetworkObjects. + /// + /// The NetworkObject to register. public static void RegisterNetworkObject(NetworkObject networkObject) { if (!s_GlobalNetworkObjects.ContainsKey(networkObject.NetworkManager.LocalClientId)) @@ -66,6 +82,10 @@ public static void RegisterNetworkObject(NetworkObject networkObject) } } + /// + /// Deregisters a NetworkObject from the global list of spawned NetworkObjects. + /// + /// The NetworkObject to deregister. public static void DeregisterNetworkObject(NetworkObject networkObject) { if (networkObject.IsSpawned && networkObject.NetworkManager != null) @@ -74,6 +94,11 @@ public static void DeregisterNetworkObject(NetworkObject networkObject) } } + /// + /// Deregisters a NetworkObject from the global list of spawned NetworkObjects using the clientId and NetworkObjectId. + /// + /// clientId who owns the object. + /// The NetworkObjectId of the NetworkObject. public static void DeregisterNetworkObject(ulong localClientId, ulong networkObjectId) { if (s_GlobalNetworkObjects.ContainsKey(localClientId) && s_GlobalNetworkObjects[localClientId].ContainsKey(networkObjectId)) @@ -86,11 +111,22 @@ public static void DeregisterNetworkObject(ulong localClientId, ulong networkObj } } + /// + /// Gets the total number of clients, including the host if applicable. + /// protected int TotalClients => m_UseHost ? m_NumberOfClients + 1 : m_NumberOfClients; + /// + /// The default tick rate used for the server's NetworkManager. + /// This value is used to calculate the default wait time for one tick interval during integration tests. + /// protected const uint k_DefaultTickRate = 30; private int m_NumberOfClients; + + /// + /// Gets the number of clients to be created for the integration test. + /// protected abstract int NumberOfClients { get; } /// @@ -102,21 +138,56 @@ public static void DeregisterNetworkObject(ulong localClientId, ulong networkObj /// protected bool m_CreateServerFirst = true; + /// + /// Specifies the mode of NetworkManager instantiation and destruction for the integration test. + /// public enum NetworkManagerInstatiationMode { - PerTest, // This will create and destroy new NetworkManagers for each test within a child derived class - AllTests, // This will create one set of NetworkManagers used for all tests within a child derived class (destroyed once all tests are finished) - DoNotCreate // This will not create any NetworkManagers, it is up to the derived class to manage. + /// + /// Creates and destroys new NetworkManagers for each test within a child derived class. + /// + PerTest, + + /// + /// Creates one set of NetworkManagers used for all tests within a child derived class, destroyed once all tests are finished. + /// + AllTests, + + /// + /// Does not create any NetworkManagers; it is up to the derived class to manage. + /// + DoNotCreate } + /// + /// Specifies whether the test should run as a host or server. + /// public enum HostOrServer { + /// + /// Runs the test as a host. + /// Host, + + /// + /// Runs the test as a server. + /// Server } + /// + /// The player prefab used in the integration test. + /// protected GameObject m_PlayerPrefab; + + /// + /// The NetworkManager instance for the server. + /// protected NetworkManager m_ServerNetworkManager; + + /// + /// The NetworkManager instances for the clients, one per client. + /// protected NetworkManager[] m_ClientNetworkManagers; /// @@ -128,11 +199,24 @@ public enum HostOrServer /// protected Dictionary> m_PlayerNetworkObjects = new Dictionary>(); + /// + /// Indicates whether the test should run as a host. + /// If true, the test will run as a host; otherwise, it will run as a server. + /// protected bool m_UseHost = true; + + /// + /// The target frame rate for the integration test. + /// This value is used to set the frame rate for the test environment. + /// protected int m_TargetFrameRate = 60; private NetworkManagerInstatiationMode m_NetworkManagerInstatiationMode; + /// + /// Indicates whether verbose debug logging is enabled. + /// If true, detailed debug information will be logged during the integration test. + /// protected bool m_EnableVerboseDebug { get; set; } /// @@ -221,7 +305,7 @@ public enum HostOrServer /// stages and can be used to log verbose information /// for troubleshooting an integration test. /// - /// + /// The message to log. [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void VerboseDebug(string msg) { @@ -248,15 +332,23 @@ protected virtual bool OnSetVerboseDebug() /// Override this method to change the default mode: /// /// + /// The NetworkManager instantiation mode to be used for the integration test. protected virtual NetworkManagerInstatiationMode OnSetIntegrationTestMode() { return NetworkManagerInstatiationMode.PerTest; } + /// + /// Override this method to perform any setup that needs to be done once before any tests are run. + /// This method is called during the process. + /// protected virtual void OnOneTimeSetup() { } + /// + /// Called once before any tests are run to perform setup operations. + /// [OneTimeSetUp] public void OneTimeSetup() { @@ -301,6 +393,9 @@ protected virtual void OnInlineSetup() { } + /// + /// Called before each test is run to perform setup operations. + /// [UnitySetUp] public IEnumerator SetUp() { @@ -419,9 +514,11 @@ private void AddRemoveNetworkManager(NetworkManager networkManager, bool addNetw } /// - /// CreateAndStartNewClient Only - /// Invoked when the newly created client has been created + /// Invoked when a new client has been created during the integration test. + /// Override this method to perform any setup or configuration needed for the new client + /// before it is started. /// + /// The NetworkManager instance of the client. protected virtual void OnNewClientCreated(NetworkManager networkManager) { } @@ -430,6 +527,7 @@ protected virtual void OnNewClientCreated(NetworkManager networkManager) /// CreateAndStartNewClient Only /// Invoked when the newly created client has been created and started /// + /// The NetworkManager instance of the client. protected virtual void OnNewClientStarted(NetworkManager networkManager) { } @@ -439,6 +537,7 @@ protected virtual void OnNewClientStarted(NetworkManager networkManager) /// Invoked when the newly created client has been created, started, and connected /// to the server-host. /// + /// The NetworkManager instance of the client. protected virtual void OnNewClientStartedAndConnected(NetworkManager networkManager) { } @@ -450,6 +549,8 @@ protected virtual void OnNewClientStartedAndConnected(NetworkManager networkMana /// /// Use this for testing connection and disconnection scenarios /// + /// The NetworkManager instance of the client. + /// True if the test should wait for the new client to connect; otherwise, false. protected virtual bool ShouldWaitForNewClientToConnect(NetworkManager networkManager) { return true; @@ -459,6 +560,7 @@ protected virtual bool ShouldWaitForNewClientToConnect(NetworkManager networkMan /// This will create, start, and connect a new client while in the middle of an /// integration test. /// + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator CreateAndStartNewClient() { var networkManager = NetcodeIntegrationTestHelpers.CreateNewClient(m_ClientNetworkManagers.Length, m_EnableTimeTravel); @@ -539,6 +641,9 @@ protected void CreateAndStartNewClientWithTimeTravel() /// /// This will stop a client while in the middle of an integration test /// + /// The NetworkManager instance of the client to stop. + /// If true, the client's NetworkManager GameObject will be destroyed. + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator StopOneClient(NetworkManager networkManager, bool destroy = false) { NetcodeIntegrationTestHelpers.StopOneClient(networkManager, destroy); @@ -549,6 +654,9 @@ protected IEnumerator StopOneClient(NetworkManager networkManager, bool destroy /// /// This will stop a client while in the middle of an integration test /// + /// The NetworkManager instance of the client to stop. + /// If true, the client's NetworkManager GameObject will be destroyed. + /// An IEnumerator for use with Unity's coroutine system. protected void StopOneClientWithTimeTravel(NetworkManager networkManager, bool destroy = false) { NetcodeIntegrationTestHelpers.StopOneClient(networkManager, destroy); @@ -556,6 +664,10 @@ protected void StopOneClientWithTimeTravel(NetworkManager networkManager, bool d Assert.True(WaitForConditionOrTimeOutWithTimeTravel(() => !networkManager.IsConnectedClient)); } + /// + /// Sets the simulated network latency for time travel. + /// + /// The amount of latency to simulate in seconds. protected void SetTimeTravelSimulatedLatency(float latencySeconds) { ((MockTransport)m_ServerNetworkManager.NetworkConfig.NetworkTransport).SimulatedLatencySeconds = latencySeconds; @@ -565,6 +677,10 @@ protected void SetTimeTravelSimulatedLatency(float latencySeconds) } } + /// + /// Sets the simulated packet drop rate for time travel. + /// + /// The percentage of packets to drop (0 to 100). protected void SetTimeTravelSimulatedDropRate(float dropRatePercent) { ((MockTransport)m_ServerNetworkManager.NetworkConfig.NetworkTransport).PacketDropRate = dropRatePercent; @@ -574,6 +690,10 @@ protected void SetTimeTravelSimulatedDropRate(float dropRatePercent) } } + /// + /// Sets the simulated network latency jitter for time travel. + /// + /// The amount of jitter to simulate in seconds. protected void SetTimeTravelSimulatedLatencyJitter(float jitterSeconds) { ((MockTransport)m_ServerNetworkManager.NetworkConfig.NetworkTransport).LatencyJitter = jitterSeconds; @@ -586,7 +706,7 @@ protected void SetTimeTravelSimulatedLatencyJitter(float jitterSeconds) /// /// Creates the server and clients /// - /// + /// The number of clients to create. protected void CreateServerAndClients(int numberOfClients) { VerboseDebug($"Entering {nameof(CreateServerAndClients)}"); @@ -632,6 +752,7 @@ protected void CreateServerAndClients(int numberOfClients) /// Override this method and return false in order to be able /// to manually control when the server and clients are started. /// + /// True if the server and clients can be started automatically; otherwise, false. protected virtual bool CanStartServerAndClients() { return true; @@ -641,6 +762,7 @@ protected virtual bool CanStartServerAndClients() /// Invoked after the server and clients have started. /// Note: No connection verification has been done at this point /// + /// An IEnumerator for use with Unity's coroutine system. protected virtual IEnumerator OnStartedServerAndClients() { yield return null; @@ -658,6 +780,7 @@ protected virtual void OnTimeTravelStartedServerAndClients() /// Invoked after the server and clients have started and verified /// their connections with each other. /// + /// An IEnumerator for use with Unity's coroutine system. protected virtual IEnumerator OnServerAndClientsConnected() { yield return null; @@ -719,6 +842,11 @@ private void ClientNetworkManagerPostStart(NetworkManager networkManager) } } + /// + /// Initializes the client network managers after they have been started. + /// This method creates a dictionary for all player instances relative to each client and server. + /// It provides a simpler way to get a specific player instance relative to a client instance. + /// protected void ClientNetworkManagerPostStartInit() { // Creates a dictionary for all player instances client and server relative @@ -751,8 +879,17 @@ protected void ClientNetworkManagerPostStartInit() } } + /// + /// Indicates whether all network messages should be logged during the integration test. + /// If true, detailed information about all sent and received network messages will be logged. + /// protected virtual bool LogAllMessages => false; + /// + /// Determines whether the test should check for spawned player objects after the server and clients have started and connected. + /// Override this method to control whether player objects should be checked for existence after the server and clients are connected. + /// + /// True if the test should check for spawned player objects; otherwise, false. protected virtual bool ShouldCheckForSpawnedPlayers() { return true; @@ -762,6 +899,7 @@ protected virtual bool ShouldCheckForSpawnedPlayers() /// This starts the server and clients as long as /// returns true. /// + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator StartServerAndClients() { if (CanStartServerAndClients()) @@ -777,7 +915,7 @@ protected IEnumerator StartServerAndClients() } // When scene management is enabled, we need to re-apply the scenes populated list since we have overriden the ISceneManagerHandler - // imeplementation at this point. This assures any pre-loaded scenes will be automatically assigned to the server and force clients + // imeplementation at this point. This assures any pre-loaded scenes will be automatically assigned to the server and force clients // to load their own scenes. if (m_ServerNetworkManager.NetworkConfig.EnableSceneManagement) { @@ -918,6 +1056,7 @@ protected void StartServerAndClientsWithTimeTravel() /// Override this method to control when clients /// can fake-load a scene. /// + /// True if clients are allowed to load a scene; otherwise, false. protected virtual bool CanClientsLoad() { return true; @@ -927,6 +1066,7 @@ protected virtual bool CanClientsLoad() /// Override this method to control when clients /// can fake-unload a scene. /// + /// True if clients are allowed to unload a scene; otherwise, false. protected virtual bool CanClientsUnload() { return true; @@ -964,6 +1104,12 @@ private bool ClientSceneHandler_CanClientsLoad() return CanClientsLoad(); } + /// + /// Determines whether a scene can be unloaded during the cleanup process. + /// Override this method to specify custom logic for deciding if a scene should be unloaded. + /// + /// The scene to check. + /// True if the scene can be unloaded; otherwise, false. protected bool OnCanSceneCleanUpUnload(Scene scene) { return true; @@ -1015,15 +1161,24 @@ protected void ShutdownAndCleanUp() /// Note: For mode /// this is called before ShutdownAndCleanUp. /// + /// An IEnumerator for use with Unity's coroutine system. protected virtual IEnumerator OnTearDown() { yield return null; } + /// + /// Called during the tear down process if is set to false. + /// Override this method to perform any tear down operations that do not require a coroutine. + /// protected virtual void OnInlineTearDown() { } + /// + /// Called during the tear down process after each test is run to perform cleanup operations. + /// + /// An IEnumerator for use with Unity's coroutine system. [UnityTearDown] public IEnumerator TearDown() { @@ -1074,6 +1229,9 @@ protected virtual void OnOneTimeTearDown() { } + /// + /// Called once after all tests have run to perform cleanup operations. + /// [OneTimeTearDown] public void OneTimeTearDown() { @@ -1103,6 +1261,7 @@ public void OneTimeTearDown() /// /// /// the network object in question to be destroyed + /// True if the NetworkObject can be destroyed; otherwise, false. protected virtual bool CanDestroyNetworkObject(NetworkObject networkObject) { return true; @@ -1165,6 +1324,10 @@ protected void EnableMessageLogging() /// Note: For more complex tests, and the overloaded /// version of this method /// + /// A function that checks for the condition to be met. + /// An optional TimeoutHelper instance to manage the timeout. If null, the global timeout helper is used. + /// An IEnumerator for use with Unity's coroutine system. + /// Thrown if the checkForCondition function is null. public static IEnumerator WaitForConditionOrTimeOut(Func checkForCondition, TimeoutHelper timeOutHelper = null) { if (checkForCondition == null) @@ -1201,6 +1364,11 @@ public static IEnumerator WaitForConditionOrTimeOut(Func checkForCondition /// Waits for the function condition to return true or it will time out. Uses time travel to simulate this /// for the given number of frames, simulating delta times at the application frame rate. /// + /// A function that checks for the condition to be met. + /// The maximum number of frames to simulate while waiting for the condition to be met. Default is 60. + /// True if the condition is met within the specified number of frames; otherwise, false. + /// Thrown if the checkForCondition function is null. + /// Thrown if time travel is not enabled. public bool WaitForConditionOrTimeOutWithTimeTravel(Func checkForCondition, int maxTries = 60) { if (checkForCondition == null) @@ -1235,9 +1403,13 @@ public bool WaitForConditionOrTimeOutWithTimeTravel(Func checkForCondition } /// - /// This version accepts an IConditionalPredicate implementation to provide + /// This version accepts an implementation to provide /// more flexibility for checking complex conditional cases. /// + /// An implementation of that checks for the condition to be met. + /// An optional TimeoutHelper instance to manage the timeout. If null, the global timeout helper is used. + /// An IEnumerator for use with Unity's coroutine system. + /// Thrown if the conditionalPredicate is null. public static IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate conditionalPredicate, TimeoutHelper timeOutHelper = null) { if (conditionalPredicate == null) @@ -1257,10 +1429,15 @@ public static IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate condit } /// - /// This version accepts an IConditionalPredicate implementation to provide + /// This version accepts an implementation to provide /// more flexibility for checking complex conditional cases. Uses time travel to simulate this /// for the given number of frames, simulating delta times at the application frame rate. /// + /// An implementation of that checks for the condition to be met. + /// The maximum number of frames to simulate while waiting for the condition to be met. Default is 60. + /// True if the condition is met within the specified number of frames; otherwise, false. + /// Thrown if the checkForCondition function is null. + /// Thrown if time travel is not enabled. public bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate conditionalPredicate, int maxTries = 60) { if (conditionalPredicate == null) @@ -1285,6 +1462,7 @@ public bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate condit /// have connected or it will time out. /// /// An array of clients to be checked + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator WaitForClientsConnectedOrTimeOut(NetworkManager[] clientsToCheck) { var remoteClientCount = clientsToCheck.Length; @@ -1301,6 +1479,7 @@ protected IEnumerator WaitForClientsConnectedOrTimeOut(NetworkManager[] clientsT /// for the given number of frames, simulating delta times at the application frame rate. /// /// An array of clients to be checked + /// True if all clients are connected within the specified number of frames; otherwise, false. protected bool WaitForClientsConnectedOrTimeOutWithTimeTravel(NetworkManager[] clientsToCheck) { var remoteClientCount = clientsToCheck.Length; @@ -1309,11 +1488,11 @@ protected bool WaitForClientsConnectedOrTimeOutWithTimeTravel(NetworkManager[] c return WaitForConditionOrTimeOutWithTimeTravel(() => clientsToCheck.Where((c) => c.IsConnectedClient).Count() == remoteClientCount && m_ServerNetworkManager.ConnectedClients.Count == serverClientCount); } - /// /// Overloaded method that just passes in all clients to /// /// + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator WaitForClientsConnectedOrTimeOut() { yield return WaitForClientsConnectedOrTimeOut(m_ClientNetworkManagers); @@ -1324,6 +1503,7 @@ protected IEnumerator WaitForClientsConnectedOrTimeOut() /// Uses time travel to simulate this /// for the given number of frames, simulating delta times at the application frame rate. /// + /// True if all clients are connected within the specified number of frames; otherwise, false. protected bool WaitForClientsConnectedOrTimeOutWithTimeTravel() { return WaitForClientsConnectedOrTimeOutWithTimeTravel(m_ClientNetworkManagers); @@ -1420,8 +1600,12 @@ protected GameObject CreateNetworkObjectPrefab(string baseName) } /// - /// Overloaded method + /// Spawns a GameObject prefab instance. /// + /// The prefab GameObject to spawn. + /// the owner of the instance + /// If true, the spawned object will be destroyed when the scene is unloaded. Default is false. + /// GameObject instance spawned protected GameObject SpawnObject(GameObject prefabGameObject, NetworkManager owner, bool destroyWithScene = false) { var prefabNetworkObject = prefabGameObject.GetComponent(); @@ -1462,8 +1646,13 @@ private GameObject SpawnObject(NetworkObject prefabNetworkObject, NetworkManager } /// - /// Overloaded method + /// Will spawn (x) number of prefab GameObject + /// /// + /// the prefab NetworkObject to spawn + /// the owner of the instance + /// number of instances to create and spawn + /// default is false protected List SpawnObjects(GameObject prefabGameObject, NetworkManager owner, int count, bool destroyWithScene = false) { var prefabNetworkObject = prefabGameObject.GetComponent(); @@ -1498,21 +1687,22 @@ public NetcodeIntegrationTest() } /// - /// Optional Host or Server integration tests - /// Constructor that allows you To break tests up as a host - /// and a server. - /// Example: Decorate your child derived class with TestFixture - /// and then create a constructor at the child level. - /// Don't forget to set your constructor public, else Unity will - /// give you a hard to decipher error + /// Constructor that allows specifying whether the test should run as a host or server. + /// This can be used to break tests up as a host and a server. + /// + /// + /// Decorate your child derived class with TestFixture and then create a constructor at the child level. + /// Don't forget to set your constructor public, else Unity will give you a hard to decipher error. + /// /// [TestFixture(HostOrServer.Host)] /// [TestFixture(HostOrServer.Server)] /// public class MyChildClass : NetcodeIntegrationTest /// { /// public MyChildClass(HostOrServer hostOrServer) : base(hostOrServer) { } /// } - /// - /// + /// + /// + /// Specifies whether the test should run as a host or server. public NetcodeIntegrationTest(HostOrServer hostOrServer) { m_UseHost = hostOrServer == HostOrServer.Host ? true : false; @@ -1522,6 +1712,8 @@ public NetcodeIntegrationTest(HostOrServer hostOrServer) /// Just a helper function to avoid having to write the entire assert just to check if you /// timed out. /// + /// The error message to display if a timeout has occurred. + /// An optional TimeoutHelper instance to check for a timeout. If null, the global timeout helper is used. protected void AssertOnTimeout(string timeOutErrorMessage, TimeoutHelper assignedTimeoutHelper = null) { var timeoutHelper = assignedTimeoutHelper ?? s_GlobalTimeoutHelper; @@ -1592,6 +1784,9 @@ private IEnumerator WaitForTickAndFrames(NetworkManager networkManager, int tick /// /// Yields until specified amount of network ticks and the expected number of frames has been passed. /// + /// The NetworkManager instance to wait for ticks on. + /// The number of network ticks to wait for. + /// An IEnumerator for use with Unity's coroutine system. protected IEnumerator WaitForTicks(NetworkManager networkManager, int count) { var targetTick = networkManager.NetworkTickSystem.LocalTime.Tick + count; @@ -1613,8 +1808,8 @@ protected IEnumerator WaitForTicks(NetworkManager networkManager, int count) /// This will only simulate the netcode update loop, as well as update events on /// NetworkBehaviour instances, and will not simulate any Unity update processes (physics, etc) /// - /// - /// + /// The total amount of time to simulate in seconds. + /// The number of frames to simulate. If less than 0, it will be calculated based on the target frame rate. protected static void TimeTravel(double amountOfTimeInSeconds, int numFramesToSimulate = -1) { if (numFramesToSimulate < 0) @@ -1634,11 +1829,20 @@ protected static void TimeTravel(double amountOfTimeInSeconds, int numFramesToSi } } + /// + /// Gets the tick rate for the integration test. + /// Override this method to specify a custom tick rate for the test. + /// + /// The tick rate to be used for the integration test. protected virtual uint GetTickRate() { return k_DefaultTickRate; } + /// + /// Gets the frame rate for the integration test. + /// + /// The frame rate to be used for the integration test. protected virtual int GetFrameRate() { return Application.targetFrameRate == 0 ? 60 : Application.targetFrameRate; From 0aa9574a63c0b1bab6a8d98cbe1ffc4e53b854c5 Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 3 Mar 2025 12:32:38 -0500 Subject: [PATCH 09/12] Update pvpExceptions.json --- pvpExceptions.json | 116 --------------------------------------------- 1 file changed, 116 deletions(-) diff --git a/pvpExceptions.json b/pvpExceptions.json index 42f9fa6e20..6034a7e54d 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -7,24 +7,6 @@ }, "PVP-150-1": { "errors": [ - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedByMemcpy(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedByMemcpyArray(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_List(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_HashSet(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): unexpected ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedINetworkSerializable(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_UnmanagedINetworkSerializableArray(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_ManagedINetworkSerializable(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_FixedString(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_FixedStringArray(): empty tag", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeEqualityChecker_Dictionary(): XML is not well-formed: End tag 'typeparam' does not match the start tag 'TKey'", - "Unity.Netcode.NetworkObjectReference: .ctor(NetworkObject): empty tag", - "Unity.Netcode.NetworkObjectReference: .ctor(GameObject): empty tag", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void VerboseDebug(string): empty tag", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void CreateServerAndClients(int): empty tag", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: .ctor(HostOrServer): empty tag", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void TimeTravel(double, int): empty tag", "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", @@ -147,14 +129,6 @@ "Unity.Netcode.NetworkVariableUpdateTraits: MaxSecondsBetweenUpdates: undocumented", "Unity.Netcode.NetworkVariableBase: NetworkBehaviour GetBehaviour(): undocumented", "Unity.Netcode.NetworkVariableBase: void MarkNetworkBehaviourDirty(): undocumented", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): missing ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeSerializer_Dictionary(): missing ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeEqualityChecker_Dictionary(): missing ", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeEqualityChecker_Dictionary(): missing ", - "Unity.Netcode.NetworkVariableSerialization: void WriteDelta(FastBufferWriter, ref T, ref T): missing ", - "Unity.Netcode.NetworkVariableSerialization.EqualsDelegate: missing ", - "Unity.Netcode.NetworkVariableSerialization.EqualsDelegate: missing ", - "Unity.Netcode.NetworkVariableSerialization.EqualsDelegate: missing ", "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 ", @@ -221,95 +195,6 @@ "Unity.Netcode.TestHelpers.Runtime.MockTimeProvider: StaticDeltaTime: undocumented", "Unity.Netcode.TestHelpers.Runtime.MockTimeProvider: void TimeTravel(double): undocumented", "Unity.Netcode.TestHelpers.Runtime.MockTimeProvider: void Reset(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: s_GlobalTimeoutHelper: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: s_DefaultWaitForTick: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: NetcodeLogAssert: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void RegisterNetworkObject(NetworkObject): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void DeregisterNetworkObject(NetworkObject): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void DeregisterNetworkObject(ulong, ulong): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: TotalClients: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: k_DefaultTickRate: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: NumberOfClients: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_PlayerPrefab: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_ServerNetworkManager: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_ClientNetworkManagers: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_UseHost: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_TargetFrameRate: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: m_EnableVerboseDebug: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool OnSetVerboseDebug(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: NetworkManagerInstatiationMode OnSetIntegrationTestMode(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnOneTimeSetup(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OneTimeSetup(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator OnSetup(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator SetUp(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnNewClientCreated(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnNewClientStarted(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnNewClientStartedAndConnected(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool ShouldWaitForNewClientToConnect(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool ShouldWaitForNewClientToConnect(NetworkManager): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator CreateAndStartNewClient(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator StopOneClient(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator StopOneClient(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator StopOneClient(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void StopOneClientWithTimeTravel(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void StopOneClientWithTimeTravel(NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void SetTimeTravelSimulatedLatency(float): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void SetTimeTravelSimulatedDropRate(float): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void SetTimeTravelSimulatedLatencyJitter(float): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool CanStartServerAndClients(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator OnStartedServerAndClients(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator OnServerAndClientsConnected(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void ClientNetworkManagerPostStartInit(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: LogAllMessages: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool ShouldCheckForSpawnedPlayers(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator StartServerAndClients(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool CanClientsLoad(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool CanClientsUnload(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool OnCanSceneCleanUpUnload(Scene): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator OnTearDown(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OnInlineTearDown(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator TearDown(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void OneTimeTearDown(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool CanDestroyNetworkObject(NetworkObject): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(Func, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(Func, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(Func, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(Func, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(Func, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(Func, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForConditionOrTimeOut(IConditionalPredicate, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForClientsConnectedOrTimeOut(NetworkManager[]): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForClientsConnectedOrTimeOutWithTimeTravel(NetworkManager[]): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForClientsConnectedOrTimeOut(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: bool WaitForClientsConnectedOrTimeOutWithTimeTravel(): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: GameObject SpawnObject(GameObject, NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: GameObject SpawnObject(GameObject, NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: GameObject SpawnObject(GameObject, NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: GameObject SpawnObject(GameObject, NetworkManager, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: List SpawnObjects(GameObject, NetworkManager, int, bool): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void AssertOnTimeout(string, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: void AssertOnTimeout(string, TimeoutHelper): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForTicks(NetworkManager, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForTicks(NetworkManager, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: IEnumerator WaitForTicks(NetworkManager, int): missing ", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: uint GetTickRate(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest: int GetFrameRate(): undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.NetworkManagerInstatiationMode: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.NetworkManagerInstatiationMode: PerTest: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.NetworkManagerInstatiationMode: AllTests: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.NetworkManagerInstatiationMode: DoNotCreate: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.HostOrServer: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.HostOrServer: Host: undocumented", - "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTest.HostOrServer: Server: undocumented", "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: DefaultMinFrames: undocumented", "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: DefaultTimeout: undocumented", "Unity.Netcode.TestHelpers.Runtime.NetcodeIntegrationTestHelpers: NetworkManagerInstances: undocumented", @@ -2882,7 +2767,6 @@ "Unity.Netcode.RuntimeTests.UniversalRpcTests.UniversalRpcTestsBase: void VerifySentToMeWithParams(ulong, ulong, string, int, bool, float, string): undocumented", "Unity.Netcode.RuntimeTests.UniversalRpcTests.UniversalRpcTestsBase: void VerifySentToNotMeWithParams(ulong, ulong, string, int, bool, float, string): undocumented", "Unity.Netcode.RuntimeTests.UniversalRpcTests.UniversalRpcTestsBase: void RethrowTargetInvocationException(Action): undocumented", - "Unity.Netcode.NetworkVariableSerializationTypes: void InitializeEqualityChecker_Dictionary(): XML is not well-formed: End tag 'typeparam' does not match the start tag 'TKey'", "Unity.Netcode.RuntimeTests.NetworkTransformPacketLossTests: void NetworkTransformMultipleChangesOverTime(TransformSpace, Axis): missing ", "Unity.Netcode.RuntimeTests.NetworkTransformPacketLossTests: void NetworkTransformMultipleChangesOverTime(TransformSpace, Axis): missing ", "Unity.Netcode.RuntimeTests.NetworkTransformTests: void NetworkTransformMultipleChangesOverTime(TransformSpace, OverrideState, Axis): missing ", From 090b6a7b78e5ee0f1e23a6793ecb29ec84986dbe Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 7 Mar 2025 16:43:12 -0500 Subject: [PATCH 10/12] Fix missed issues --- .../Runtime/NetcodeIntegrationTest.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs index 4b28d63e5d..3372857289 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs @@ -320,6 +320,7 @@ protected void VerboseDebug(string msg) /// to troubleshoot a hard to track bug within an /// integration test. /// + /// True if verbose debug logging should be enabled; otherwise, false. protected virtual bool OnSetVerboseDebug() { return false; @@ -376,6 +377,7 @@ public void OneTimeSetup() /// s then override . /// and /// + /// An IEnumerator for use with Unity's coroutine system. protected virtual IEnumerator OnSetup() { yield return null; @@ -396,6 +398,7 @@ protected virtual void OnInlineSetup() /// /// Called before each test is run to perform setup operations. /// + /// An IEnumerator for use with Unity's coroutine system. [UnitySetUp] public IEnumerator SetUp() { @@ -656,7 +659,6 @@ protected IEnumerator StopOneClient(NetworkManager networkManager, bool destroy /// /// The NetworkManager instance of the client to stop. /// If true, the client's NetworkManager GameObject will be destroyed. - /// An IEnumerator for use with Unity's coroutine system. protected void StopOneClientWithTimeTravel(NetworkManager networkManager, bool destroy = false) { NetcodeIntegrationTestHelpers.StopOneClient(networkManager, destroy); @@ -1649,10 +1651,11 @@ private GameObject SpawnObject(NetworkObject prefabNetworkObject, NetworkManager /// Will spawn (x) number of prefab GameObject /// /// - /// the prefab NetworkObject to spawn + /// the prefab GameObject to spawn /// the owner of the instance /// number of instances to create and spawn - /// default is false + /// If true, the spawned objects will be destroyed when the scene is unloaded. Default is false. + /// A list containing the spawned GameObject instances. protected List SpawnObjects(GameObject prefabGameObject, NetworkManager owner, int count, bool destroyWithScene = false) { var prefabNetworkObject = prefabGameObject.GetComponent(); @@ -1661,13 +1664,14 @@ protected List SpawnObjects(GameObject prefabGameObject, NetworkMana } /// - /// Will spawn (x) number of prefab NetworkObjects + /// Will spawn (x) number of prefab NetworkObject /// /// /// the prefab NetworkObject to spawn /// the owner of the instance /// number of instances to create and spawn - /// default is false + /// If true, the spawned objects will be destroyed when the scene is unloaded. Default is false. + /// A list containing the spawned GameObject instances. private List SpawnObjects(NetworkObject prefabNetworkObject, NetworkManager owner, int count, bool destroyWithScene = false) { var gameObjectsSpawned = new List(); @@ -1691,8 +1695,8 @@ public NetcodeIntegrationTest() /// This can be used to break tests up as a host and a server. /// /// - /// Decorate your child derived class with TestFixture and then create a constructor at the child level. - /// Don't forget to set your constructor public, else Unity will give you a hard to decipher error. + /// Decorate your child derived class with TestFixture and then create a constructor at the child level. + /// Don't forget to set your constructor public, else Unity will give you a hard to decipher error. /// /// [TestFixture(HostOrServer.Host)] /// [TestFixture(HostOrServer.Server)] From c16f683421da43ed1462113498323e5f6d0c962d Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 10 Mar 2025 15:47:00 -0400 Subject: [PATCH 11/12] AnticipatedNetworkTransform, HalfVector, NetworkDeltaPosition, and Editor folder --- .../Components/AnticipatedNetworkTransform.cs | 44 +++++++++++++++++++ .../Components/HalfVector3.cs | 2 + .../Components/HalfVector4.cs | 2 + .../Components/NetworkDeltaPosition.cs | 4 ++ .../AnticipatedNetworkTransformEditor.cs | 3 ++ .../NetcodeForGameObjectsProjectSettings.cs | 23 ++++++++++ .../Configuration/NetworkPrefabProcessor.cs | 3 ++ .../Configuration/NetworkPrefabsEditor.cs | 6 +++ .../Editor/NetworkTransformEditor.cs | 7 ++- pvpExceptions.json | 32 -------------- 10 files changed, 93 insertions(+), 33 deletions(-) diff --git a/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs b/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs index 279592184f..d3c0cafb72 100644 --- a/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs @@ -46,10 +46,24 @@ namespace Unity.Netcode.Components [DefaultExecutionOrder(100000)] // this is needed to catch the update time after the transform was updated by user scripts public class AnticipatedNetworkTransform : NetworkTransform { + /// + /// Represents the state of a transform, including position, rotation, and scale. + /// public struct TransformState { + /// + /// The position of the transform. + /// public Vector3 Position; + + /// + /// The rotation of the transform. + /// public Quaternion Rotation; + + /// + /// The scale of the transform. + /// public Vector3 Scale; } @@ -242,6 +256,9 @@ public void AnticipateState(TransformState newState) m_CurrentSmoothTime = 0; } + /// + /// Updates the AnticipatedNetworkTransform each frame. + /// protected override void Update() { // If not spawned or this instance has authority, exit early @@ -350,6 +367,13 @@ private void ResetAnticipatedState() m_CurrentSmoothTime = 0; } + /// + /// Invoked when a new client joins (server and client sides). + /// Server Side: Serializes as if we were teleporting (everything is sent via NetworkTransformState). + /// Client Side: Adds the interpolated state which applies the NetworkTransformState as well. + /// + /// The type of the serializer. + /// The serializer used to serialize the state. protected override void OnSynchronize(ref BufferSerializer serializer) { base.OnSynchronize(ref serializer); @@ -361,6 +385,9 @@ protected override void OnSynchronize(ref BufferSerializer serializer) } } + /// + /// Invoked when the NetworkObject is spawned. + /// public override void OnNetworkSpawn() { base.OnNetworkSpawn(); @@ -373,6 +400,9 @@ public override void OnNetworkSpawn() NetworkManager.AnticipationSystem.AllAnticipatedObjects.Add(m_AnticipatedObject); } + /// + /// Invoked when the NetworkObject is despawned. + /// public override void OnNetworkDespawn() { if (m_AnticipatedObject != null) @@ -387,6 +417,9 @@ public override void OnNetworkDespawn() base.OnNetworkDespawn(); } + /// + /// Invoked when the NetworkObject is destroyed. + /// public override void OnDestroy() { if (m_AnticipatedObject != null) @@ -438,6 +471,9 @@ public void Smooth(TransformState from, TransformState to, float durationSeconds m_CurrentSmoothTime = 0; } + /// + /// Invoked just before the authoritative state is updated and pushed to non-authoritative instances. + /// protected override void OnBeforeUpdateTransformState() { // this is called when new data comes from the server @@ -445,12 +481,20 @@ protected override void OnBeforeUpdateTransformState() m_OutstandingAuthorityChange = true; } + /// + /// Invoked when the NetworkTransform state is updated. + /// + /// The previous state of the NetworkTransform. + /// The new state of the NetworkTransform. protected override void OnNetworkTransformStateUpdated(ref NetworkTransformState oldState, ref NetworkTransformState newState) { base.OnNetworkTransformStateUpdated(ref oldState, ref newState); ApplyAuthoritativeState(); } + /// + /// Invoked whenever the transform has been updated. + /// protected override void OnTransformUpdated() { if (CanCommitToTransform || m_AnticipatedObject == null) diff --git a/com.unity.netcode.gameobjects/Components/HalfVector3.cs b/com.unity.netcode.gameobjects/Components/HalfVector3.cs index 48ae12196f..338feed578 100644 --- a/com.unity.netcode.gameobjects/Components/HalfVector3.cs +++ b/com.unity.netcode.gameobjects/Components/HalfVector3.cs @@ -77,6 +77,8 @@ private void SerializeRead(FastBufferReader reader) /// /// The serialization implementation of . /// + /// The type of the serializer. + /// The serializer used to serialize or deserialize the state. public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { if (serializer.IsReader) diff --git a/com.unity.netcode.gameobjects/Components/HalfVector4.cs b/com.unity.netcode.gameobjects/Components/HalfVector4.cs index 03702f0eed..f9e6f5ce2f 100644 --- a/com.unity.netcode.gameobjects/Components/HalfVector4.cs +++ b/com.unity.netcode.gameobjects/Components/HalfVector4.cs @@ -61,6 +61,8 @@ private void SerializeRead(FastBufferReader reader) /// /// The serialization implementation of . /// + /// The type of the serializer. + /// The serializer used to serialize or deserialize the state. public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { if (serializer.IsReader) diff --git a/com.unity.netcode.gameobjects/Components/NetworkDeltaPosition.cs b/com.unity.netcode.gameobjects/Components/NetworkDeltaPosition.cs index 2ed982d3e3..cd85a06a04 100644 --- a/com.unity.netcode.gameobjects/Components/NetworkDeltaPosition.cs +++ b/com.unity.netcode.gameobjects/Components/NetworkDeltaPosition.cs @@ -30,6 +30,8 @@ public struct NetworkDeltaPosition : INetworkSerializable /// /// The serialization implementation of /// + /// The type of the serializer. + /// The serializer used to serialize or deserialize the state. public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { if (!SynchronizeBase) @@ -105,6 +107,7 @@ public Vector3 GetFullPosition() /// /// Only applies to the authoritative side for instances. /// + /// The current delta position as a with half float precision. [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector3 GetConvertedDelta() { @@ -120,6 +123,7 @@ public Vector3 GetConvertedDelta() /// Precision loss adjustments are one network tick behind on the /// non-authoritative side. /// + /// The current delta position as a . [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector3 GetDeltaPosition() { diff --git a/com.unity.netcode.gameobjects/Editor/AnticipatedNetworkTransformEditor.cs b/com.unity.netcode.gameobjects/Editor/AnticipatedNetworkTransformEditor.cs index 0986808fc4..8202cf425a 100644 --- a/com.unity.netcode.gameobjects/Editor/AnticipatedNetworkTransformEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/AnticipatedNetworkTransformEditor.cs @@ -9,6 +9,9 @@ namespace Unity.Netcode.Editor [CustomEditor(typeof(AnticipatedNetworkTransform), true)] public class AnticipatedNetworkTransformEditor : NetworkTransformEditor { + /// + /// Gets a value indicating whether the interpolate value should be hidden in the inspector. + /// public override bool HideInterpolateValue => true; } } diff --git a/com.unity.netcode.gameobjects/Editor/Configuration/NetcodeForGameObjectsProjectSettings.cs b/com.unity.netcode.gameobjects/Editor/Configuration/NetcodeForGameObjectsProjectSettings.cs index e5d18b6bb8..fea84450db 100644 --- a/com.unity.netcode.gameobjects/Editor/Configuration/NetcodeForGameObjectsProjectSettings.cs +++ b/com.unity.netcode.gameobjects/Editor/Configuration/NetcodeForGameObjectsProjectSettings.cs @@ -3,13 +3,30 @@ namespace Unity.Netcode.Editor.Configuration { + /// + /// Project settings for Netcode for GameObjects. + /// [FilePath("ProjectSettings/NetcodeForGameObjects.asset", FilePathAttribute.Location.ProjectFolder)] public class NetcodeForGameObjectsProjectSettings : ScriptableSingleton { + /// + /// The default path for network prefabs. + /// internal static readonly string DefaultNetworkPrefabsPath = "Assets/DefaultNetworkPrefabs.asset"; + + /// + /// The path to the network prefabs. + /// [SerializeField] public string NetworkPrefabsPath = DefaultNetworkPrefabsPath; + + /// + /// A temporary path to the network prefabs. + /// public string TempNetworkPrefabsPath; + /// + /// Called when the script instance is being loaded. + /// private void OnEnable() { if (NetworkPrefabsPath == "") @@ -19,9 +36,15 @@ private void OnEnable() TempNetworkPrefabsPath = NetworkPrefabsPath; } + /// + /// Indicates whether to generate default network prefabs. + /// [SerializeField] public bool GenerateDefaultNetworkPrefabs = true; + /// + /// Saves the project settings. + /// internal void SaveSettings() { Save(true); diff --git a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabProcessor.cs b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabProcessor.cs index 55f5fcbfc4..b1ad838d77 100644 --- a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabProcessor.cs +++ b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabProcessor.cs @@ -9,6 +9,9 @@ namespace Unity.Netcode.Editor.Configuration /// public class NetworkPrefabProcessor : AssetPostprocessor { + /// + /// Gets or sets the default path for network prefabs. + /// public static string DefaultNetworkPrefabsPath { get diff --git a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs index 0845068be7..9d75dfbff6 100644 --- a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs @@ -4,6 +4,9 @@ namespace Unity.Netcode.Editor { + /// + /// Custom editor for the class. + /// [CustomEditor(typeof(NetworkPrefabsList), true)] [CanEditMultipleObjects] public class NetworkPrefabsEditor : UnityEditor.Editor @@ -11,6 +14,9 @@ public class NetworkPrefabsEditor : UnityEditor.Editor private ReorderableList m_NetworkPrefabsList; private SerializedProperty m_IsDefaultBool; + /// + /// Initializes the custom editor when it is enabled. + /// private void OnEnable() { m_IsDefaultBool = serializedObject.FindProperty(nameof(NetworkPrefabsList.IsDefault)); diff --git a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs index f8bd23f0db..fb52217960 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs @@ -37,9 +37,14 @@ public class NetworkTransformEditor : UnityEditor.Editor private static GUIContent s_RotationLabel = EditorGUIUtility.TrTextContent("Rotation"); private static GUIContent s_ScaleLabel = EditorGUIUtility.TrTextContent("Scale"); + /// + /// Gets a value indicating whether the interpolate value should be hidden in the inspector. + /// public virtual bool HideInterpolateValue => false; - /// + /// + /// Called when the editor is enabled. + /// public void OnEnable() { m_UseUnreliableDeltas = serializedObject.FindProperty(nameof(NetworkTransform.UseUnreliableDeltas)); diff --git a/pvpExceptions.json b/pvpExceptions.json index 6034a7e54d..5ccbf67eab 100644 --- a/pvpExceptions.json +++ b/pvpExceptions.json @@ -15,38 +15,6 @@ }, "PVP-151-1": { "errors": [ - "Unity.Netcode.Components.AnticipatedNetworkTransform: void Update(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnSynchronize(ref BufferSerializer): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnNetworkSpawn(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnNetworkDespawn(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnDestroy(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnBeforeUpdateTransformState(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnNetworkTransformStateUpdated(ref NetworkTransformState, ref NetworkTransformState): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform: void OnTransformUpdated(): undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform.TransformState: undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform.TransformState: Position: undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform.TransformState: Rotation: undocumented", - "Unity.Netcode.Components.AnticipatedNetworkTransform.TransformState: Scale: undocumented", - "Unity.Netcode.Components.HalfVector3: XML is not well-formed: End tag 'remarks' does not match the start tag 'ushort'", - "Unity.Netcode.Components.HalfVector3: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.HalfVector3: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.HalfVector4: XML is not well-formed: End tag 'remarks' does not match the start tag 'ushort'", - "Unity.Netcode.Components.HalfVector4: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.HalfVector4: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.NetworkDeltaPosition: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.NetworkDeltaPosition: void NetworkSerialize(BufferSerializer): missing ", - "Unity.Netcode.Components.NetworkDeltaPosition: Vector3 GetConvertedDelta(): missing ", - "Unity.Netcode.Components.NetworkDeltaPosition: Vector3 GetDeltaPosition(): missing ", - "Unity.Netcode.Editor.AnticipatedNetworkTransformEditor: HideInterpolateValue: undocumented", - "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: undocumented", - "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: NetworkPrefabsPath: undocumented", - "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: TempNetworkPrefabsPath: undocumented", - "Unity.Netcode.Editor.Configuration.NetcodeForGameObjectsProjectSettings: GenerateDefaultNetworkPrefabs: undocumented", - "Unity.Netcode.Editor.Configuration.NetworkPrefabProcessor: DefaultNetworkPrefabsPath: undocumented", - "Unity.Netcode.Editor.NetworkPrefabsEditor: undocumented", - "Unity.Netcode.Editor.NetworkPrefabsEditor: void OnInspectorGUI(): undocumented", - "Unity.Netcode.Editor.NetworkTransformEditor: HideInterpolateValue: undocumented", - "Unity.Netcode.Editor.NetworkTransformEditor: void OnEnable(): missing ", "Unity.Netcode.NetworkConfig: Prefabs: undocumented", "Unity.Netcode.NetworkPrefab: bool Equals(NetworkPrefab): undocumented", "Unity.Netcode.NetworkPrefab: SourcePrefabGlobalObjectIdHash: undocumented", From 657ef1682919b98b5acfc21314e5c9a338806b46 Mon Sep 17 00:00:00 2001 From: Emma Date: Tue, 11 Mar 2025 13:41:41 -0400 Subject: [PATCH 12/12] Add missed function --- .../Editor/Configuration/NetworkPrefabsEditor.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs index 9d75dfbff6..c871fcdcc1 100644 --- a/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/Configuration/NetworkPrefabsEditor.cs @@ -88,6 +88,9 @@ private void OnEnable() m_NetworkPrefabsList.drawHeaderCallback = rect => EditorGUI.LabelField(rect, "NetworkPrefabs"); } + /// + /// Draws the custom inspector GUI for the NetworkPrefabsEditor. + /// public override void OnInspectorGUI() { using (new EditorGUI.DisabledScope(true))