Fix launcher server stop command#2747
Conversation
Applies the focused Nautilus GameInput/keybind compatibility work from JackNytely's PR SubnauticaNitrox#2663. This restores compatibility with newer Nautilus builds that extend Subnautica's GameInput system, while excluding unrelated launcher/server changes from the original PR. Credit: based on JackNytely's work in SubnauticaNitrox#2663.
Removes readonly from UwePrefab so spawning code can mutate Probability without throwing a MissingMethodException for UwePrefab.set_Probability. This fixes repeated server-side sync exceptions during multiplayer world/entity spawning.
|
This PR depends on #2749. The Stop button fix requires the launcher/server management stream to connect reliably in Release output. During testing, the Stop logic could queue the shutdown command correctly, but the command was never forwarded when the Release build loaded mismatched root #2749 fixes the foundational Release |
|
I also created a temporary draft integration/testing PR that combines the current related fixes for anyone who wants to test them together before they land individually:
This is not intended to replace the focused PRs. It is only a convenience branch for combined Release/modded testing. |
Summary
Fixes a regression where the Nitrox Launcher Stop button could enter the stopping state but fail to gracefully shut down an externally launched server. The server process could remain running until the console window was closed manually.
This also fixes the Visual Studio Release deployment layout for the launcher output so net10/root-lib assemblies are not overwritten by net472-compatible assets.
Background
This issue appears related to prior work in JackNytely's PR #2663, which included a commit titled "Fix server shutdown hanging and keybind rebinding being non-functional" (
3b956de). That PR also touched Release build dependency layout behavior.Credit to @JackNytely for the prior investigation and attempted server shutdown/build-layout work in PR #2663.
Why the Release/lib deployment fix is included here
The build/deployment fix is included in this PR because it is integral to the Stop button fix, not a separate cosmetic or packaging-only cleanup.
The launcher Stop button now sends
quitthrough the active server management command path. That path depends on the external server successfully connecting back to the launcher through the MagicOnion/gRPC management stream.During testing, the Stop command still failed even after the launcher logic was corrected because the Visual Studio Release output could place incompatible assemblies in root
lib. In particular:lib/Grpc.Core.Api.dllcould be the lower-TFM asset instead of the netstandard2.1 asset required by the net10/MagicOnion path;lib/Nitrox.Model.dllcould be the net472 build instead of the net10 build.That caused runtime
MissingMethodExceptions in the server management stream, preventingServersManagement.OnConnectedfrom completing and leaving the launcher's command queue with no active reader. In that state, the Stop button could queuequit, but the command was never forwarded to the server.Because the Stop button fix requires the management stream to be functional in normal Visual Studio Release output, the root
libasset correction is part of the same functional fix.The intended deployment split remains:
lib: net10/server-facing assets;lib/net472: net472/game/patcher-facing assets.What changed
quitthrough the active server command queue and waits for the server process to exit.ResetCtsAsyncfrom replacingCommandQueuewhile the management command loop may still be reading it.lib/Nitrox.Model.dllis the net10 build;lib/Grpc.Core.Api.dllis the netstandard2.1 asset;lib/net472remains the net472-compatible location for game/patcher assets.Tested
Tested with a clean Visual Studio Release build copied to a deployment folder.
Verified:
lib/Nitrox.Model.dllis the net10 build.lib/net472/Nitrox.Model.dllremains the net472 build.lib/Grpc.Core.Api.dllmatches the NuGetnetstandard2.1asset hash.quitthrough the management command path.