Skip to content

Commit fab4b56

Browse files
docs: [Backport] fixes of PVP-150-1 [1.X] (#3292)
* Fixes of PVP-150-1 * Remaining fixes * update Updating some of the missing XML API documentation. * Deleted fixed pvp 150-1 exceptions * Moved pvpExceptions file and modified pack and test commands * Added missing artifacts * Corrected utr command * Removed unnecessary pvpExtension * Extended 151-1 exceptions * More API docs fixes * Updated pvpExceptions file --------- Co-authored-by: NoelStephensUnity <[email protected]>
1 parent 215dda2 commit fab4b56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3295
-1356
lines changed

.yamato/package-pack.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ package_pack_-_ngo_{{ platform.name }}:
1212
image: {{ platform.image }}
1313
flavor: {{ platform.flavor }}
1414
timeout: 0.25
15+
variables:
16+
XRAY_PROFILE: "supported ./pvpExceptions.json"
1517
commands:
16-
- npm install -g upm-ci-utils@stable --registry https://artifactory.prd.it.unity3d.com/artifactory/api/npm/upm-npm
17-
- upm-ci package pack --package-path com.unity.netcode.gameobjects
18-
- upm-pvp xray --packages "upm-ci~/packages/*.tgz" --results upm-ci~/xray
19-
- upm-pvp require "supported rme com.unity.netcode.gameobjects/pvpExceptions.json" --allow-missing --results upm-ci~/xray --exemptions upm-ci~/xray/new-exemptions.json
18+
- upm-pvp pack "com.unity.netcode.gameobjects" --output upm-ci~/packages
19+
- upm-pvp xray --packages "upm-ci~/packages/com.unity.netcode.gameobjects*.tgz" --results pvp-results
20+
- upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results --allow-missing
2021
artifacts:
22+
logs:
23+
paths:
24+
- "pvp-results/*"
2125
packages:
2226
paths:
2327
- "upm-ci~/**"

.yamato/package-tests.yml

+18-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,30 @@ package_test_-_ngo_{{ editor }}_{{ platform.name }}:
1212
type: {{ platform.type }}
1313
image: {{ platform.image }}
1414
flavor: {{ platform.flavor }}
15+
variables:
16+
XRAY_PROFILE: "supported ./pvpExceptions.json"
17+
UNITY_EXT_LOGGING: 1
1518
commands:
16-
- npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
1719
- unity-downloader-cli -u {{ editor }} -c Editor --fast --wait
18-
- {% if platform.name == "ubuntu" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor }} --package-path com.unity.netcode.gameobjects --type package-tests --extra-utr-arg="--extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun"
20+
# Platform specific UTR setup
21+
- |
22+
{% if platform.name == "win" %}
23+
curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
24+
{% else %}
25+
curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr
26+
{% endif %}
27+
28+
# Validate packages.
29+
- upm-pvp test --unity .Editor --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --results pvp-results
30+
- upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results
31+
# Run UTR to test packages.
32+
- upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor
33+
- {% if platform.name == "ubuntu" %}DISPLAY=:0 {% endif %} {% if platform.name == "win" %} utr.bat {% else %} ./utr {% endif %} --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --artifacts-path=test-results "--ff={ops.upmpvpevidence.enable=true}" --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun
1934
artifacts:
2035
logs:
2136
paths:
2237
- "upm-ci~/test-results/**/*"
38+
- "pvp-results/*"
2339
dependencies:
2440
- .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }}
2541
{% endfor -%}

com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs

+13-13
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ namespace Unity.Netcode.Components
1313
///
1414
/// <list type="bullet">
1515
///
16-
/// <item><b>Snap:</b> In this mode (with <see cref="StaleDataHandling"/> set to
16+
/// <item><description><b>Snap:</b> In this mode (with <see cref="StaleDataHandling"/> set to
1717
/// <see cref="StaleDataHandling.Ignore"/> and no <see cref="NetworkBehaviour.OnReanticipate"/> callback),
1818
/// the moment a more up-to-date value is received from the authority, it will simply replace the anticipated value,
19-
/// resulting in a "snap" to the new value if it is different from the anticipated value.</item>
19+
/// resulting in a "snap" to the new value if it is different from the anticipated value.</description></item>
2020
///
21-
/// <item><b>Smooth:</b> In this mode (with <see cref="StaleDataHandling"/> set to
21+
/// <item><description><b>Smooth:</b> In this mode (with <see cref="StaleDataHandling"/> set to
2222
/// <see cref="Netcode.StaleDataHandling.Ignore"/> and an <see cref="NetworkBehaviour.OnReanticipate"/> callback that calls
2323
/// <see cref="Smooth"/> from the anticipated value to the authority value with an appropriate
2424
/// <see cref="Mathf.Lerp"/>-style smooth function), when a more up-to-date value is received from the authority,
25-
/// it will interpolate over time from an incorrect anticipated value to the correct authoritative value.</item>
25+
/// it will interpolate over time from an incorrect anticipated value to the correct authoritative value.</description></item>
2626
///
27-
/// <item><b>Constant Reanticipation:</b> In this mode (with <see cref="StaleDataHandling"/> set to
27+
/// <item><description><b>Constant Reanticipation:</b> In this mode (with <see cref="StaleDataHandling"/> set to
2828
/// <see cref="Netcode.StaleDataHandling.Reanticipate"/> and an <see cref="NetworkBehaviour.OnReanticipate"/> that calculates a
2929
/// new anticipated value based on the current authoritative value), when a more up-to-date value is received from
3030
/// the authority, user code calculates a new anticipated value, possibly calling <see cref="Smooth"/> to interpolate
3131
/// between the previous anticipation and the new anticipation. This is useful for values that change frequently and
3232
/// need to constantly be re-evaluated, as opposed to values that change only in response to user action and simply
33-
/// need a one-time anticipation when the user performs that action.</item>
33+
/// need a one-time anticipation when the user performs that action.</description></item>
3434
///
3535
/// </list>
3636
///
@@ -135,7 +135,7 @@ public bool ShouldReanticipate
135135
/// Anticipate that, at the end of one round trip to the server, this transform will be in the given
136136
/// <see cref="newPosition"/>
137137
/// </summary>
138-
/// <param name="newPosition"></param>
138+
/// <param name="newPosition">The anticipated position</param>
139139
public void AnticipateMove(Vector3 newPosition)
140140
{
141141
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
@@ -162,7 +162,7 @@ public void AnticipateMove(Vector3 newPosition)
162162
/// Anticipate that, at the end of one round trip to the server, this transform will have the given
163163
/// <see cref="newRotation"/>
164164
/// </summary>
165-
/// <param name="newRotation"></param>
165+
/// <param name="newRotation">The anticipated rotation</param>
166166
public void AnticipateRotate(Quaternion newRotation)
167167
{
168168
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
@@ -189,7 +189,7 @@ public void AnticipateRotate(Quaternion newRotation)
189189
/// Anticipate that, at the end of one round trip to the server, this transform will have the given
190190
/// <see cref="newScale"/>
191191
/// </summary>
192-
/// <param name="newScale"></param>
192+
/// <param name="newScale">The anticipated scale</param>
193193
public void AnticipateScale(Vector3 newScale)
194194
{
195195
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
@@ -216,7 +216,7 @@ public void AnticipateScale(Vector3 newScale)
216216
/// Anticipate that, at the end of one round trip to the server, the transform will have the given
217217
/// <see cref="newState"/>
218218
/// </summary>
219-
/// <param name="newState"></param>
219+
/// <param name="newState">The anticipated transform state</param>
220220
public void AnticipateState(TransformState newState)
221221
{
222222
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
@@ -405,9 +405,9 @@ public override void OnDestroy()
405405
/// <see cref="to"/> over <see cref="durationSeconds"/> of real time. The duration uses
406406
/// <see cref="Time.deltaTime"/>, so it is affected by <see cref="Time.timeScale"/>.
407407
/// </summary>
408-
/// <param name="from"></param>
409-
/// <param name="to"></param>
410-
/// <param name="durationSeconds"></param>
408+
/// <param name="from">Starting transform state</param>
409+
/// <param name="to">Target transform state</param>
410+
/// <param name="durationSeconds">Interpolation time in seconds</param>
411411
public void Smooth(TransformState from, TransformState to, float durationSeconds)
412412
{
413413
var transform_ = transform;

com.unity.netcode.gameobjects/Components/HalfVector3.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Unity.Netcode.Components
88
/// Half float precision <see cref="Vector3"/>.
99
/// </summary>
1010
/// <remarks>
11-
/// The Vector3T<ushort> values are half float values returned by <see cref="Mathf.FloatToHalf(float)"/> for each
11+
/// The Vector3T{ushort} values are half float values returned by <see cref="Mathf.FloatToHalf(float)"/> for each
1212
/// individual axis and the 16 bits of the half float are stored as <see cref="ushort"/> values since C# does not have
1313
/// a half float type.
1414
/// </remarks>
@@ -129,7 +129,7 @@ public void UpdateFrom(ref Vector3 vector3)
129129
/// Constructor
130130
/// </summary>
131131
/// <param name="vector3">The initial axial values (converted to half floats) when instantiated.</param>
132-
/// <param name="vector3AxisToSynchronize">The axis to synchronize.</param>
132+
/// <param name="axisToSynchronize">The axis to synchronize.</param>
133133
public HalfVector3(Vector3 vector3, bool3 axisToSynchronize)
134134
{
135135
Axis = half3.zero;

com.unity.netcode.gameobjects/Components/HalfVector4.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Unity.Netcode.Components
88
/// Half Precision <see cref="Vector4"/> that can also be used to convert a <see cref="Quaternion"/> to half precision.
99
/// </summary>
1010
/// <remarks>
11-
/// The Vector4T<ushort> values are half float values returned by <see cref="Mathf.FloatToHalf(float)"/> for each
11+
/// The Vector4T{ushort} values are half float values returned by <see cref="Mathf.FloatToHalf(float)"/> for each
1212
/// individual axis and the 16 bits of the half float are stored as <see cref="ushort"/> values since C# does not have
1313
/// a half float type.
1414
/// </remarks>

com.unity.netcode.gameobjects/Components/Interpolator/BufferedLinearInterpolator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ protected override Quaternion Interpolate(Quaternion start, Quaternion end, floa
352352
}
353353

354354
/// <summary>
355-
/// A <see cref="BufferedLinearInterpolator<T>"/> <see cref="Vector3"/> implementation.
355+
/// A <see cref="BufferedLinearInterpolator{T}"/> <see cref="Vector3"/> implementation.
356356
/// </summary>
357357
public class BufferedLinearInterpolatorVector3 : BufferedLinearInterpolator<Vector3>
358358
{

com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class NetworkTransformEditor : UnityEditor.Editor
3939

4040
public virtual bool HideInterpolateValue => false;
4141

42-
/// <inheritdoc/>
42+
/// <inheritdoc cref="UnityEditor.Editor.OnEnable"/>
4343
public void OnEnable()
4444
{
4545
m_UseUnreliableDeltas = serializedObject.FindProperty(nameof(NetworkTransform.UseUnreliableDeltas));

com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs

+8-5
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public class NetworkConfig
152152
/// <summary>
153153
/// Returns a base64 encoded version of the configuration
154154
/// </summary>
155-
/// <returns></returns>
155+
/// <returns>base64 encoded string containing the serialized network configuration</returns>
156156
public string ToBase64()
157157
{
158158
NetworkConfig config = this;
@@ -219,8 +219,8 @@ internal void ClearConfigHash()
219219
/// <summary>
220220
/// Gets a SHA256 hash of parts of the NetworkConfig instance
221221
/// </summary>
222-
/// <param name="cache"></param>
223-
/// <returns></returns>
222+
/// <param name="cache">When true, caches the computed hash value for future retrievals, when false, always recomputes the hash</param>
223+
/// <returns>A 64-bit hash value representing the configuration state</returns>
224224
public ulong GetConfig(bool cache = true)
225225
{
226226
if (m_ConfigHash != null && cache)
@@ -264,8 +264,11 @@ public ulong GetConfig(bool cache = true)
264264
/// <summary>
265265
/// Compares a SHA256 hash with the current NetworkConfig instances hash
266266
/// </summary>
267-
/// <param name="hash"></param>
268-
/// <returns></returns>
267+
/// <param name="hash">The 64-bit hash value to compare against this configuration's hash</param>
268+
/// <returns>
269+
/// True if the hashes match, indicating compatible configurations.
270+
/// False if the hashes differ, indicating potentially incompatible configurations.
271+
/// </returns>
269272
public bool CompareConfig(ulong hash)
270273
{
271274
return hash == GetConfig();

com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabsList.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class NetworkPrefabsList : ScriptableObject
3838
/// Adds a prefab to the prefab list. Performing this here will apply the operation to all
3939
/// <see cref="NetworkManager"/>s that reference this list.
4040
/// </summary>
41-
/// <param name="prefab"></param>
41+
/// <param name="prefab">The NetworkPrefab to add to the shared list</param>
4242
public void Add(NetworkPrefab prefab)
4343
{
4444
List.Add(prefab);
@@ -49,7 +49,7 @@ public void Add(NetworkPrefab prefab)
4949
/// Removes a prefab from the prefab list. Performing this here will apply the operation to all
5050
/// <see cref="NetworkManager"/>s that reference this list.
5151
/// </summary>
52-
/// <param name="prefab"></param>
52+
/// <param name="prefab">The NetworkPrefab to remove from the shared list</param>
5353
public void Remove(NetworkPrefab prefab)
5454
{
5555
List.Remove(prefab);

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

+15-13
Original file line numberDiff line numberDiff line change
@@ -480,15 +480,19 @@ public struct ConnectionApprovalRequest
480480
/// <summary>
481481
/// This callback is invoked once the local server is stopped.
482482
/// </summary>
483-
/// <remarks>The bool parameter will be set to true when stopping a host instance and false when stopping a server instance.</remarks>
484-
/// <param name="arg1">The first parameter of this event will be set to <see cref="true"/> when stopping a host instance and <see cref="false"/> when stopping a server instance.</param>
483+
/// <remarks>
484+
/// The bool parameter will be set to true when stopping a host instance and false when stopping a server instance.
485+
/// The first parameter of this event will be set to <see cref="true"/> when stopping a host instance and <see cref="false"/> when stopping a server instance.
486+
/// </remarks>
485487
public event Action<bool> OnServerStopped = null;
486488

487489
/// <summary>
488490
/// The callback to invoke once the local client stops.
489491
/// </summary>
490-
/// <remarks>The bool parameter will be set to true when stopping a host client and false when stopping a standard client instance.</remarks>
491-
/// <param name="arg1">The first parameter of this event will be set to <see cref="true"/> when stopping the host client and <see cref="false"/> when stopping a standard client instance.</param>
492+
/// <remarks>
493+
/// The bool parameter will be set to true when stopping a host client and false when stopping a standard client instance.
494+
/// The first parameter of this event will be set to <see cref="true"/> when stopping the host client and <see cref="false"/> when stopping a standard client instance.
495+
/// </remarks>
492496
public event Action<bool> OnClientStopped = null;
493497

494498
/// <summary>
@@ -757,14 +761,14 @@ private void OnEnable()
757761
/// <summary>
758762
/// <see cref="NetworkPrefabHandler.AddNetworkPrefab(GameObject)"/>
759763
/// </summary>
760-
/// <param name="prefab"></param>
761-
/// <exception cref="Exception"></exception>
764+
/// <param name="prefab">The GameObject prefab to be registered. Must not be null and must have a NetworkObject component.</param>
765+
/// <exception cref="Exception">Thrown when the prefab is null or missing required components.</exception>
762766
public void AddNetworkPrefab(GameObject prefab) => PrefabHandler.AddNetworkPrefab(prefab);
763767

764768
/// <summary>
765769
/// <see cref="NetworkPrefabHandler.RemoveNetworkPrefab(GameObject)"/>
766770
/// </summary>
767-
/// <param name="prefab"></param>
771+
/// <param name="prefab">The GameObject prefab to be unregistered. Must not be null and must have been previously registered.</param>
768772
public void RemoveNetworkPrefab(GameObject prefab) => PrefabHandler.RemoveNetworkPrefab(prefab);
769773

770774
/// <summary>
@@ -776,7 +780,6 @@ private void OnEnable()
776780
/// and thus should be large enough to ensure it can hold each message type.
777781
/// This value defaults to 1296.
778782
/// </summary>
779-
/// <param name="size"></param>
780783
public int MaximumTransmissionUnitSize
781784
{
782785
set => MessageManager.NonFragmentedMessageMaxSize = value & ~7; // Round down to nearest word aligned size
@@ -788,8 +791,8 @@ public int MaximumTransmissionUnitSize
788791
/// This determines the maximum size of a message batch that can be sent to that client.
789792
/// If not set for any given client, <see cref="MaximumTransmissionUnitSize"/> will be used instead.
790793
/// </summary>
791-
/// <param name="clientId"></param>
792-
/// <param name="size"></param>
794+
/// <param name="clientId">The unique identifier of the client to set the MTU for.</param>
795+
/// <param name="size">The maximum transmission unit size in bytes for this specific client.</param>
793796
public void SetPeerMTU(ulong clientId, int size)
794797
{
795798
MessageManager.PeerMTUSizes[clientId] = size;
@@ -799,8 +802,8 @@ public void SetPeerMTU(ulong clientId, int size)
799802
/// Queries the current MTU size for a client.
800803
/// If no MTU has been set for that client, will return <see cref="MaximumTransmissionUnitSize"/>
801804
/// </summary>
802-
/// <param name="clientId"></param>
803-
/// <returns></returns>
805+
/// <param name="clientId">The unique identifier of the client to query.</param>
806+
/// <returns>The MTU size in bytes for the specified client. If no MTU has been set for that client, returns <see cref="MaximumTransmissionUnitSize"/>.</returns>
804807
public int GetPeerMTU(ulong clientId)
805808
{
806809
if (MessageManager.PeerMTUSizes.TryGetValue(clientId, out var ret))
@@ -815,7 +818,6 @@ public int GetPeerMTU(ulong clientId)
815818
/// Sets the maximum size of a message (or message batch) passed through the transport with the ReliableFragmented delivery.
816819
/// Warning: setting this value too low may result in the SDK becoming non-functional with projects that have a large number of NetworkBehaviours or NetworkVariables, as the SDK relies on the transport's ability to fragment some messages when they grow beyond the MTU size.
817820
/// </summary>
818-
/// <param name="size"></param>
819821
public int MaximumFragmentedMessageSize
820822
{
821823
set => MessageManager.FragmentedMessageMaxSize = value;

0 commit comments

Comments
 (0)