Fix standalone join-point creation on join#945
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Refactors join-point creation logic during server join, and adds regression tests to enforce that standalone joins do not trigger join-point creation.
Changes:
- Extracted join-point creation decision into
ServerJoiningState.ShouldCreateJoinPointOnJoin. - Changed standalone join behavior to never create a join point on join.
- Added tests covering standalone join scenarios where a join point should not be created.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Source/Tests/StandaloneMapStreamingTest.cs | Adds tests asserting standalone joins don’t create join points under specific conditions. |
| Source/Common/Networking/State/ServerJoiningState.cs | Centralizes join-point creation decision and changes standalone behavior to always skip join-point creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+43
to
+51
| public static bool ShouldCreateJoinPointOnJoin(MultiplayerServer server) | ||
| { | ||
| // Standalone joins always consume the persisted world state. Fresh join points are created | ||
| // by players already inside the game during save/refresh flows, not by the entering client. | ||
| if (server.IsStandaloneServer) | ||
| return false; | ||
|
|
||
| return server.settings.autoJoinPoint.HasFlag(AutoJoinPointFlags.Join); | ||
| } |
Comment on lines
+152
to
+160
| [Test] | ||
| public void StandaloneJoin_DoesNotCreateJoinPoint_WhenStreamingIsEnabled() | ||
| { | ||
| server.settings.multifaction = true; | ||
| server.settings.asyncTime = true; | ||
| AddPlayer("existing", 1); | ||
|
|
||
| Assert.That(ServerJoiningState.ShouldCreateJoinPointOnJoin(server), Is.False); | ||
| } |
| if (server.IsStandaloneServer) | ||
| return false; | ||
|
|
||
| return server.settings.autoJoinPoint.HasFlag(AutoJoinPointFlags.Join); |
notfood
requested changes
Jun 4, 2026
| // For the normal first join, serve the persisted state immediately instead of blocking on WaitJoinPoint. | ||
| if ((Server.IsStandaloneServer && Server.PlayingPlayers.Any()) || | ||
| (!Server.IsStandaloneServer && Server.settings.autoJoinPoint.HasFlag(AutoJoinPointFlags.Join))) | ||
| if (ShouldCreateJoinPointOnJoin(Server)) |
Member
There was a problem hiding this comment.
This doesn't need a new method. Change it to:
!server.IsStandaloneServer && server.settings.autoJoinPoint.HasFlag(AutoJoinPointFlags.Join)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fix a dedicated standalone regression where subsequent players could fail to join after the first player entered the world.
On standalone servers, joining clients should consume the persisted world state directly. Fresh join-points should be created later by players already in-game during save or refresh flows, not during the initial server join path.
Changes
ServerJoiningState.ShouldCreateJoinPointOnJoinValidation
dotnet test .\\Source\\Tests\\Tests.csproj -c Release --filter "FullyQualifiedName~StandaloneMapStreamingTest"Result: