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 2318c21
Browse filesBrowse the repository at this point in the historyBrowse files
fix: address code review of the CLI review fixes (MTT-16534)
- NetworkManager keeps the role it last started as (internal LastStartedRole), so reconnect refuses a stopped host or server however it was started, and the CLI's own role dictionary, and its leak, is gone.
- The simulator forgets a blackout only once every live driver has been let through, so timeout false still lifts one left on after a script recompile in play mode.
- After a recompile in play mode, the simulator subscribes to new drivers again when it's on.
- The console warns again when the simulator settings change, instead of keeping the first values.
- config set address/port explains a hybrid session when the transport has already been swapped to UnifiedNetcodeTransport.
- A distributed authority manager isn't reported as hybrid, since that topology rejects hybrid prefabs.
- Start's doc comment is back on Start.
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Documentation~/unity-cli-commands.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ The total bytes sent and received are exact. Per message type, the bytes receive
57
57
58
58
### netcode.gameobjects.simulator
59
59
60
-
The simulator applies packet delay, jitter and loss to UnityTransport through its simulator pipeline stage, which is available in the Editor and development builds. Settings last for the Editor session and also apply to sessions started later. Once the simulator, `timeout` and `lag_spike` are all off, the transport gets its own simulator settings back. While the simulator is on, the Console shows a warning in each play session it affects.
60
+
The simulator applies packet delay, jitter and loss to UnityTransport through its simulator pipeline stage, which is available in the Editor and development builds. Settings last for the Editor session and also apply to sessions started later. Once the simulator, `timeout` and `lag_spike` are all off, the transport gets its own simulator settings back. While the simulator is on, the Console shows a warning in each play session it affects, and again when its settings change.
if(manager.NetworkConfig.NetworkTransportis not UnityTransportutp)
94
94
{
95
+
// A hybrid session that has run replaced the UnityTransport with UnifiedNetcodeTransport.
96
+
if(IsHybridSession(manager))
97
+
{
98
+
thrownewArgumentException(HybridSessionNote(manager,$"{name}, a UnityTransport setting, can't be set on it"));
99
+
}
95
100
thrownewArgumentException($"{name} is a UnityTransport setting, and {manager.name} uses {manager.NetworkConfig.NetworkTransport?.GetType().Name??"no transport"}.");
thrownewInvalidOperationException($"{manager.name} is the {GetRole(manager)}. reconnect is for clients; restart a server with netcode.gameobjects.session stop, then start.");
153
149
}
154
150
// A stopped host or server no longer reports IsServer, and would otherwise start again as a client.
thrownewInvalidOperationException($"{manager.name} was stopped as the {startedAs.ToString().ToLowerInvariant()}. reconnect is for clients; start it again with netcode.gameobjects.session start --mode {startedAs}.");
/// The simulator outlasts the play session that turned it on, so say so in the console, where someone who
242
-
/// didn't run the command will look for the cause of the lag.
253
+
/// didn't run the command will look for the cause of the lag. Warns again when the settings change.
243
254
/// </summary>
244
-
privatestaticvoidWarnOncePerPlaySession()
255
+
privatestaticvoidWarnSimulatorOn()
245
256
{
246
-
if(s_WarnedThisPlaySession)
257
+
varwarning=$"[Netcode] The Unity CLI network simulator is on for this editor session: {DelayMs} ms delay, {JitterMs} ms jitter and {DropPercent}% packet loss on every UnityTransport. Turn it off with netcode.gameobjects.simulator set --enable false.";
258
+
if(warning==s_LastWarning)
247
259
{
248
260
return;
249
261
}
250
-
s_WarnedThisPlaySession=true;
251
-
Debug.LogWarning($"[Netcode] The Unity CLI network simulator is on for this editor session: {DelayMs} ms delay, {JitterMs} ms jitter and {DropPercent}% packet loss on every UnityTransport. Turn it off with netcode.gameobjects.simulator set --enable false.");
0 commit comments