-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
base: dev
Are you sure you want to change the base?
Changes from all commits
f827b35
2001446
7c9752f
2785367
cd59333
239b63a
3a57c64
2b3711c
4040936
6c8c521
93f4155
169b348
363fb7d
e848679
3cb52c1
447d521
467c035
c4c8050
c034dd9
277dc51
4b15af8
6c5a946
316144f
c9116b9
d40c224
fa3eabd
43845c7
1517ab0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| 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) | ||
| { | ||
| [TypedPacketHandler] | ||
| public void HandleBootstrapComplete(ServerBootstrapCompletePacket packet) | ||
| { | ||
| // The server will close shortly after sending this. Surface the message as an in-game notification. | ||
| // (BootstrapConfiguratorWindow already tells the user what to do next.) | ||
| if (!string.IsNullOrWhiteSpace(packet.message)) | ||
| OnMainThread.Enqueue(() => Verse.Messages.Message(packet.message, 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); | ||
| }); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| using Multiplayer.Common; | ||
|
|
||
| namespace Multiplayer.Client; | ||
|
|
||
| /// <summary> | ||
| /// Stato client per connessione disconnessa. Non fa nulla, serve solo come placeholder. | ||
| /// </summary> | ||
| public class ClientDisconnectedState(ConnectionBase connection) : ClientBaseState(connection) | ||
| { | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,15 +10,24 @@ | |||||||||||||
| namespace Multiplayer.Client | ||||||||||||||
| { | ||||||||||||||
|
|
||||||||||||||
| [PacketHandlerClass(inheritHandlers: false)] | ||||||||||||||
| // We want to inherit the shared typed packet handlers from ClientBaseState (keepalive, time control, disconnect). | ||||||||||||||
| // Disabling inheritance can cause missing core handlers during joining and lead to early disconnects / broken UI. | ||||||||||||||
| [PacketHandlerClass(inheritHandlers: true)] | ||||||||||||||
|
Comment on lines
+13
to
+15
|
||||||||||||||
| // We want to inherit the shared typed packet handlers from ClientBaseState (keepalive, time control, disconnect). | |
| // Disabling inheritance can cause missing core handlers during joining and lead to early disconnects / broken UI. | |
| [PacketHandlerClass(inheritHandlers: true)] | |
| // Do not inherit handlers from ClientBaseState here; inheriting all base handlers can affect | |
| // packet routing during the joining phase and potentially conflict with join-specific logic. | |
| [PacketHandlerClass(inheritHandlers: false)] |
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.
Why is this needed?