mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCE-Revelations.git
synced 2026-06-28 21:25:35 +00:00
Refactor async server joining with eJoinState enum and dedicated progress UI
Replace the boolean-flag-based async join system with a clean state machine (eJoinState enum) and move connection progress handling from UIScene_JoinMenu into UIScene_ConnectingProgress as a dedicated UI class. Combines the best of two approaches: non-blocking sockets with select() timeout and SO_RCVTIMEO clearing (prevents random disconnects) with the upstream's state enum, FinalizeJoin separation, and ConnectingProgress UI. JoinGame() now returns JOINGAME_PENDING on Win64, and PlatformNetworkManagerStub::DoWork() polls the join state to finalize the connection when the background thread succeeds.
This commit is contained in:
@@ -773,31 +773,10 @@ void CGameNetworkManager::CancelJoinGame(LPVOID lpParam)
|
||||
s_pPlatformNetworkManager->CancelJoinGame();
|
||||
#endif
|
||||
#ifdef _WINDOWS64
|
||||
static_cast<CPlatformNetworkManagerStub*>(s_pPlatformNetworkManager)->CancelJoinGame();
|
||||
WinsockNetLayer::CancelJoinGame();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
bool CGameNetworkManager::BeginJoinGameAsync(FriendSessionInfo *searchResult, int localUsersMask)
|
||||
{
|
||||
app.SetTutorialMode(false);
|
||||
g_NetworkManager.SetLocalGame(false);
|
||||
|
||||
int primaryUserIndex = ProfileManager.GetLockedProfile();
|
||||
|
||||
Minecraft::GetInstance()->clearConnectionFailed();
|
||||
|
||||
localUsersMask |= GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
|
||||
|
||||
return static_cast<CPlatformNetworkManagerStub*>(s_pPlatformNetworkManager)->BeginJoinGameAsync(searchResult, localUsersMask, primaryUserIndex);
|
||||
}
|
||||
|
||||
int CGameNetworkManager::FinishJoinGame(FriendSessionInfo *searchResult)
|
||||
{
|
||||
return static_cast<CPlatformNetworkManagerStub*>(s_pPlatformNetworkManager)->FinishJoinGame(searchResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool CGameNetworkManager::LeaveGame(bool bMigrateHost)
|
||||
{
|
||||
Minecraft::GetInstance()->gui->clearMessages();
|
||||
|
||||
Reference in New Issue
Block a user