From aecb43fa5d67930904ae85e267d39d14eb23a851 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 22:02:21 +0000 Subject: [PATCH] Decompile 6 functions in Source/Client/Mode/GameModePackets.cpp, Source/Client/Mode/CGameMode.h, ... Batch #8651 by aDw: 0 byte-identical, 6 confirmed by peer review. - fn_22174 CGameMode::ReceiveReputeInfo: logic confirmed by peer review - fn_22181 CGameMode::ReceiveEnchantResult: logic confirmed by peer review - fn_22205 CGameMode::ReceiveReputeOpen: logic confirmed by peer review - fn_22206 CGameMode::ReceiveUiOpen: logic confirmed by peer review - fn_21596 CGameMode::RefreshEmotionPurchaseSchedule: logic confirmed by peer review - fn_21597 CGameMode::RefreshEmotionSaleSchedule: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, gordaoprogramas, Montyla Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Mode/GameModePackets.cpp | 73 ++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/Source/Client/Mode/GameModePackets.cpp b/Source/Client/Mode/GameModePackets.cpp index bc701305..372f49c0 100644 --- a/Source/Client/Mode/GameModePackets.cpp +++ b/Source/Client/Mode/GameModePackets.cpp @@ -7067,14 +7067,69 @@ void CGameMode::ReceiveItemReformOpen(int itemId) { } // OFFSET: 0x00D79880 +// FUNCTION: fn_22174 +void CGameMode::ReceiveReputeInfo(bool received, unsigned int count, const ReputePointEntry* entries) { + for (unsigned int index = 0; index < count; ++index) { + if (!CReputeMgr::s_instance) { + CReputeMgr::s_instance = new (std::nothrow) CReputeMgr; + } + CReputeMgr::s_instance->SetPoint(entries[index].id, entries[index].point); + } + if (!CReputeMgr::s_instance) { + CReputeMgr::s_instance = new (std::nothrow) CReputeMgr; + } + CReputeMgr::s_instance->SetPointsReceived(received); +} // OFFSET: 0x00D79D90 +// FUNCTION: fn_22181 +void CGameMode::ReceiveEnchantResult(int messageId, int itemId) { + if (!CEnchantMgr::s_instance) { + CEnchantMgr::s_instance = new (std::nothrow) CEnchantMgr; + } + CEnchantMgr::s_instance->HandleEnchantResult(messageId, itemId); +} // OFFSET: 0x00D7B4C0 +// FUNCTION: fn_22205 +void CGameMode::ReceiveReputeOpen(std::uint64_t groupId, std::uint64_t reputeId) { + if (!CReputeMgr::s_instance) { + CReputeMgr::s_instance = new (std::nothrow) CReputeMgr; + } + CReputeMgr::s_instance->OpenRepute(groupId, reputeId); +} // OFFSET: 0x00D7B550 +// FUNCTION: fn_22206 +void CGameMode::ReceiveUiOpen(unsigned char type, std::uint64_t data) { + if (type == 10) { + if (!CEnchantMgr::s_instance) { + CEnchantMgr::s_instance = new (std::nothrow) CEnchantMgr; + } + CEnchantMgr::s_instance->OpenEnchant(data); + } +} // OFFSET: 0x00D17AD0 +// FUNCTION: fn_21596 +void CGameMode::RefreshEmotionPurchaseSchedule() { + reinterpret_cast(g_timeScheduler)->sub_BA95F0(5); + CCashEmotionMgr* manager = g_cashEmotionMgr; + if (!manager) { + return; + } + + manager->sub_59C5A0(); + const int expiry = manager->GetEarliestExpiry(); + if (expiry < 0x7FFFFFFF) { + const std::uint64_t now = static_cast(manager->sub_59FC50()) * 10000000; + const std::int64_t interval = (static_cast(expiry) * 10000000 - static_cast(now)) / 10000; + if (interval != 0 && interval >= 0) { + reinterpret_cast(g_timeScheduler)->AddSchedule(new CEmotionPurchaseExpireSchedule(now, interval, 1)); + } + } + manager->RefreshCommands(); +} // OFFSET: 0x00D17BF0 // FUNCTION: fn_21733 @@ -7293,3 +7348,21 @@ void CGameMode::ReceiveGuildPositionInfo(const unsigned char* packet) { }); g_windowMgr.RefreshGuildWindows(); } +// FUNCTION: fn_21597 +void CGameMode::RefreshEmotionSaleSchedule() { + reinterpret_cast(g_timeScheduler)->sub_BA95F0(6); + CCashEmotionMgr* manager = g_cashEmotionMgr; + if (!manager) { + return; + } + + const int expiry = manager->RefreshUnownedPacks().nextTime; + if (expiry < 0x7FFFFFFF) { + const std::uint64_t now = static_cast(manager->sub_59FC50()) * 10000000; + const std::int64_t interval = (static_cast(expiry) * 10000000 - static_cast(now)) / 10000; + if (interval != 0 && interval >= 0) { + reinterpret_cast(g_timeScheduler)->AddSchedule(new CEmotionSaleExpireSchedule(now, interval, 1)); + } + } + manager->RefreshCommands(); +}