Skip to content

Joining

Lakeland97 edited this page Oct 31, 2026 · 8 revisions

Joining

Second client to a local listen host: ClientTravel ABI, the working URL, net timeouts, pre-login checks, joined-match logs.

Two ways in

path caller state
Haxe connectToServer quickmatch (startQuickMatch), join link (UJoinGame) the join link works from -RunURL= when processUrl returns the public-plane DSUR envelope; the quickmatch UI is unreachable (Matchmaking)
native ClientTravel in-process call on the game thread works

The Haxe path builds host:port?IsHost=false?TrackingSessionID=…?Source=…?PlayerSessionID=…?Version=… and calls FUN_140bb97b0 (the ClientTravel wrapper). Hand-built URLs are accepted by the engine and fail pre-login unless the host tolerates the missing fields: the working call passes ?Version= only and depends on the host's PreLogin patches (H7/H8) rather than on serverEnvironment. Whether serverEnvironment ever carries the session check for an unpatched host is not established.

Native travel ABI

FUN_14148FA60(pc, const FString& URL, ETravelType, bool bSeamless, const FGuid&)

Reads Num at URL+8, copies Num*2 bytes, builds {FString, type, seamless, FGuid}, dispatches [pc->vtable + 0x1A8] after FindFunctionChecked(pc->Class, DAT_143C167C8).

FString = 16 bytes {TCHAR* Data; int32 Num; int32 Max}; Num includes the NUL. Num = len sends HNS-release.2.7.31<garbage> → Result:Version; Num = Max = len+1 matches.

entry identity note
FUN_1417CC620(world) UWorld::GetFirstPlayerController list at world+0x1A8, count world+0x1B0; TWeakObjectPtr::Get = FUN_1413D0530
FUN_1416FA590(ctx, idx) UGameplayStatics::GetPlayerController resolves the world through GEngine (0x143C2BAA0), so a UWorld* is also accepted
FUN_1408C8740 Haxe GetFirstPlayerController binding calls FUN_1417CC620, not FUN_1416FA590
entry fact
FUN_1415FF720 UFunction thunk, not ExecuteConsoleCommand: reads an FFrame at RDX (Node +0x18, Code +0x20, Locals +0x80), steps parameters with FUN_1413DFB10; called as (world, &FString, pc) it faults at 0x3e90000037a
FUN_141A49C20(ctx, const FString* Cmd, pc|NULL) console entry: dispatches through [vtable+0xB28], frees output with GMalloc (DAT_143BD8FA8); UFunction name behind DAT_143C167C8 [UNK]

IsInGameThread appears 0 times ASCII/UTF-16, Assertion failed: twice in UTF-16: no assert guards these paths. Reads are safe off-thread; travel mutates game-thread state, so the call runs on the game thread ([INF]).

The working call

url = "127.0.0.1:7777?Version=HNS-release.2.7.31"
# FString{ Data = utf16(url + "\0"), Num = len(url)+1, Max = len(url)+1 }
# ClientTravel(pc, &fs, 0 /*TRAVEL_Absolute*/, False, &zero_guid)
host:   Login request: /Game/Maps/Entry?Version=HNS-release.2.7.31?Name=DevUser
        Join request: /Game/Maps/Entry?Version=HNS-release.2.7.31?Name=DevUser?SplitscreenCount=1
        Join succeeded: DevUser
        PC: SeekPlayerController_1, Owner: SeekPlayerController_1
        464 channels

The host player is SeekPlayerController_1 (the boot login created controller 0); the joiner's is SeekPlayerController_0.

Net timeouts

UE 4.11 default ConnectionTimeout / InitialConnectTimeout is 60 s; a map load exceeds it. Observed: client Very long time between ticks up to 5.96 s, host UNetConnection::Tick: Connection TIMED OUT at 60.00 s. Both sections in both processes:

[/Script/OnlineSubsystemUtils.IpNetDriver]
ConnectionTimeout=600
InitialConnectTimeout=600
[/Script/Engine.NetDriver]
ConnectionTimeout=600
InitialConnectTimeout=600

Join survived >2 minutes with these values: Join succeeded: DevUser, no TIMED OUT. The values buy time; they do not reduce the per-frame cost (GC).

Pre-login checks the joiner must pass

SLGameMode.onPreLogin (FUN_1407ba520) returns "" to accept, else a tag string.

# condition tag / message
1 !IsPlayInEditor() && gameMode+8 == 0 PreLogin:Initializing
2 dsm.isRestarting() PreLogin:Restarting
3 options.Version != buildVersion Result:Version + build mismatch
4 empty PlayerSessionID, serverEnvironment != "local", not PIE Result:AuthError + "No game session ID was provided"
5a Hosted, not host, no host player PreLogin:NoHost + "No host is currently on the server."
5b Hosted, party id mismatch PreLogin:NotInParty
5c Hosted, IsHost=true, host exists PreLogin:ExistingHost + host name
5d Hosted, players ≥ max (default 16) PreLogin:GameFull
6a NoHost, IsHost=true PreLogin:HostInNoHostGame
6b NoHost, no host player PreLogin:Initializing + "Server is initializing"
6c NoHost, started, no late join PreLogin:GameInProgress

"" is not admission: FUN_1407b9c00 reads ?PlayerSessionID=, logs GameLift playerConnected, and calls onPlayerLogin. Gate 5: initializePlayerState (FUN_140d46e30) copies record+0xb8/+0xc0 into SLPlayerState+0x50/+0x58; empty → FUN_140b7f0a0 Result:UnknownError: No token specified for controller (0x142f2d880). The token is the loggedInPlayers key (FUN_140b837ca); patching this gate registers both players under the empty key and the second login overwrites the first.

After onPreLogin: PlayerState must be an SLPlayerState ("Invalid PlayerState for controller"); name collision → "<name> (<n>)"; token collision → "… is already in the match!"; NoHost + host → "Requesting host for a nohost server"; second host → "There is already a host on the server!"; non-host with no logged-in player → "The host has left". serverEnvironment == "local" is the mock default and passes gate 4.

What the joiner then does

  1. Loads GameCon, receives Welcomed by server and the phase packet.
  2. Logs SLGameState.hx:405: Game Session ID is null — a local Haxe field (sl.config.SLLocalPlayer+0x78) with no replication and no writer; diagnostic only.
  3. Unpatched: stops in GamePhaseManager.BeginPlay — no ticks, no 10 s Twitch checks, process alive, host connection held to the 600 s timeout (GC).
  4. With the bounded-wait patch: keeps running, PC: SeekPlayerController_0 valid, phase WaitingForPlayers.

Failure modes

symptom cause
PreLogin → Result:Version, sent HNS-release.2.7.31<garbage> FString.Num = len instead of len+1
client alive but frozen after BeginPlay hxcpp GC stop-the-world wait (GC)
launch appears to do nothing a stale process still holds UDP 7777

Verified joined match

Host = the host patch set plus W1 (ListenHost); client = the play profile. The 3000 ms bounded-wait GC patch described in GC was a diagnostic for the same run, not a requirement: the shipped profile removes the stall by returning from openLocalLoadingScreen, so no wait is needed.

22:25:59 gotoPhase(WaitingForPlayers) / Starting match 9F314DFE40A568AC2A0592AA64F66EBD
22:29:10 LogNet: Join succeeded: DevUser
22:29:10 gotoPhase(StartingRound)
22:29:16 gotoPhase(InRound) / gotoPhase(RoundEnding)
22:29:21 gotoPhase(AfterRound)
22:29:31 gotoPhase(EnteringFlashSale) / gotoPhase(flashSale) / gotoPhase(StartingRound)
22:29:37 gotoPhase(InRound) / gotoPhase(RoundEnding)
22:29:42 gotoPhase(AfterRound)
22:29:03 LogNet: Welcomed by server (Level: /Game/Maps/GameCon/GameCon_PersistentLevel, Game: /Game/Blueprints/Modes/BP_TagGameMode.BP_TagGameMode_C)
22:29:16 Received phase: InRound        Transition StartingRound -> InRound
22:29:17 Received phase: RoundEnding
22:29:21 Received phase: AfterRound
22:29:32 Received phase: StartingRound  Transition AfterRound -> StartingRound
22:29:40 Received phase: RoundEnding
22:29:43 Received phase: AfterRound

The client connection line names SeekPlayerController_0; no Fatal on either side. First host error per round transition:

DedicatedServerManager.hx:938: Player Player () was not on the contestants list!
DedicatedServerManager.hx:938: Player DevUser () was not on the contestants list!

C4/C5 remove this (PatchIndex).

Related: ListenHost · GC · Matchmaking · OpenProblems

Leaving the loading screen

A native-travel join never arms the client's map-loaded flag (s_mapLoaded), so the per-frame tick never calls closeLoadingScreen and the LOADING... widget stays on screen forever while the match runs behind it. openLocalLoadingScreen (FUN_1407DA780) is the only creator, and the flag has one native consumer (the tick gate), so the client build returns from the opener instead: file 0x7D9B80, 40 -> C3, the no_loading_screen site in the play profile. The joined client then renders the live match — round timer, scoreboard, HUD — with no fatal and no overlay.

Calling closeLoadingScreen directly crashes the render thread (RenderingThread.cpp:682), as does arming the latch from the phase-receive function. The overlay's ArmMapLoaded arms it from the render thread and also works; it is the fallback for an unpatched client.

After the match

The client follows the host out of a match. Host and client log the same sequence:

host    MatchOver -> WaitingForPlayers -> StartingRound -> InRound
client  Received phase: MatchOver -> WaitingForPlayers -> StartingRound -> RoundEnding

The match payload at MatchOver carries both contestants, one marked didWin; phases then replicate for the next match without a reconnect.

Clone this wiki locally