Net: reconnect to the new core on GC_WARP

RecvWarpPacket now matches Windows: DirectEnter for the selected slot
(warp flavour, SetNewLoadingPhase) and Connect(lAddr, wPort) through
LoginClient::warp, discarding what is left on the old socket.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-13 13:20:47 +09:00
co-authored by Claude Opus 5.5
parent ce6d457808
commit 189da4c269
8 changed files with 63 additions and 11 deletions
+4 -1
View File
@@ -88,7 +88,7 @@ void PythonNetworkStream::StartGame() {
}
void PythonNetworkStream::ResetConnection() {
m_recvBuffer.clear();m_unportedPackets.clear();m_unknownPacketQuit=false;m_isObserverMode=m_bMobileFlag=false;std::memset(m_lastPacket,0,sizeof(m_lastPacket));ClearSendQueue();m_startGameRequested=m_refreshInventory=m_refreshStatus=m_refreshSkill=m_refreshCharacter=m_refreshShopSearch=m_stopGamePhase=false;
m_recvBuffer.clear();m_unportedPackets.clear();m_unknownPacketQuit=false;m_isObserverMode=m_bMobileFlag=false;std::memset(m_lastPacket,0,sizeof(m_lastPacket));ClearSendQueue();m_startGameRequested=m_refreshInventory=m_refreshStatus=m_refreshSkill=m_refreshCharacter=m_refreshShopSearch=m_stopGamePhase=m_warpRequested=false;
m_refreshGuildInfo=m_refreshGuildBoard=m_refreshGuildMember=m_refreshGuildCombo=m_refreshGuildSkill=m_refreshGuildGrade=m_refreshMessenger=false;
m_guildID=0;
m_changeServerTime=m_changeClientTime=0;m_dungeonDestination={};
@@ -1058,6 +1058,9 @@ bool PythonNetworkStream::RecvCreateFlyPacket() {
bool PythonNetworkStream::RecvWarpPacket() {
TPacketGCWarp p;
if (!Read(sizeof(p), &p)) return false;
// CNetworkStream::Connect disconnects first: nothing after GC_WARP on the old socket is processed.
m_warpRequested=true;m_warpAddress=uint32_t(p.lAddr);m_warpPort=p.wPort;
m_recvBuffer.clear();m_stopGamePhase=true;
return true;
}