From c6dd52c1870a9a0773da9f1925fa4f88236245ff Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 18:02:29 +0000 Subject: [PATCH] Decompile 5 functions in Source/Client/Mode/GameModePackets.cpp, Source/Client/Mode/CGameMode.h Batch #5905 by Yommy: 0 byte-identical, 5 confirmed by peer review. - fn_21736 CGameMode::ReceiveMemorialDungeonInfo: logic confirmed by peer review - fn_21737 CGameMode::ReceiveMemorialDungeonNotify: logic confirmed by peer review - fn_21738 CGameMode::ReceiveMemorialDungeonSubscriptionInfo: logic confirmed by peer review - fn_21739 CGameMode::ReceiveMemorialDungeonSubscriptionNotify: logic confirmed by peer review - fn_21740 CGameMode::ReceiveWindow17Entries: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, willerthal Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Mode/CGameMode.h | 8 ++- Source/Client/Mode/GameModePackets.cpp | 99 +++++++++++++++++++++++++- 2 files changed, 105 insertions(+), 2 deletions(-) diff --git a/Source/Client/Mode/CGameMode.h b/Source/Client/Mode/CGameMode.h index b3f195ed..b42482ef 100644 --- a/Source/Client/Mode/CGameMode.h +++ b/Source/Client/Mode/CGameMode.h @@ -69,7 +69,8 @@ public: /* 01C4 */ std::map unknown_01C4; /* 01CC */ unsigned char unknown_01CC[0x24]; /* 01F0 */ std::map minimapMarkers; - /* 01F8 */ unsigned char unknown_01F8[0x58]; + /* 01F8 */ unsigned char unknown_01F8[0x54]; + /* 024C */ int unknown_024C; /* 0250 */ int unknown_0250; /* 0254 */ unsigned char unknown_0254[0x40]; /* 0294 */ char unknown_0294[0x20]; @@ -125,6 +126,11 @@ public: void ReceiveColoredNotice(const unsigned char* packet); void ReceiveActorText(const unsigned char* packet); void ReceiveRentalItemTime(const unsigned char* packet); + void ReceiveMemorialDungeonInfo(const unsigned char* packet); + void ReceiveMemorialDungeonNotify(const unsigned char* packet); + void ReceiveMemorialDungeonSubscriptionInfo(const unsigned char* packet); + void ReceiveMemorialDungeonSubscriptionNotify(const unsigned char* packet); + void ReceiveWindow17Entries(const unsigned char* packet); void ReceiveActorSequenceDeadline(const unsigned char* packet); void ReceiveActorSignal(const unsigned char* packet); void IgnorePacket(const unsigned char* packet); diff --git a/Source/Client/Mode/GameModePackets.cpp b/Source/Client/Mode/GameModePackets.cpp index 0825f10b..06e76fd9 100644 --- a/Source/Client/Mode/GameModePackets.cpp +++ b/Source/Client/Mode/GameModePackets.cpp @@ -17,8 +17,10 @@ #include "UI/Text/UIStaticText.h" #include "UI/UIBarGraph.h" #include "UI/Window/UIHomunInfoWnd.h" +#include "UI/Window/UIWindow.h" #include "UI/Window/UIWindowMgr.h" #include "Utility/Text/FormatString.h" +#include "Utility/Text/StringUtil.h" #include #include @@ -854,4 +856,99 @@ void CGameMode::ClearItemLists(const unsigned char* packet) { g_session.RefreshItem1740Window(); g_session.ClearUnknown1738(slot); g_session.RefreshItem1738Window(); -} \ No newline at end of file +} + +// OFFSET: 0x00D31E50 +// FUNCTION: fn_21736 +void CGameMode::ReceiveMemorialDungeonInfo(const unsigned char* packet) { + g_session.unknown_5950 = reinterpret_cast(packet + 2); + g_session.unknown_596C = *reinterpret_cast(packet + 63); + g_session.unknown_5970 = *reinterpret_cast(packet + 67); + const int previous = g_session.unknown_5948; + const int state = *reinterpret_cast(packet + 67) != 0 ? 1 : 2; + g_session.unknown_5948 = state; + if (previous != state || state != 2 || g_session.unknown_593C != 0) { + if (UIWindow* window = g_windowMgr.EnsureWindow(137)) { + window->SendMsg(nullptr, 60, 0, 0, 0, 0); + } + } +} + +// OFFSET: 0x00D31EE0 +// FUNCTION: fn_21737 +void CGameMode::ReceiveMemorialDungeonNotify(const unsigned char* packet) { + const int previous = g_session.unknown_5948; + g_session.unknown_5970 = *reinterpret_cast(packet + 6); + const int time = *reinterpret_cast(packet + 6); + g_session.unknown_5948 = time != 0 ? 1 : 2; + if (*reinterpret_cast(packet + 2) == 0) { + if (previous != (time != 0 ? 1 : 2) || time != 0 || g_session.unknown_593C != 0) { + if (UIWindow* window = g_windowMgr.EnsureWindow(137)) { + window->SendMsg(nullptr, 60, 0, 0, 0, 0); + } + } + return; + } + + g_windowMgr.CloseWindow(137); + const int type = *reinterpret_cast(packet + 2); + if (type == 1) { + g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1346)), 0x64FFFF, 0, 0, 0); + } else if (type == 2) { + g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1347)), 0x64FFFF, 0, 0, 0); + } else if (type == 3) { + g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1348)), 0x64FFFF, 0, 0, 0); + } +} + +// OFFSET: 0x00D31FD0 +// FUNCTION: fn_21738 +void CGameMode::ReceiveMemorialDungeonSubscriptionInfo(const unsigned char* packet) { + g_session.unknown_5950 = reinterpret_cast(packet + 2); + g_session.unknown_5968 = *reinterpret_cast(packet + 63); + g_session.unknown_5948 = 0; + if (UIWindow* window = g_windowMgr.EnsureWindow(137)) { + window->SendMsg(nullptr, 60, 0, 0, 0, 0); + } +} + +// OFFSET: 0x00D32040 +// FUNCTION: fn_21739 +void CGameMode::ReceiveMemorialDungeonSubscriptionNotify(const unsigned char* packet) { + g_session.unknown_5968 = *reinterpret_cast(packet + 2); + UIWindow* window = g_windowMgr.EnsureWindow(137); + if (!window) { + return; + } + + if (*reinterpret_cast(packet + 2) >= 0) { + g_session.unknown_5948 = 0; + window->SendMsg(nullptr, 60, 0, 0, 0, 0); + return; + } + + g_windowMgr.CloseWindow(137); + g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1345)), 0x64FFFF, 0, 0, 0); +} + +// OFFSET: 0x00D320D0 +// FUNCTION: fn_21740 +void CGameMode::ReceiveWindow17Entries(const unsigned char* packet) { + this->unknown_024C = 1; + g_windowMgr.CloseWindow(17); + if (UIWindow* window = g_windowMgr.EnsureWindow(17)) { + std::string text; + text.assign(reinterpret_cast(packet + 8), *reinterpret_cast(packet + 2) - 9); + const std::vector entries = Split(text, ":"); + for (const std::string& entry : entries) { + if (!entry.empty()) { + window->SendMsg(nullptr, 27, reinterpret_cast(entry.c_str()), 0, 0, 0); + } + } + window->SendMsg(nullptr, 28, *reinterpret_cast(packet + 4), 0, 0, 0); + } + + if (g_windowMgr.unknown_01F0) { + g_windowMgr.unknown_01F0->SendMsg(nullptr, 32, 0, 0, 0, 0); + } +}