This issue seems to stem from HasClientLoadedCurrentWorld returning true in AGameMode::RemovePlayerControllerFromPlayerCount. When removing a player controller, the GameMode checks if a seamless travel is in progress or if the client's player controller has the current world loaded in order to determine whether to decrement NumPlayers or NumTravellingPlayers.
However, if the client disconnected during travel, its controller's NetConnection will be destroyed and cleaned up by the time RemovePlayerControllerFromPlayerCount is called. With no NetConnection, APlayerController::HasClientLoadedCurrentWorld assumes the controller is local and returns true. This causes NumPlayers to be decremented instead of NumTravellingPlayers.
Create a game mode class derived from AGameMode that sets bUseSeamlessTravel=true.
On a server with multiple clients connected, initiate a seamless travel.
While this travel is happening, disconnect some of the clients (one way this can be done is to call GEngine->HandleDisconnect from the client's APlayerController::GetSeamlessTravelActorList function).
After travel is complete, observe the values for NumPlayers and NumTravellingPlayers.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-220697 in the post.
1 |
Component | UE - Networking |
---|---|
Affects Versions | 5.5 |
Target Fix | 5.6 |
Created | Jul 31, 2024 |
---|---|
Updated | Aug 8, 2024 |