From 6ffa0f62c885ee4ce4589f70aba58df7bbc01681 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 04:34:07 +0000 Subject: [PATCH] Decompile fn_22302 (CLoginMode::SubD97780) Batch #7161 by aDw: 0 byte-identical, 1 confirmed by peer review. - fn_22302 CLoginMode::SubD97780: logic confirmed by peer review Peer-reviewed-by: eAthena, alisonrag Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Mode/CLoginMode.h | 7 ++- Source/Client/Mode/LoginMode.cpp | 89 ++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/Source/Client/Mode/CLoginMode.h b/Source/Client/Mode/CLoginMode.h index c85a38cd..d2aa1a67 100644 --- a/Source/Client/Mode/CLoginMode.h +++ b/Source/Client/Mode/CLoginMode.h @@ -8,6 +8,8 @@ #include #include +class UIWindow; + struct CharacterListPacket; struct CharacterSlotsPacket; struct CharacterResultPacket; @@ -61,6 +63,7 @@ struct MapStateEntry { class CLoginMode : public CMode { public: CLoginMode(); + void SubD97780(int value); /* 0058 */ unsigned char unknown_0058[0x174]; /* 01CC */ int characterCount; /* 01D0 */ unsigned char unknown_01D0[0x8]; @@ -73,7 +76,9 @@ public: /* 4068 */ CharacterInfo characters[68]; /* 6EE4 */ unsigned char unknown_6EE4[0x18]; /* 6EFC */ CharacterSlotExtension slotExtension; - /* 6F10 */ unsigned char unknown_6F10[0x40]; + /* 6F10 */ unsigned char unknown_6F10[0x4]; + /* 6F14 */ UIWindow* window_6F14; + /* 6F18 */ unsigned char unknown_6F18[0x38]; /* 6F50 */ std::string unknown_6F50; /* 6F68 */ std::vector mapStates; /* 6F74 */ bool unknown_6F74; diff --git a/Source/Client/Mode/LoginMode.cpp b/Source/Client/Mode/LoginMode.cpp index ad1cbd3e..e0db8477 100644 --- a/Source/Client/Mode/LoginMode.cpp +++ b/Source/Client/Mode/LoginMode.cpp @@ -761,6 +761,95 @@ void CLoginMode::End() { this->unknown_6F50.clear(); } +// OFFSET: 0x00D97780 +// FUNCTION: fn_22302 +void CLoginMode::SubD97780(int value) { + int timeout = 0x3A98; + if (g_serviceType == 5 || g_serviceType == 7) { + timeout = 0x1D4C0; + } + + switch (value) { + case 4: + if (static_cast(timeGetTime()) > this->otpStarted + timeout) { + this->SendMsg(0x2725, 0, 0, 0, 0); + } + if (g_serviceType == 5 || g_serviceType == 7) { + if (static_cast(timeGetTime()) > this->otpStarted + 0x3A98) { + if (this->window_6F14 == nullptr) { + this->window_6F14 = g_windowMgr.EnsureWindow(6); + if (this->window_6F14 == nullptr) { + break; + } + } + this->window_6F14->SendMsg(nullptr, 0x58, 0, 0, 0, 0); + this->window_6F14->Invalidate(); + } + } + break; + case 5: + if (static_cast(timeGetTime()) > this->otpStarted + 0x13880) { + GetRagConnection().Close(); + if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { + this->otpStarted = timeGetTime(); + g_charServerAccountIdPending = 0; + this->pendingCursorType = 3; + } + } + break; + case 6: + if (static_cast(timeGetTime()) > this->otpStarted + 0x3A98) { + GetRagConnection().Close(); + if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { + g_modeMgr.Quit(); + } + } + break; + case 12: + if (static_cast(timeGetTime()) > this->otpStarted + 0x3A98) { + GetRagConnection().Close(); + if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { + this->otpStarted = timeGetTime(); + g_charServerAccountIdPending = 0; + this->pendingCursorType = 3; + } + } + break; + case 38: + if (this->unknown_6F75 == true) { + if (static_cast(timeGetTime()) >= this->otpStarted + 0xEA60) { + GetRagConnection().Close(); + if (this->unknown_6F74 == true && this->unknown_6F75 == true) { + this->unknown_6F76 = true; + if (!g_windowMgr.HasModalWindow()) { + if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xD16), 0, true, false, 0, "Message", 280, 120, 0) == 0xB8) { + this->unknown_6F75 = false; + this->unknown_6F76 = false; + this->unknown_6F74 = false; + this->otpStarted = timeGetTime(); + this->pendingCursorType = 3; + } + } + } + } + } else { + if (static_cast(timeGetTime()) > this->otpStarted + 0x13880) { + GetRagConnection().Close(); + if (this->unknown_6F74 == false) { + if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xD70), 0, true, false, 0, "Message", 280, 120, 0) == 0xB8) { + this->unknown_6F74 = false; + this->otpStarted = timeGetTime(); + this->pendingCursorType = 3; + } + } + } + } + break; + default: + break; + } +} + // OFFSET: 0x00D97B20 // FUNCTION: fn_22303 void CLoginMode::SubD97B20(int) {