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.
Author
|
/review |
…s as registration (MTT-16534)
jy-vivox
force-pushed
the
feat/cli-commands-mtt-15298
branch
from
October 22, 2026 17:57
2d993d1 to
561afc4
Compare
Author
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.