Repository navigation
Conversation
Commands in the netcode.gameobjects groups for com.unity.pipeline 0.9.0 or later: set up NetworkManagers and network prefabs, audit the project, start and stop sessions, inspect clients and spawned objects, spawn, despawn and change ownership, simulate network conditions and sample network traffic. The command assembly only compiles when the pipeline package is installed; the logic lives in the editor assembly and is tested without it.
A prerelease sorts below its release, so the 0.9.0 gate left the commands out of projects with the published 0.9.0-exp.1.
Restore each transport's own simulator settings once the CLI simulator, timeout and lag spike are off, and keep a timeout on through a lag spike. Gate the simulator presets on Multiplayer Tools 2.0. Prefer an exact NetworkManager name, keep the transport protocol and WebSocket path when setting the address, refuse address changes on Relay, and listen on every interface for a remote address. Let the server own objects in client-server.
- register_prefab treats a prefab as registered when a list entry overrides it, matching entries by source prefab or prefab id hash as NGO does at runtime. - audit reports override entries with no target, a target without a root NetworkObject, or a hash override with a zero source hash. - audit, list_prefabs and register_prefab handle empty list entries; audit reports them as a LIST_ENTRY_INVALID warning. - make_prefab refuses prefabs with child NetworkObjects instead of saving an unsupported network prefab. - config set refuses spawn_timeout outside 10-3600 seconds, and NaN or infinite float values.
- profiler get_stats reads traffic from the message manager's hooks, as NGO's own metrics do: bytes and messages sent and received, per message type. The profiler's Network counters it read before stayed at zero in a live session. - session reconnect connects a client again after it was kicked or timed out, instead of refusing because it had already shut down. - Messages name an unsaved scene as such instead of leaving the name blank.
…s as registration (MTT-16534)
2 of 6 tasks
jy-vivox
marked this pull request as ready for review
October 22, 2026 20:37
jy-vivox
requested review from
a team,
EmandM,
NoelStephensUnity and
jabbacakes
as code owners
October 22, 2026 20:37
…ject commands (MTT-16534) - config set records changes to a prefab instance as prefab overrides in edit mode. - spawn refuses a distributed-authority client that hasn't connected yet, and destroys an instance a failed spawn leaves behind. - get_stats ends with an error when the session stops or restarts while sampling. - audit counts the open scenes' player prefabs as registered, and ignores the Prefab field a hash override keeps, as NGO does. - get_object lists only the inspected object's own behaviours, not nested ones.
…Unity null checks in SourcePrefab (MTT-16534) - Unity.Netcode.GameObjects.Editor.CLI becomes Unity.Netcode.GameObjects.CLI.Editor and its tests Unity.Netcode.GameObjects.CLI.Editor.Tests, as package validation (PVP-132-2) requires editor assemblies to end with .Editor and editor test assemblies with .Editor.Tests. - SourcePrefab tests the override source with Unity's null check in a form the standards check accepts; its suggested ?? would skip that check for a missing reference.
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop-3.x.x #4210 +/- ##
=================================================
+ Coverage 76.03% 76.66% +0.62%
=================================================
Files 159 159
Lines 27344 27344
=================================================
+ Hits 20791 20963 +172
+ Misses 6553 6381 -172
Flags with carried forward coverage won't be shown. Click here to find out more. see 16 files with indirect coverage changes
|
jabbacakes
approved these changes
Oct 23, 2026
Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
…ibuted authority spawn refusal in the CLI queries (MTT-16534)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
Adds Unity CLI commands for Netcode for GameObjects, so agents and scripts can set up and drive an NGO
project through
com.unity.pipeline(unity command <group> <name>).25 commands, in
netcode.gameobjectsand its subgroups:netcode.gameobjects: create a NetworkManager, make and register network prefabs, list prefabs,clients and spawned objects, get the network role, spawn, despawn and change ownership, and
auditthe project's network prefab setup.
netcode.gameobjects.session: start and stop a host, server or client.netcode.gameobjects.config: read and set NetworkManager and transport settings, including the log level.netcode.gameobjects.simulator: network simulator settings, presets, lag spikes and timeouts.netcode.gameobjects.profiler: sample network traffic: bytes and messages sent and received, per message type.The commands are in a separate editor assembly,
Editor/CLI, that only compiles whencom.unity.pipeline0.9.0-exp.1 or later is installed. NGO doesn't depend on the pipeline. The commands'logic is in
Editor/CliQueries, inside the existing editor assembly, so it is compiled and tested either way.Simulator presets use Multiplayer Tools when it is installed: an optional reference with
a
versionDefinesentry (2.0.0 or later). Without it, the simulator commands use the transport's ownsimulator settings.
Names follow the Netcode for Entities commands (
netcoderoot), so both packages share one group rootand the same argument names.
Jira ticket
MTT-16534
Changelog
com.unity.netcode.gameobjects
netcode.gameobjectsgroups) to set up NetworkManagers and network prefabs, start and stop sessions, inspect clients and spawned objects, spawn, despawn and change ownership, simulate network conditions and sample network traffic. They are available when the project hascom.unity.pipeline0.9.0-exp.1 or later.Documentation
unity-cli-commands.md, with every command and its arguments, linked from the table of contentsand from the testing and debugging page.
Testing & QA (How your changes can be verified during release Playtest)
Editor 6000.7.0b1,
minimalproject:and the command assembly is correctly skipped.
create_network_manager,make_prefab,register_prefab,list_prefabs,audit,config;wait_readyon both sides,list_clients;spawn(server-owned, client-owned, player object),change_owner,despawn,list_objectsand
get_objecton both peers, and the client-side refusals;kick, thenreconnect; stop, change config, start again as a server;profiler get_statswith traffic: the client recorded each spawn, ownership change and despawn message.delay. A lag spike, then a timeout that drops the client after the 30 s disconnect timeout,
reconnectafterwards, and turning it off restores the RTT.
Live testing found three issues, fixed here:
get_statsread the profiler's Network counters, which stayed at zero. It now reads NGO's message hooks.reconnectrefused a client that had been kicked or timed out.Functional Testing
Manual testing :
Manual testing doneAutomated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?If any boxes above are checked the QA team will be automatically added as a PR reviewer.
Up-port
Not needed: this targets develop-3.x.x.
Backports
None. The commands need the pipeline's command API from 0.9.0-exp.1.