From d70ade1bc127bc9b7e50e19c056d950f19fac015 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 15:48:27 +0000 Subject: [PATCH] Decompile 3 functions in Source/Contents/Hotkeys/UserHotkeyMgr.cpp, Source/Contents/Hotkeys/UserHotkeyMgr.h, ... Batch #18539 by eAthena: 0 byte-identical, 3 confirmed by peer review. - fn_03464 CUserHotkeyMgr::LoadV2: logic confirmed by peer review - fn_03473 CUserHotkeyMgr::LoadUserHotkeyTab: logic confirmed by peer review - fn_03465 CAccountLinkedUserDataMgr::CompleteLoad: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, alisonrag, bibinir, kyoshi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Hotkeys/UserHotkeyMgr.cpp | 14 +++++++------- Source/Contents/Hotkeys/UserHotkeyMgr.h | 3 ++- Source/Contents/Hotkeys/UserHotkeyScript.cpp | 3 ++- Source/Contents/Hotkeys/UserHotkeyScript.h | 6 ------ .../Contents/UserData/AccountLinkedUserDataMgr.cpp | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Source/Contents/Hotkeys/UserHotkeyMgr.cpp b/Source/Contents/Hotkeys/UserHotkeyMgr.cpp index 1b2d27a69..8aab1b0ea 100644 --- a/Source/Contents/Hotkeys/UserHotkeyMgr.cpp +++ b/Source/Contents/Hotkeys/UserHotkeyMgr.cpp @@ -160,18 +160,18 @@ void CUserHotkeyMgr::Reset() { // OFFSET: 0x005BC420 // FUNCTION: fn_03464 -void CUserHotkeyMgr::LoadV2(LuaScript& script, Json::Value& data) { +void CUserHotkeyMgr::LoadV2(Json::Value& data) { Json::Value values = data["UserHotkey_V2"]; if (values.empty()) { this->m_version2 = false; } else { this->m_version2 = true; - ClearUserHotkeys(script); - LoadUserHotkeyTab(script, values["SkillBar_1Tab"], 0); - LoadUserHotkeyTab(script, values["SkillBar_2Tab"], 3); - LoadUserHotkeyTab(script, values["InterfaceTab"], 1); - LoadUserHotkeyTab(script, values["EmotionTab"], 2); - SaveUserHotkeys(script); + ClearUserHotkeys(); + this->LoadUserHotkeyTab(values["SkillBar_1Tab"], 0); + this->LoadUserHotkeyTab(values["SkillBar_2Tab"], 3); + this->LoadUserHotkeyTab(values["InterfaceTab"], 1); + this->LoadUserHotkeyTab(values["EmotionTab"], 2); + SaveUserHotkeys(); } } diff --git a/Source/Contents/Hotkeys/UserHotkeyMgr.h b/Source/Contents/Hotkeys/UserHotkeyMgr.h index 635d6900b..efe969560 100644 --- a/Source/Contents/Hotkeys/UserHotkeyMgr.h +++ b/Source/Contents/Hotkeys/UserHotkeyMgr.h @@ -16,7 +16,8 @@ public: static void Shutdown(); void Reset(); int TabAt(int position) const; - void LoadV2(LuaScript& script, Json::Value& data); + void LoadV2(Json::Value& data); + void LoadUserHotkeyTab(Json::Value& values, int tab); void Capture(); bool HasUserAssignments(LuaScript& script) const; bool HasChanges() const; diff --git a/Source/Contents/Hotkeys/UserHotkeyScript.cpp b/Source/Contents/Hotkeys/UserHotkeyScript.cpp index 76fcfc8f1..7c8534c7a 100644 --- a/Source/Contents/Hotkeys/UserHotkeyScript.cpp +++ b/Source/Contents/Hotkeys/UserHotkeyScript.cpp @@ -1,4 +1,5 @@ #include "Client/Session/Session.h" +#include "Contents/Hotkeys/UserHotkeyMgr.h" #include "Contents/Hotkeys/UserHotkeyScript.h" #include "Network/TextEncoding.h" @@ -34,7 +35,7 @@ void __stdcall ChangeUserHotkey(int tab, int index, int key1, int key2, const st // OFFSET: 0x005BD660 // FUNCTION: fn_03473 -void LoadUserHotkeyTab(Json::Value& values, int tab) { +void CUserHotkeyMgr::LoadUserHotkeyTab(Json::Value& values, int tab) { Json::Value entries = values; for (auto item = entries.begin(); item != entries.end(); ++item) { diff --git a/Source/Contents/Hotkeys/UserHotkeyScript.h b/Source/Contents/Hotkeys/UserHotkeyScript.h index 91cd196ff..3782ea97f 100644 --- a/Source/Contents/Hotkeys/UserHotkeyScript.h +++ b/Source/Contents/Hotkeys/UserHotkeyScript.h @@ -9,7 +9,6 @@ void ClearUserHotkeys(); void SaveUserHotkeys(); void __stdcall ChangeUserHotkey(int tab, int index, int key1, int key2, const std::string& description); -void LoadUserHotkeyTab(Json::Value& values, int tab); // INLINED inline void ClearUserHotkeys(LuaScript&) { @@ -26,9 +25,4 @@ inline void ChangeUserHotkey(LuaScript&, int tab, int index, int key1, int key2, ChangeUserHotkey(tab, index, key1, key2, description); } -// INLINED -inline void LoadUserHotkeyTab(LuaScript&, Json::Value& values, int tab) { - LoadUserHotkeyTab(values, tab); -} - #endif diff --git a/Source/Contents/UserData/AccountLinkedUserDataMgr.cpp b/Source/Contents/UserData/AccountLinkedUserDataMgr.cpp index 38a6a31e1..b64ae96de 100644 --- a/Source/Contents/UserData/AccountLinkedUserDataMgr.cpp +++ b/Source/Contents/UserData/AccountLinkedUserDataMgr.cpp @@ -109,7 +109,7 @@ void CAccountLinkedUserDataMgr::CompleteLoad( g_session.m_emotionHotkeys.Load(root[DecryptText<0x2FF3C5036D070127ULL>(emotionSource)]); constexpr std::array hotkeySourceArray = CRYPT_NAME("data", 0x17359BF953C367B3ULL); const std::uint8_t (&hotkeySource)[5] = hotkeySourceArray._Elems; - g_userHotkeyMgr->LoadV2(*g_session.m_hotkeyScript, root[DecryptText<0x17359BF953C367B3ULL>(hotkeySource)]); + g_userHotkeyMgr->LoadV2(root[DecryptText<0x17359BF953C367B3ULL>(hotkeySource)]); } [[fallthrough]]; case 2: