From ab4ef21fb8889491b63d8fce7bd2d213e594f36a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 3 Nov 2026 16:16:57 +0000 Subject: [PATCH] Maintenance: [forced, user-approved] Family V5: remove invented helper types that exist only to call real methods under old sub_ name Batch #10281 by ragnarok-clanker: forced by an admin (1 lower score(s), 10 changed function(s)); checked with 6 compiled unit(s). --- Source/Contents/ClientState.cpp | 6 +--- .../Contents/Configuration/ServiceOptions.cpp | 16 +++------- Source/Contents/Messenger/MessengerMember.cpp | 6 +--- Source/Contents/Skills/ClientSkills.cpp | 4 +-- Source/UI/UICaptchaRegisterWnd.cpp | 31 +++++-------------- Source/UI/Window/UIWindowMgr.cpp | 5 +-- 6 files changed, 16 insertions(+), 52 deletions(-) diff --git a/Source/Contents/ClientState.cpp b/Source/Contents/ClientState.cpp index 7b65921e..75528f89 100644 --- a/Source/Contents/ClientState.cpp +++ b/Source/Contents/ClientState.cpp @@ -988,17 +988,13 @@ void CSession::SetPetAutoFeed(bool enabled) { extern "C" void __cdecl sub_6C2A80(int id, bool value); -struct UIWindowMgrHelper { - void sub_AAB070(int id); -}; - // OFFSET: 0x00E489C0 // FUNCTION: fn_24224 void __stdcall sub_E489C0(bool enabled) { std::string notice = LookupMessage(enabled ? 4357 : 4379); g_windowMgr.SendNotice(1, reinterpret_cast(notice.c_str()), 0x64FFFF, 0, 0, 0); sub_6C2A80(0x128, enabled); - reinterpret_cast(&g_windowMgr)->sub_AAB070(0x128); + g_windowMgr.sub_AAB070(0x128); } // OFFSET: 0x00E48B00 diff --git a/Source/Contents/Configuration/ServiceOptions.cpp b/Source/Contents/Configuration/ServiceOptions.cpp index 9b47b90e..bc56c81f 100644 --- a/Source/Contents/Configuration/ServiceOptions.cpp +++ b/Source/Contents/Configuration/ServiceOptions.cpp @@ -739,14 +739,6 @@ void GameSettings::ToggleOption(int id) { } } -struct SessionCommandTarget { - int sub_DE1010(const char* name, int* optionId, std::string* strings); -}; - -struct ServiceOptionActorRefresh { - void sub_CD6DD0(char all); -}; - // OFFSET: 0x006C29A0 // FUNCTION: fn_06324 int SetOption(const char* name, unsigned char value) { @@ -756,7 +748,7 @@ int SetOption(const char* name, unsigned char value) { int optionId = 3; std::string strings[3]; - reinterpret_cast(&g_session)->sub_DE1010(name, &optionId, strings); + g_session.GetTalkType(name, &optionId, strings); if (optionId != 3) { g_serviceOptions.values[static_cast(optionId)] = value; } @@ -772,7 +764,7 @@ std::pair FindServiceOption(const char* name) { int optionId = 3; std::string strings[3]; - reinterpret_cast(&g_session)->sub_DE1010(name, &optionId, strings); + g_session.GetTalkType(name, &optionId, strings); const auto entry = g_serviceOptions.values.find(static_cast(optionId)); if (entry == g_serviceOptions.values.end()) { return {3, 0}; @@ -1047,7 +1039,7 @@ void ApplyServiceOptionWithNotice(int id, unsigned char value, bool notify, int return; } - reinterpret_cast(g_modeMgr.GetGameMode())->sub_CD6DD0(0); + static_cast(g_modeMgr.GetGameMode())->RefreshActorJobEffects(false); if (notify) { NotifyServiceOption(value, enabledMessage, disabledMessage, 0x64FFFF); } @@ -1064,7 +1056,7 @@ void ApplyServiceOptionActorRefresh(int id, unsigned char value, bool notify, in } } - reinterpret_cast(g_modeMgr.GetGameMode())->sub_CD6DD0(0); + static_cast(g_modeMgr.GetGameMode())->RefreshActorJobEffects(false); } // OFFSET: 0x006C4750 diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index d675e98e..2baeca23 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -57,10 +57,6 @@ namespace { /* 0008 */ int size; }; - struct SessionHelper { - const char* sub_DDE770(const char* mapName); - }; - } class UIDragMiniPartyWnd : public UIFrameWnd { @@ -387,7 +383,7 @@ void UIDragMiniPartyWnd::Paint() { ); } - const char* mapName = reinterpret_cast(g_session).sub_DDE770(this->member.map.c_str()); + const char* mapName = g_session.GetMapDisplayName(this->member.map.c_str()); char text[256]; sprintf(text, "%d %s(%s)", this->member.level, this->member.name.c_str(), mapName); std::string clipped = this->sub_A80880(this->geometry.width - 0x43, text, 0, 12, 1); diff --git a/Source/Contents/Skills/ClientSkills.cpp b/Source/Contents/Skills/ClientSkills.cpp index c09f123e..f4ed85f6 100644 --- a/Source/Contents/Skills/ClientSkills.cpp +++ b/Source/Contents/Skills/ClientSkills.cpp @@ -188,7 +188,7 @@ void CSession::RemoveSkill(std::uint32_t id) { } this->m_skillBundle.Remove(id); - if (this->m_skillBundle.RemoveExtra(id, *reinterpret_cast(&g_windowMgr))) { + if (this->m_skillBundle.RemoveExtra(id, g_windowMgr)) { this->NotifySkillWindows(); } } @@ -224,7 +224,7 @@ bool CSession::UpdateSkill(const CSkillInfo& value, unsigned char notify, unsign } else { snapshot.unknown_0024 = UINT32_MAX; snapshot.unknown_002C = 0; - this->m_skillBundle.AddExtra(snapshot, *reinterpret_cast(&g_windowMgr)); + this->m_skillBundle.AddExtra(snapshot, g_windowMgr); } } diff --git a/Source/UI/UICaptchaRegisterWnd.cpp b/Source/UI/UICaptchaRegisterWnd.cpp index 369d96f4..31624df5 100644 --- a/Source/UI/UICaptchaRegisterWnd.cpp +++ b/Source/UI/UICaptchaRegisterWnd.cpp @@ -26,23 +26,6 @@ #include namespace { -struct UIWindowMgrHelper : public UIWindowMgr { - int sub_A901E0(const char* text, int type, bool defaultAccept, bool replace, int timeout, const char* caption, int width, int height, unsigned char protect); -}; - -struct UIComboBoxDefWndHelper : public UIComboBoxDefWnd { - std::string sub_8A15A0(); -}; - -struct UIEditCtrlHelper : public UIEditCtrl { - void sub_865E00(int red, int green, int blue); - void sub_868570(int red, int green, int blue, std::uint32_t secondary); -}; - -struct UIStaticTextHelper : public UIStaticText { - void sub_868880(const char* text); -}; - struct CaptchaRegisterPacket { /* 0000 */ std::int16_t id; /* 0002 */ char text[16]; @@ -68,7 +51,7 @@ void UICaptchaRegisterWnd::Slot15(int width, int height) { this->m_pathText = new UIStaticText(); this->m_pathText->SetSize(240, 16); this->m_pathText->Move(25, 27); - static_cast(this->m_pathText)->sub_868880(directory.c_str()); + this->m_pathText->SetTextFitted(directory.c_str()); this->AddChild(this->m_pathText); std::list files; @@ -101,8 +84,8 @@ void UICaptchaRegisterWnd::Slot15(int width, int height) { this->m_editCtrl->maximum = 16; this->m_editCtrl->Background(255, 255, 255); this->m_editCtrl->flat = 0; - static_cast(this->m_editCtrl)->sub_865E00(0, 0, 0); - static_cast(this->m_editCtrl)->sub_868570(0, 0, 0, 0xFFFFFFFF); + this->m_editCtrl->Border(0, 0, 0); + this->m_editCtrl->TextColor(RGB(0, 0, 0), 0xFFFFFFFF); this->m_editCtrl->preserveInput = 1; this->AddChild(this->m_editCtrl); @@ -135,14 +118,14 @@ int UICaptchaRegisterWnd::SendMsg( g_windowMgr.CloseWindow(284); } else if (a1 == 345) { if (this->m_editCtrl->Length() < 4) { - static_cast(&g_windowMgr)->sub_A901E0(LookupMessage(2872), 0, 1, 0, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2872), 0, 1, 0, 0, "Message", 280, 120, 0); } else if (this->m_selectedFile.empty()) { - static_cast(&g_windowMgr)->sub_A901E0(LookupMessage(2874), 0, 1, 0, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2874), 0, 1, 0, 0, "Message", 280, 120, 0); } else if (this->m_decompressedSize == 0) { g_windowMgr.SendNotice(1, reinterpret_cast("compress data size error"), 0xFF, 0, 0, 0); } else { std::string str = FormatOwnedString(LookupMessage(2873), this->m_editCtrl->Text()); - int result = static_cast(&g_windowMgr)->sub_A901E0(str.c_str(), 2, 0, 0, 0, "Message", 280, 120, 0); + int result = g_windowMgr.Confirm(str.c_str(), 2, 0, 0, 0, "Message", 280, 120, 0); if (result != 188) { this->registerButton->SetDisabled(1); this->registerButton->Invalidate(); @@ -160,7 +143,7 @@ int UICaptchaRegisterWnd::SendMsg( } } } else if (message == 39 && sender == this->m_fileComboBox) { - this->m_selectedFile = static_cast(this->m_fileComboBox)->sub_8A15A0(); + this->m_selectedFile = this->m_fileComboBox->GetSelectedText(); if (!this->m_selectedFile.empty()) { std::string fullPath = this->m_pathText->tooltip + this->m_selectedFile; CFile file; diff --git a/Source/UI/Window/UIWindowMgr.cpp b/Source/UI/Window/UIWindowMgr.cpp index 841b5d81..c3907aa2 100644 --- a/Source/UI/Window/UIWindowMgr.cpp +++ b/Source/UI/Window/UIWindowMgr.cpp @@ -85,9 +85,6 @@ static_assert(sizeof(AddFriendPacket) == 26); static_assert(offsetof(AddFriendPacket, name) == 2); } -struct SessionCommandTarget { - int sub_DE1010(const char* name, int* optionId, std::string* strings); -}; // GLOBAL: gl_24525 CMiniPartyWndAreaMgr* g_miniPartyWndAreaMgr = nullptr; @@ -1478,7 +1475,7 @@ void UIWindowMgr::SendEmotionHotkey(int index) { if (g_session.ProcessEmotionShortcut(text) == 0) { std::string parts[3]; int talkType; - const int offset = reinterpret_cast(&g_session)->sub_DE1010(text, &talkType, parts); + const int offset = g_session.GetTalkType(text, &talkType, parts); if (offset != -1) { g_windowMgr.unknown_04DC = text + offset; }