Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Source/Client/Networking/State/ClientJoiningState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ void StartDownloading()
{
if (bootstrapState is { Enabled: true } state)
{
var connectingWindows = Find.WindowStack.Windows
.OfType<BaseConnectingWindow>()
.ToList();

foreach (var connectingWindow in connectingWindows)
{
connectingWindow.suppressPostCloseActions = true;
Find.WindowStack.TryRemove(connectingWindow);
}

connection.ChangeState(ConnectionStateEnum.ClientBootstrap);
Find.WindowStack.Add(new BootstrapConfiguratorWindow(connection, state));
return;
Expand Down
4 changes: 4 additions & 0 deletions Source/Client/Windows/ConnectingWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public abstract class BaseConnectingWindow : Window, IConnectionStatusListener
protected abstract string ConnectingString { get; }

public bool returnToServerBrowser;
public bool suppressPostCloseActions;
protected string result;

// Only show this window if there aren't any others during connecting
Expand Down Expand Up @@ -117,6 +118,9 @@ public override void DoWindowContents(Rect inRect)

public override void PostClose()
{
if (suppressPostCloseActions)
return;

Multiplayer.StopMultiplayer();
Comment on lines +121 to 124
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I'm a bit confused how does this work when joining a non-bootstrap game. When loading the world, and Find.WindowStack is switched out, is the PostClose method not called?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s exactly why the problem only exists in the bootstrap path.

In a normal non-bootstrap join, the client proceeds into the regular loading flow and then switches over to the loaded game UI. In that process, the old connecting window is not being explicitly closed as part of the same window stack lifecycle, so its close callback is not what makes it disappear. It effectively vanishes together with the old UI state during the transition into the loaded game.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bootstrap behaves differently because there is no immediate transition into the loaded game UI. We stay on the same window stack and open the bootstrap flow on top of it. That means the old connecting window can remain alive and continue blocking camera motion, which is why the globe gets stuck only there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if is possible to move all in a dedicated window stack or something like this to fix it in another way but i think too much work for a simple bootstrap config


if (returnToServerBrowser)
Expand Down
Loading