-
-
Notifications
You must be signed in to change notification settings - Fork 128
Improve bootstrap flow: in-game TOML config, map init detection, and reliable save upload for dedicated server #809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MhaWay
wants to merge
44
commits into
rwmt:dev
Choose a base branch
from
MhaWay:server-init
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,686
−470
Open
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
f827b35
Name temporary configs more similarly to how vanilla does it
mibac138 2001446
Extract common logic into SyncConfigs
mibac138 7c9752f
SyncConfigs: handle patches and env vars on it's own
mibac138 2785367
SyncConfigs: include reading local configs functionality
mibac138 cd59333
SyncConfigs: minor style changes
mibac138 239b63a
Server: bootstrap mode when save.zip missing
MhaWay 3a57c64
Server: add bootstrap mode for save.zip provisioning
MhaWay 2b3711c
Server: shutdown after bootstrap (manual restart)
MhaWay 4040936
Bootstrap: allow uploading settings.toml before save.zip
MhaWay 6c8c521
Client(session): remove obsolete vanilla save conversion from Autosav…
MhaWay 93f4155
Client(saving): remove obsolete vanilla save conversion helpers from …
MhaWay 169b348
Client(network): add ClientBootstrapState (bootstrap join flow)
MhaWay 363fb7d
Client(windows): add BootstrapConfiguratorWindow (bootstrap UI)
MhaWay e848679
Client(windows): add BootstrapCoordinator GameComponent
MhaWay 3cb52c1
Client(patches): add BootstrapMapInitPatch (FinalizeInit hook)
MhaWay 447d521
Client(patches): add BootstrapRootPlayPatch (Root_Play.Start hook)
MhaWay 467c035
Client(patches): add BootstrapRootPlayUpdatePatch (Root_Play.Update h…
MhaWay c4c8050
Client(patches): add BootstrapStartedNewGamePatch (StartedNewGame hook)
MhaWay c034dd9
Bootstrap server flow: protocol, state machine, and upload logic. Min…
MhaWay 277dc51
Registra le implementazioni mancanti per ClientBootstrap e Disconnect…
MhaWay 4b15af8
Remove all automatic vanilla page advance logic (TryAutoAdvanceVanill…
MhaWay 6c5a946
Remove automatic closing of landing popups and letters after map gene…
MhaWay 316144f
Add GetFreeUdpPort and update HostProgrammatically to allow hosting o…
MhaWay c9116b9
Fix state implementation and handler array sizing to include Disconne…
MhaWay d40c224
Add directPort field to ServerSettings and initialize to default. All…
MhaWay fa3eabd
Add ClientDisconnectedState as a placeholder for the disconnected cli…
MhaWay 43845c7
Fix bootstrap UI workflow state management
MhaWay 1517ab0
Update Source/Client/Windows/BootstrapConfiguratorWindow.cs
MhaWay 24d377f
Remove unused directPort and rely on directAddress for ports
MhaWay c59c4d1
Simplify bootstrap settings upload packet (settings.toml only)
MhaWay 982faa5
Let ConnectionBase fragment settings upload (remove manual chunking)
MhaWay a51fb31
Use port 0 directly instead of GetFreeUdpPort (safer, avoids race con…
MhaWay da65173
Rename bootstrap save upload packets to avoid confusion with settings…
MhaWay b167531
Shorten bootstrap packet names: Settings/Save + Start/Data/End
MhaWay 178bf38
Replace ServerBootstrapCompletePacket with ServerDisconnectPacket+Boo…
MhaWay a1800d5
Track bootstrap configurator by player id; keep unique player ids
MhaWay b01b57c
Track bootstrap configurator by username to survive reconnections
MhaWay 3511ebe
Use Extensions.ToHexString instead of local implementation
MhaWay 3867acc
Keeping english
MhaWay 89237c6
Change bootstrap hash packets to use byte array instead of hex string
MhaWay 5552b60
Remove unnecessary ClientDisconnectedState (StateObj is set to null w…
MhaWay 1b0bd04
Refactor shared ServerSettings UI into reusable helper class
MhaWay 66be825
Fix packet handler registration in ClientBootstrapState
MhaWay 95f9906
refactor: bootstrap UI consolidation with ServerSettingsUI and window…
MhaWay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| using Multiplayer.Common; | ||
| using Multiplayer.Common.Networking.Packet; | ||
|
|
||
| namespace Multiplayer.Client; | ||
|
|
||
| /// <summary> | ||
| /// Client connection state used while configuring a bootstrap server. | ||
| /// The server is in ServerBootstrap and expects upload packets; the client must keep the connection alive | ||
| /// and handle bootstrap completion / disconnect packets. | ||
| /// </summary> | ||
| [PacketHandlerClass(inheritHandlers: true)] | ||
| public class ClientBootstrapState(ConnectionBase connection) : ClientBaseState(connection) | ||
| { | ||
| public new void HandleDisconnected(ServerDisconnectPacket packet) | ||
| { | ||
| // If bootstrap completed successfully, show success message before closing the window | ||
| if (packet.reason == MpDisconnectReason.BootstrapCompleted) | ||
| { | ||
| OnMainThread.Enqueue(() => Verse.Messages.Message( | ||
| "Bootstrap configuration completed. The server will now shut down; please restart it manually to start normally.", | ||
| RimWorld.MessageTypeDefOf.PositiveEvent, false)); | ||
| } | ||
|
|
||
| // Close the bootstrap configurator window now that the process is complete | ||
| OnMainThread.Enqueue(() => | ||
| { | ||
| var window = Verse.Find.WindowStack.WindowOfType<BootstrapConfiguratorWindow>(); | ||
| if (window != null) | ||
| Verse.Find.WindowStack.TryRemove(window); | ||
| }); | ||
|
|
||
| // Let the base class handle the disconnect | ||
| base.HandleDisconnected(packet); | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The packet handler inheritance is changed from false to true. The comment explains this is to inherit keepalive and disconnect handlers, but this is a significant behavior change that could affect packet routing. If the parent class ClientBaseState has packet handlers that conflict with or override handlers needed during the joining phase, this could introduce bugs. Verify that all inherited handlers are appropriate for the joining state.