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 1aa510b
Browse filesBrowse the repository at this point in the historyBrowse files
fix: keep LAN hosts reachable, refuse to reconnect a stopped host, and only lift a blackout the CLI set (MTT-16534)
- config set address and session start --address move a default listen address with the connect address, as create_network_manager sets it, so a host on a LAN address listens on 0.0.0.0. A listen address set on purpose stays.
- reconnect refuses a host or server the CLI started and that has since stopped, instead of starting it again as a client.
- The simulator lifts leftover 100% packet loss only when the CLI applied it (tracked in SessionState), so loss set on purpose in a Network Simulator component stays.
- UnityTransport exposes an internal TransportId, used for its driver events and by the CLI simulator, instead of the simulator copying the computation.
- config set no longer creates a missing NetworkConfig before the dry-run check; it refuses instead.
thrownewInvalidOperationException($"{manager.name} is running; its configuration is read when it starts. Stop it (netcode.gameobjects.session stop), set the field, then start it again.");
71
71
}
72
72
73
-
manager.NetworkConfig??=newNetworkConfig();
73
+
if(manager.NetworkConfig==null)
74
+
{
75
+
thrownewInvalidOperationException($"{manager.name} has no NetworkConfig. Add a NetworkManager with netcode.gameobjects create_network_manager.");
thrownewInvalidOperationException($"{manager.name} is the {GetRole(manager)}. reconnect is for clients; restart a server with netcode.gameobjects.session stop, then start.");
144
154
}
155
+
// 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}.");
159
+
}
145
160
146
161
varstarted=EditorApplication.timeSinceStartup;
147
162
// A client that was kicked or timed out has already shut down; connect it again as it is.
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.");
258
253
}
259
254
255
+
/// <summary>
256
+
/// True from when the CLI drops every packet on a driver until it lets them through again. Kept in
257
+
/// SessionState so it outlasts a script recompile, which resets the saved driver settings.
varstoppedHost=Assert.ThrowsAsync<InvalidOperationException>(()=>NgoCliQueries.ReconnectAsync("NetworkManager",5),"A stopped host isn't started again as a client.");
814
+
StringAssert.Contains("stopped as the host",stoppedHost.Message);
0 commit comments