You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4b0545d
Browse filesBrowse the repository at this point in the historyBrowse files
fix: CLI issues found in two-editor testing (MTT-15298)
- 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.
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Documentation~/unity-cli-commands.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ To test with several players, use [Multiplayer Play Mode](https://docs.unity3d.c
41
41
42
42
|**Command**|**Description**|
43
43
| :--- | :--- |
44
-
|`get_stats`| Sample network traffic over a number of frames. Message and byte counters need the Multiplayer Tools package. |
44
+
|`get_stats`| Sample network traffic over a number of frames: bytes and messages sent and received, per message type. |
45
45
46
46
### netcode.gameobjects.session
47
47
@@ -50,7 +50,7 @@ To test with several players, use [Multiplayer Play Mode](https://docs.unity3d.c
50
50
|`start`| Start the NetworkManager as host, server or client, optionally with another address and port. |
51
51
|`stop`| Shut the NetworkManager down. |
52
52
|`kick`| Disconnect a client from the server or host. |
53
-
|`reconnect`| Disconnect a client and connect it again, then wait for it to be connected. |
53
+
|`reconnect`| Disconnect a client and connect it again, then wait for it to be connected. A client that was already disconnected, for example kicked or timed out, just connects again. |
54
54
|`wait_ready`| Wait until a client is connected, or a server has a number of clients. |
[CliGroupCommand(k_Group,"Sample network traffic over N frames: the profiler's network counters (messages, RPCs, NetworkVariables, spawns and bytes, with Multiplayer Tools installed), clients with round trip times, and the spawned object count. Requires a running session.",Tags=new[]{k_Tag})]
118
+
[CliGroupCommand(k_Group,"Sample network traffic over N frames: bytes and messages sent and received, per message type, clients with round trip times, and the spawned object count. Requires a running session.",Tags=new[]{k_Tag})]
119
119
privatestaticasyncTask<object>GetStats(
120
120
[CliArg("frames","Frames to sample.")]intframes=120,
121
121
[CliArg("manager","NetworkManager name or hierarchy path, when there are several.")]stringmanager=null,
@@ -153,7 +153,7 @@ private static object Kick(
153
153
[CliArg("manager","NetworkManager name or hierarchy path, when there are several.")]stringmanager=null)
[CliGroupCommand(k_Group,"Shut a client down and connect it again with the same settings, then wait until it's connected. Tests reconnection handling.",Tags=new[]{k_Tag})]
156
+
[CliGroupCommand(k_Group,"Shut a client down and connect it again with the same settings, then wait until it's connected. A client that was already disconnected (kicked or timed out) just connects again. Tests reconnection handling.",Tags=new[]{k_Tag})]
157
157
privatestaticasyncTask<object>Reconnect(
158
158
[CliArg("manager","NetworkManager name or hierarchy path, when there are several.")]stringmanager=null,
159
159
[CliArg("timeout","Seconds to wait for the reconnection.")]doubletimeoutInSeconds=30)
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Editor/CliQueries/NgoCliQueries.Authoring.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ internal static CreateNetworkManagerResult CreateNetworkManager(string name, Net
38
38
varexisting=FindManagers();
39
39
if(existing.Count>0)
40
40
{
41
-
thrownewInvalidOperationException($"The open scenes already have a NetworkManager ({string.Join(", ",existing.Select(m =>$"{GetHierarchyPath(m.transform)} in {m.gameObject.scene.name}"))}). A session uses one; inspect it with netcode.gameobjects.config get.");
41
+
thrownewInvalidOperationException($"The open scenes already have a NetworkManager ({string.Join(", ",existing.Select(m =>$"{GetHierarchyPath(m.transform)} in {SceneLabel(m.gameObject.scene)}"))}). A session uses one; inspect it with netcode.gameobjects.config get.");
thrownewInvalidOperationException($"{manager.name} is the {GetRole(manager)}. reconnect is for clients; restart a server with netcode.gameobjects.session stop, then start.");
136
140
}
137
141
138
142
varstarted=EditorApplication.timeSinceStartup;
139
-
manager.Shutdown();
140
-
awaitWaitUntilAsync(()=>!manager.IsListening&&!manager.ShutdownInProgress,timeoutSeconds,"the client to shut down");
143
+
// A client that was kicked or timed out has already shut down; connect it again as it is.
result.Note="No messages were sent or received during the sample. A host on its own sends nothing over the network; connect a client (another editor or a Multiplayer Play Mode player).";
99
+
}
100
+
returnresult;
101
+
}
102
+
103
+
/// <summary>
104
+
/// Counts what the message manager sends and receives, from the same hooks that feed Netcode for GameObjects'
105
+
/// metrics: message sizes per type, and batch sizes for the bytes handed to and read from the transport.
result.Note="Netcode for GameObjects reports message and byte counters through Multiplayer Tools. Install it (package add com.unity.multiplayer.tools) for per-message-type traffic.";
result.Note="No network traffic was recorded. A host on its own sends nothing; connect a client (a Multiplayer Play Mode player or another editor), and check that NetworkConfig network_message_metrics is on (netcode.gameobjects.config get).";
thrownewArgumentException($"Several NetworkManagers. Pass manager with one of: {string.Join(", ",managers.Select(m =>GetHierarchyPath(m.transform)))}.");
395
395
}
396
396
397
+
// A scene's name for messages; an unsaved scene has none.
0 commit comments