Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 7 additions & 21 deletions .yamato/_run-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ run_all_package_tests_{{ validation_editors.default }}:
name: Run All Package Tests [{{ validation_editors.default }} only]
dependencies:
{% for platform in test_platforms.desktop -%}
{% for editor in validation_editors.default -%}
- .yamato/package-tests.yml#package_test_-_ngo_{{ editor }}_{{ platform.name }}
{% endfor -%}
- .yamato/package-tests.yml#package_test_-_ngo_{{ validation_editors.default }}_{{ platform.name }}
{% endfor -%}

# Runs all package tests on minimal supported editor
Expand Down Expand Up @@ -71,9 +69,7 @@ run_all_project_tests_{{ validation_editors.default }}:
{% for project in projects.all -%}
{% if project.has_tests == "true" -%}
{% for platform in test_platforms.desktop -%}
{% for editor in validation_editors.default -%}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.default }}
{% endfor -%}
{% endif -%}
{% endfor -%}
Expand All @@ -97,9 +93,7 @@ run_all_projects_standards:
dependencies:
{% for platform in test_platforms.default -%}
{% for project in projects.all -%}
{% for editor in validation_editors.default -%}
- .yamato/project-standards.yml#standards_{{ platform.name }}_{{ project.name }}_{{ editor }}
{% endfor -%}
- .yamato/project-standards.yml#standards_{{ platform.name }}_{{ project.name }}_{{ validation_editors.default }}
{% endfor -%}
{% endfor -%}

Expand All @@ -123,9 +117,7 @@ run_all_webgl_builds_{{ validation_editors.default }}:
dependencies:
{% for project in projects.default -%}
{% for platform in test_platforms.desktop -%}
{% for editor in validation_editors.default -%}
- .yamato/webgl-build.yml#webgl_build_{{ project.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
- .yamato/webgl-build.yml#webgl_build_{{ project.name }}_{{ platform.name }}_{{ validation_editors.default }}
{% endfor -%}
{% endfor -%}

Expand Down Expand Up @@ -161,10 +153,8 @@ run_all_project_tests_desktop_standalone_{{ validation_editors.default }}:
dependencies:
{% for project in projects.default -%}
{% for platform in test_platforms.desktop -%}
{% for editor in validation_editors.default -%}
{% for backend in scripting_backends -%}
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}
{% endfor -%}
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ validation_editors.default }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
Expand Down Expand Up @@ -200,9 +190,7 @@ run_all_project_tests_mobile_standalone_{{ validation_editors.default }}:
dependencies:
{% for project in projects.default -%}
{% for platform in test_platforms.mobile_test -%}
{% for editor in validation_editors.default -%}
- .yamato/mobile-standalone-test.yml#mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
- .yamato/mobile-standalone-test.yml#mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.default }}
{% endfor -%}
{% endfor -%}

Expand Down Expand Up @@ -236,9 +224,7 @@ run_all_project_tests_console_standalone_{{ validation_editors.default }}:
dependencies:
{% for project in projects.default -%}
{% for platform in test_platforms.console_test -%}
{% for editor in validation_editors.default -%}
- .yamato/console-standalone-test.yml#console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
- .yamato/console-standalone-test.yml#console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.default }}
{% endfor -%}
{% endfor -%}

Expand Down
5 changes: 0 additions & 5 deletions .yamato/_triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ pr_code_changes_checks:
cancel_old_ci: true







# Run all tests on {{ validation_editors.default }} (latest supported editor) on nightly basis.
# Same subset as pull_request_trigger with addition of mobile/desktop/console tests and webgl builds
# Those tests are all running on {{ validation_editors.default }} (latest supported editor) since it's daily and running all of them would add a lot of overhead
Expand Down
5 changes: 3 additions & 2 deletions .yamato/project-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ standards_{{ platform.name }}_{{ project.name }}_{{ editor }}:
- dotnet format --version

- unity-downloader-cli --fast --wait -u {{ editor }} -c editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloads basic editor

- .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit # This command is used to invoke Unity in a "headless" mode. It's used to sync the project
- dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --check # Runs standards check
- dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix # Auto-fix formatting issues
- git checkout -- {{ project.path }}/Packages/manifest.json {{ project.path }}/Packages/packages-lock.json {{ project.path }}/ProjectSettings/ProjectVersion.txt 2>/dev/null || true # Restore files that Unity may have modified (we only want to check code formatting)
- 'git diff --exit-code || (echo "ERROR: Code formatting issues found. Run dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix locally and commit the changes." && exit 1)' # Fail if formatter made any changes
{% endfor -%}
{% endfor -%}
{% endfor -%}
6 changes: 3 additions & 3 deletions .yamato/project.metafile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
small_agent_platform:
- name: ubuntu
type: Unity::VM
image: package-ci/ubuntu-22.04:v4.77.0
image: package-ci/ubuntu-22.04:v4.81.0
flavor: b1.small


Expand All @@ -38,13 +38,13 @@ test_platforms:
default:
- name: ubuntu
type: Unity::VM
image: package-ci/ubuntu-22.04:v4.77.0
image: package-ci/ubuntu-22.04:v4.81.0
flavor: b1.large
standalone: StandaloneLinux64
desktop:
- name: ubuntu
type: Unity::VM
image: package-ci/ubuntu-22.04:v4.77.0
image: package-ci/ubuntu-22.04:v4.81.0
flavor: b1.large
smaller_flavor: b1.medium
standalone: StandaloneLinux64
Expand Down
2 changes: 1 addition & 1 deletion .yamato/wrench/wrench_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"InternalOnly": false,
"NeverPublish": false,
"MaxEditorVersion": "6000.2",
"MaxEditorVersion": "6000.0",
"coverageEnabled": false,
"coverageCommands": [
"generateAdditionalMetrics;generateHtmlReport;assemblyFilters:ASSEMBLY_NAME;pathReplacePatterns:@*,,**/PackageCache/,;sourcePaths:YAMATO_SOURCE_DIR/Packages;"
Expand Down
2 changes: 1 addition & 1 deletion Tools/CI/Settings/NGOSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class NGOSettings : AnnotatedSettingsBase
new PackageOptions()
{
ReleaseOptions = new ReleaseOptions() { IsReleasing = true },
MaximumEditorVersion = "6000.2", // NGOv1.X will be deprecated in 6000.3+ so we won't run tests on higher editor versions
MaximumEditorVersion = "6000.0", // NGOv1.X will be deprecated in 6000.3+ so we won't run tests on higher editor versions
ValidationOptions = validationOptions
}
}
Expand Down
7 changes: 2 additions & 5 deletions com.unity.netcode.gameobjects/Components/NetworkAnimator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,8 @@ static AnimationParamEnumWrapper()
/// </summary>
private void SpawnCleanup()
{
if (m_NetworkAnimatorStateChangeHandler != null)
{
m_NetworkAnimatorStateChangeHandler.DeregisterUpdate();
m_NetworkAnimatorStateChangeHandler = null;
}
m_NetworkAnimatorStateChangeHandler?.DeregisterUpdate();
m_NetworkAnimatorStateChangeHandler = null;
}

public override void OnDestroy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3385,6 +3385,6 @@ private static void DeregisterForTickUpdate(NetworkTransform networkTransform)

internal interface INetworkTransformLogStateEntry
{
void AddLogEntry(NetworkTransform.NetworkTransformState networkTransformState, ulong targetClient, bool preUpdate = false);
public void AddLogEntry(NetworkTransform.NetworkTransformState networkTransformState, ulong targetClient, bool preUpdate = false);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma warning disable IDE0005
using Unity.Netcode.Components;
#pragma warning restore IDE0005
#if UNITY_UNET_PRESENT
using Unity.Netcode.Transports.UNET;
#endif
Expand Down
11 changes: 4 additions & 7 deletions com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ internal T Value
/// </summary>
internal interface INetworkManagerHelper
{
bool NotifyUserOfNestedNetworkManager(NetworkManager networkManager, bool ignoreNetworkManagerCache = false, bool editorTest = false);
void CheckAndNotifyUserNetworkObjectRemoved(NetworkManager networkManager, bool editorTest = false);
public bool NotifyUserOfNestedNetworkManager(NetworkManager networkManager, bool ignoreNetworkManagerCache = false, bool editorTest = false);
public void CheckAndNotifyUserNetworkObjectRemoved(NetworkManager networkManager, bool editorTest = false);
}

internal delegate void ResetNetworkManagerDelegate(NetworkManager manager);
Expand Down Expand Up @@ -1255,11 +1255,8 @@ internal void ShutdownInternal()

CustomMessagingManager = null;

if (MessageManager != null)
{
MessageManager.Dispose();
MessageManager = null;
}
MessageManager?.Dispose();
MessageManager = null;

// We need to clean up NetworkObjects before we reset the IsServer
// and IsClient properties. This provides consistency of these two
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface INetworkUpdateSystem
/// The update method that is being executed in the context of related <see cref="NetworkUpdateStage"/>.
/// </summary>
/// <param name="updateStage">The <see cref="NetworkUpdateStage"/> that is being executed.</param>
void NetworkUpdate(NetworkUpdateStage updateStage);
public void NetworkUpdate(NetworkUpdateStage updateStage);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ internal enum TriggerType
/// There is a one second maximum lifetime of triggers to avoid memory leaks. After one second has passed
/// without the requested object ID being spawned, the triggers for it are automatically deleted.
/// </summary>
void DeferMessage(TriggerType trigger, ulong key, FastBufferReader reader, ref NetworkContext context);
public void DeferMessage(TriggerType trigger, ulong key, FastBufferReader reader, ref NetworkContext context);

/// <summary>
/// Cleans up any trigger that's existed for more than a second.
/// These triggers were probably for situations where a request was received after a despawn rather than before a spawn.
/// </summary>
void CleanupStaleTriggers();
public void CleanupStaleTriggers();

void ProcessTriggers(TriggerType trigger, ulong key);
public void ProcessTriggers(TriggerType trigger, ulong key);

/// <summary>
/// Cleans up any trigger that's existed for more than a second.
/// These triggers were probably for situations where a request was received after a despawn rather than before a spawn.
/// </summary>
void CleanupAllTriggers();
public void CleanupAllTriggers();
}
}
24 changes: 12 additions & 12 deletions com.unity.netcode.gameobjects/Runtime/Messaging/INetworkHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal interface INetworkHooks
/// <param name="clientId">The destination clientId</param>
/// <param name="message">The message being sent</param>
/// <param name="delivery"></param>
void OnBeforeSendMessage<T>(ulong clientId, ref T message, NetworkDelivery delivery) where T : INetworkMessage;
public void OnBeforeSendMessage<T>(ulong clientId, ref T message, NetworkDelivery delivery) where T : INetworkMessage;

/// <summary>
/// Called after an individual message is sent.
Expand All @@ -24,23 +24,23 @@ internal interface INetworkHooks
/// <param name="message">The message being sent</param>
/// <param name="delivery"></param>
/// <param name="messageSizeBytes">Number of bytes in the message, not including the message header</param>
void OnAfterSendMessage<T>(ulong clientId, ref T message, NetworkDelivery delivery, int messageSizeBytes) where T : INetworkMessage;
public void OnAfterSendMessage<T>(ulong clientId, ref T message, NetworkDelivery delivery, int messageSizeBytes) where T : INetworkMessage;

/// <summary>
/// Called before an individual message is received.
/// </summary>
/// <param name="senderId">The source clientId</param>
/// <param name="messageType">The type of the message being sent</param>
/// <param name="messageSizeBytes">Number of bytes in the message, not including the message header</param>
void OnBeforeReceiveMessage(ulong senderId, Type messageType, int messageSizeBytes);
public void OnBeforeReceiveMessage(ulong senderId, Type messageType, int messageSizeBytes);

/// <summary>
/// Called after an individual message is received.
/// </summary>
/// <param name="senderId">The source clientId</param>
/// <param name="messageType">The type of the message being sent</param>
/// <param name="messageSizeBytes">Number of bytes in the message, not including the message header</param>
void OnAfterReceiveMessage(ulong senderId, Type messageType, int messageSizeBytes);
public void OnAfterReceiveMessage(ulong senderId, Type messageType, int messageSizeBytes);

/// <summary>
/// Called before a batch of messages is sent
Expand All @@ -49,7 +49,7 @@ internal interface INetworkHooks
/// <param name="messageCount">Number of messages in the batch</param>
/// <param name="batchSizeInBytes">Number of bytes in the batch, including the batch header</param>
/// <param name="delivery"></param>
void OnBeforeSendBatch(ulong clientId, int messageCount, int batchSizeInBytes, NetworkDelivery delivery);
public void OnBeforeSendBatch(ulong clientId, int messageCount, int batchSizeInBytes, NetworkDelivery delivery);

/// <summary>
/// Called after a batch of messages is sent
Expand All @@ -58,23 +58,23 @@ internal interface INetworkHooks
/// <param name="messageCount">Number of messages in the batch</param>
/// <param name="batchSizeInBytes">Number of bytes in the batch, including the batch header</param>
/// <param name="delivery"></param>
void OnAfterSendBatch(ulong clientId, int messageCount, int batchSizeInBytes, NetworkDelivery delivery);
public void OnAfterSendBatch(ulong clientId, int messageCount, int batchSizeInBytes, NetworkDelivery delivery);

/// <summary>
/// Called before a batch of messages is received
/// </summary>
/// <param name="senderId">The source clientId</param>
/// <param name="messageCount">Number of messages in the batch</param>
/// <param name="batchSizeInBytes">Number of bytes in the batch, including the batch header</param>
void OnBeforeReceiveBatch(ulong senderId, int messageCount, int batchSizeInBytes);
public void OnBeforeReceiveBatch(ulong senderId, int messageCount, int batchSizeInBytes);

/// <summary>
/// Called after a batch of messages is received
/// </summary>
/// <param name="senderId">The source clientId</param>
/// <param name="messageCount">Number of messages in the batch</param>
/// <param name="batchSizeInBytes">Number of bytes in the batch, including the batch header</param>
void OnAfterReceiveBatch(ulong senderId, int messageCount, int batchSizeInBytes);
public void OnAfterReceiveBatch(ulong senderId, int messageCount, int batchSizeInBytes);


/// <summary>
Expand All @@ -84,7 +84,7 @@ internal interface INetworkHooks
/// <param name="messageType">The type of the message</param>
/// <param name="delivery"></param>
/// <returns></returns>
bool OnVerifyCanSend(ulong destinationId, Type messageType, NetworkDelivery delivery);
public bool OnVerifyCanSend(ulong destinationId, Type messageType, NetworkDelivery delivery);

/// <summary>
/// Called before a message is received. If this returns false, the message will be discarded.
Expand All @@ -94,7 +94,7 @@ internal interface INetworkHooks
/// <param name="messageContent">The FastBufferReader containing the message</param>
/// <param name="context">The NetworkContext the message is being processed in</param>
/// <returns></returns>
bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReader messageContent, ref NetworkContext context);
public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReader messageContent, ref NetworkContext context);

/// <summary>
/// Called after a message is serialized, but before it's handled.
Expand All @@ -103,7 +103,7 @@ internal interface INetworkHooks
/// <param name="message">The message object</param>
/// <param name="context">The network context the message is being ahandled in</param>
/// <typeparam name="T"></typeparam>
void OnBeforeHandleMessage<T>(ref T message, ref NetworkContext context) where T : INetworkMessage;
public void OnBeforeHandleMessage<T>(ref T message, ref NetworkContext context) where T : INetworkMessage;

/// <summary>
/// Called after a message is serialized and handled.
Expand All @@ -112,6 +112,6 @@ internal interface INetworkHooks
/// <param name="message">The message object</param>
/// <param name="context">The network context the message is being ahandled in</param>
/// <typeparam name="T"></typeparam>
void OnAfterHandleMessage<T>(ref T message, ref NetworkContext context) where T : INetworkMessage;
public void OnAfterHandleMessage<T>(ref T message, ref NetworkContext context) where T : INetworkMessage;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ namespace Unity.Netcode
/// </summary>
internal interface INetworkMessage
{
void Serialize(FastBufferWriter writer, int targetVersion);
bool Deserialize(FastBufferReader reader, ref NetworkContext context, int receivedMessageVersion);
void Handle(ref NetworkContext context);
int Version { get; }
public void Serialize(FastBufferWriter writer, int targetVersion);
public bool Deserialize(FastBufferReader reader, ref NetworkContext context, int receivedMessageVersion);
public void Handle(ref NetworkContext context);
public int Version { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace Unity.Netcode
{
internal interface INetworkMessageProvider
{
List<NetworkMessageManager.MessageWithHandler> GetMessages();
public List<NetworkMessageManager.MessageWithHandler> GetMessages();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ namespace Unity.Netcode
{
internal interface INetworkMessageSender
{
void Send(ulong clientId, NetworkDelivery delivery, FastBufferWriter batchData);
public void Send(ulong clientId, NetworkDelivery delivery, FastBufferWriter batchData);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ namespace Unity.Netcode
{
internal interface IGroupRpcTarget
{
void Add(ulong clientId);
void Clear();
BaseRpcTarget Target { get; }
public void Add(ulong clientId);
public void Clear();
public BaseRpcTarget Target { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Unity.Netcode
{
internal interface IIndividualRpcTarget
{
void SetClientId(ulong clientId);
BaseRpcTarget Target { get; }
public void SetClientId(ulong clientId);
public BaseRpcTarget Target { get; }
}
}
Loading