Skip to content

docs: fixes of PVP-150-1 [2.X] #3223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .yamato/package-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ package_pack_-_ngo_{{ platform.name }}:
image: {{ platform.image }}
flavor: {{ platform.flavor }}
timeout: 0.25
variables:
XRAY_PROFILE: "supported ./pvpExceptions.json"
commands:
- npm install -g upm-ci-utils@stable --registry https://artifactory.prd.it.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package pack --package-path com.unity.netcode.gameobjects
- upm-pvp xray --packages "upm-ci~/packages/*.tgz" --results upm-ci~/xray
- upm-pvp require "supported rme com.unity.netcode.gameobjects/pvpExceptions.json" --allow-missing --results upm-ci~/xray --exemptions upm-ci~/xray/new-exemptions.json
- upm-pvp pack "com.unity.netcode.gameobjects" --output upm-ci~/packages
- upm-pvp xray --packages "upm-ci~/packages/com.unity.netcode.gameobjects*.tgz" --results pvp-results
- upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results --allow-missing
artifacts:
logs:
paths:
- "pvp-results/*"
packages:
paths:
- "upm-ci~/**"
Expand Down
20 changes: 18 additions & 2 deletions .yamato/package-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,30 @@ package_test_-_ngo_{{ editor }}_{{ platform.name }}:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor }}
variables:
XRAY_PROFILE: "supported ./pvpExceptions.json"
UNITY_EXT_LOGGING: 1
commands:
- npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- unity-downloader-cli -u {{ editor }} -c Editor --fast --wait
- {% 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"
# Platform specific UTR setup
- |
{% if platform.name == "win" %}
curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
{% else %}
curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr
{% endif %}

# Validate packages.
- upm-pvp test --unity .Editor --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --results pvp-results
- upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results
# Run UTR to test packages.
- upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor
- {% 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
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
- "pvp-results/*"
dependencies:
- .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }}
{% endfor -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Unity.Netcode.Editor
[CanEditMultipleObjects]
public partial class NetcodeEditorBase<TT> : UnityEditor.Editor where TT : MonoBehaviour
{
/// <inheritdoc/>
/// <inheritdoc cref="UnityEditor.Editor.OnEnable"/>
public virtual void OnEnable()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ namespace Unity.Netcode.Components
///
/// <list type="bullet">
///
/// <item><b>Snap:</b> In this mode (with <see cref="StaleDataHandling"/> set to
/// <item><description><b>Snap:</b> In this mode (with <see cref="StaleDataHandling"/> set to
/// <see cref="StaleDataHandling.Ignore"/> and no <see cref="NetworkBehaviour.OnReanticipate"/> callback),
/// the moment a more up-to-date value is received from the authority, it will simply replace the anticipated value,
/// resulting in a "snap" to the new value if it is different from the anticipated value.</item>
/// resulting in a "snap" to the new value if it is different from the anticipated value.</description></item>
///
/// <item><b>Smooth:</b> In this mode (with <see cref="StaleDataHandling"/> set to
/// <item><description><b>Smooth:</b> In this mode (with <see cref="StaleDataHandling"/> set to
/// <see cref="Netcode.StaleDataHandling.Ignore"/> and an <see cref="NetworkBehaviour.OnReanticipate"/> callback that calls
/// <see cref="Smooth"/> from the anticipated value to the authority value with an appropriate
/// <see cref="Mathf.Lerp"/>-style smooth function), when a more up-to-date value is received from the authority,
/// it will interpolate over time from an incorrect anticipated value to the correct authoritative value.</item>
/// it will interpolate over time from an incorrect anticipated value to the correct authoritative value.</description></item>
///
/// <item><b>Constant Reanticipation:</b> In this mode (with <see cref="StaleDataHandling"/> set to
/// <item><description><b>Constant Reanticipation:</b> In this mode (with <see cref="StaleDataHandling"/> set to
/// <see cref="Netcode.StaleDataHandling.Reanticipate"/> and an <see cref="NetworkBehaviour.OnReanticipate"/> that calculates a
/// new anticipated value based on the current authoritative value), when a more up-to-date value is received from
/// the authority, user code calculates a new anticipated value, possibly calling <see cref="Smooth"/> to interpolate
/// between the previous anticipation and the new anticipation. This is useful for values that change frequently and
/// need to constantly be re-evaluated, as opposed to values that change only in response to user action and simply
/// need a one-time anticipation when the user performs that action.</item>
/// need a one-time anticipation when the user performs that action.</description></item>
///
/// </list>
///
Expand Down Expand Up @@ -138,7 +138,7 @@ public bool ShouldReanticipate
/// Anticipate that, at the end of one round trip to the server, this transform will be in the given
/// <see cref="newPosition"/>
/// </summary>
/// <param name="newPosition"></param>
/// <param name="newPosition">The anticipated position</param>
public void AnticipateMove(Vector3 newPosition)
{
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
Expand All @@ -164,7 +164,7 @@ public void AnticipateMove(Vector3 newPosition)
/// Anticipate that, at the end of one round trip to the server, this transform will have the given
/// <see cref="newRotation"/>
/// </summary>
/// <param name="newRotation"></param>
/// <param name="newRotation">The anticipated rotation</param>
public void AnticipateRotate(Quaternion newRotation)
{
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
Expand All @@ -190,7 +190,7 @@ public void AnticipateRotate(Quaternion newRotation)
/// Anticipate that, at the end of one round trip to the server, this transform will have the given
/// <see cref="newScale"/>
/// </summary>
/// <param name="newScale"></param>
/// <param name="newScale">The anticipated scale</param>
public void AnticipateScale(Vector3 newScale)
{
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
Expand All @@ -216,7 +216,7 @@ public void AnticipateScale(Vector3 newScale)
/// Anticipate that, at the end of one round trip to the server, the transform will have the given
/// <see cref="newState"/>
/// </summary>
/// <param name="newState"></param>
/// <param name="newState">The anticipated transform state</param>
public void AnticipateState(TransformState newState)
{
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
Expand Down Expand Up @@ -463,9 +463,9 @@ public override void OnDestroy()
/// <see cref="to"/> over <see cref="durationSeconds"/> of real time. The duration uses
/// <see cref="Time.deltaTime"/>, so it is affected by <see cref="Time.timeScale"/>.
/// </summary>
/// <param name="from"></param>
/// <param name="to"></param>
/// <param name="durationSeconds"></param>
/// <param name="from">Starting transform state</param>
/// <param name="to">Target transform state</param>
/// <param name="durationSeconds">Interpolation time in seconds</param>
public void Smooth(TransformState from, TransformState to, float durationSeconds)
{
var transform_ = transform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void UpdateFrom(ref Vector3 vector3)
/// Constructor
/// </summary>
/// <param name="vector3">The initial axial values (converted to half floats) when instantiated.</param>
/// <param name="vector3AxisToSynchronize">The axis to synchronize.</param>
/// <param name="axisToSynchronize">The axis to synchronize.</param>
public HalfVector3(Vector3 vector3, bool3 axisToSynchronize)
{
Axis = half3.zero;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ protected internal override void OnConvertTransformSpace(Transform transform, bo
}

/// <summary>
/// A <see cref="BufferedLinearInterpolator<T>"/> <see cref="Vector3"/> implementation.
/// A <see cref="BufferedLinearInterpolator{T}"/> <see cref="Vector3"/> implementation.
/// </summary>
public class BufferedLinearInterpolatorVector3 : BufferedLinearInterpolator<Vector3>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1482,9 +1482,8 @@ private bool ShouldSynchronizeHalfFloat(ulong targetClientId)
/// <remarks>
/// If a derived class overrides this, then make sure to invoke this base method!
/// </remarks>
/// <typeparam name="T"></typeparam>
/// <param name="serializer"></param>
/// <param name="targetClientId">the clientId being synchronized (both reading and writing)</param>
/// <typeparam name="T">The serializer type for buffer operations</typeparam>
/// <param name="serializer">The buffer serializer used for network state synchronization</param>
protected override void OnSynchronize<T>(ref BufferSerializer<T> serializer)
{
var targetClientId = m_TargetIdBeingSynchronized;
Expand Down Expand Up @@ -3200,7 +3199,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
/// </summary>
/// <param name="replicatedState"></param>
/// <param name="replicatedState">The NetworkVariable containing the <see cref="NetworkTransformState"/></param>
protected virtual void OnInitialize(ref NetworkVariable<NetworkTransformState> replicatedState)
{

Expand Down Expand Up @@ -3527,11 +3526,11 @@ internal override void InternalOnNetworkObjectParentChanged(NetworkObject parent
/// The parameters are broken up into pos / rot / scale on purpose so that the caller can perturb
/// just the desired one(s)
/// </summary>
/// <param name="posIn"></param> new position to move to. Can be null
/// <param name="rotIn"></param> new rotation to rotate to. Can be null
/// <param name="posIn">new position to move to. Can be null</param>
/// <param name="rotIn">new rotation to rotate to. Can be null</param>
/// <param name="scaleIn">new scale to scale to. Can be null</param>
/// <param name="teleportDisabled">When true (the default) the <see cref="NetworkObject"/> will not be teleported and, if enabled, will interpolate. When false the <see cref="NetworkObject"/> will teleport/apply the parameters provided immediately.</param>
/// <exception cref="Exception"></exception>
/// <exception cref="Exception">Thrown when the function is called on non-spawned object or, when it's called without proper authority</exception>
public void SetState(Vector3? posIn = null, Quaternion? rotIn = null, Vector3? scaleIn = null, bool teleportDisabled = true)
{
if (!IsSpawned)
Expand Down Expand Up @@ -3667,10 +3666,10 @@ private void SetStateServerRpc(Vector3 pos, Quaternion rot, Vector3 scale, bool
/// This is intended to be used on already spawned objects, for setting the position of a dynamically spawned object just apply the transform values prior to spawning. <br />
/// With player objects, override the <see cref="OnNetworkSpawn"/> method and have the authority make adjustments to the transform prior to invoking base.OnNetworkSpawn.
/// </remarks>
/// <param name="newPosition"></param> new position to move to.
/// <param name="newRotation"></param> new rotation to rotate to.
/// <param name="newPosition">new position to move to.</param>
/// <param name="newRotation">new rotation to rotate to.</param>
/// <param name="newScale">new scale to scale to.</param>
/// <exception cref="Exception"></exception>
/// <exception cref="Exception">Thrown when called from a non-authoritative context (client without ownership)</exception>
public void Teleport(Vector3 newPosition, Quaternion newRotation, Vector3 newScale)
{
if (!CanCommitToTransform)
Expand Down Expand Up @@ -3732,7 +3731,7 @@ private void UpdateInterpolation()
}
}

/// <inheritdoc/>
/// <inheritdoc cref="INetworkUpdateSystem.OnUpdate"/>
/// <remarks>
/// If you override this method, be sure that:
/// - Non-authority always invokes this base class method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ internal void OnValidate()
/// <summary>
/// Returns a base64 encoded version of the configuration
/// </summary>
/// <returns></returns>
/// <returns>base64 encoded string containing the serialized network configuration</returns>
public string ToBase64()
{
NetworkConfig config = this;
Expand Down Expand Up @@ -271,8 +271,8 @@ internal void ClearConfigHash()
/// <summary>
/// Gets a SHA256 hash of parts of the NetworkConfig instance
/// </summary>
/// <param name="cache"></param>
/// <returns></returns>
/// <param name="cache">When true, caches the computed hash value for future retrievals, when false, always recomputes the hash</param>
/// <returns>A 64-bit hash value representing the configuration state</returns>
public ulong GetConfig(bool cache = true)
{
if (m_ConfigHash != null && cache)
Expand Down Expand Up @@ -316,8 +316,11 @@ public ulong GetConfig(bool cache = true)
/// <summary>
/// Compares a SHA256 hash with the current NetworkConfig instances hash
/// </summary>
/// <param name="hash"></param>
/// <returns></returns>
/// <param name="hash">The 64-bit hash value to compare against this configuration's hash</param>
/// <returns>
/// True if the hashes match, indicating compatible configurations.
/// False if the hashes differ, indicating potentially incompatible configurations.
/// </returns>
public bool CompareConfig(ulong hash)
{
return hash == GetConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class NetworkPrefabsList : ScriptableObject
/// Adds a prefab to the prefab list. Performing this here will apply the operation to all
/// <see cref="NetworkManager"/>s that reference this list.
/// </summary>
/// <param name="prefab"></param>
/// <param name="prefab">The NetworkPrefab to add to the shared list</param>
public void Add(NetworkPrefab prefab)
{
List.Add(prefab);
Expand All @@ -49,7 +49,7 @@ public void Add(NetworkPrefab prefab)
/// Removes a prefab from the prefab list. Performing this here will apply the operation to all
/// <see cref="NetworkManager"/>s that reference this list.
/// </summary>
/// <param name="prefab"></param>
/// <param name="prefab">The NetworkPrefab to remove from the shared list</param>
public void Remove(NetworkPrefab prefab)
{
List.Remove(prefab);
Expand Down
Loading