From bba41f34f10aaad8f75d834b8b512cc2df5aabb9 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 23:47:14 +0000 Subject: [PATCH] Decompile 3 functions in Source/Contents/NavigationManager.h, Source/Contents/NavigationRequest.cpp, ... Batch #3874 by eAthena: 3 byte-identical, 0 confirmed by peer review. - fn_19639 CNavigationManager::StateCount: byte-identical - fn_19640 CNavigationManager::NodeCount: byte-identical - fn_19669 CEntryQueueMgr::ResetCurrent: byte-identical Merged automatically: every function is byte-identical to the original. Adds to the build: Source/Contents/EntryQueueMgr.cpp --- Source/Contents/EntryQueueMgr.cpp | 61 +++++++++++++++++++++++++++ Source/Contents/EntryQueueMgr.h | 55 ++++++++++++++++++++++++ Source/Contents/NavigationManager.h | 3 ++ Source/Contents/NavigationRequest.cpp | 12 ++++++ Source/Contents/NavigationRoute.cpp | 2 + data/compile.json | 1 + 6 files changed, 134 insertions(+) create mode 100644 Source/Contents/EntryQueueMgr.cpp create mode 100644 Source/Contents/EntryQueueMgr.h diff --git a/Source/Contents/EntryQueueMgr.cpp b/Source/Contents/EntryQueueMgr.cpp new file mode 100644 index 00000000..83ed296b --- /dev/null +++ b/Source/Contents/EntryQueueMgr.cpp @@ -0,0 +1,61 @@ +#include "Contents/EntryQueueMgr.h" + +#include "Contents/Sound/SoundMgr.h" +#include "Network/Connection/Connection.h" +#include "Network/Packets/PacketLengths.h" + +#include + +struct EntryQueueAdmissionPacket { + /* 0000 */ std::uint16_t id; + /* 0002 */ std::uint8_t result; + /* 0003 */ char queueName[24]; + /* 001B */ char characterName[24]; +}; + +struct EntryQueueApplyPacket { + /* 0000 */ std::uint16_t id; + /* 0002 */ std::uint16_t type; + /* 0004 */ char queueName[24]; +}; + +struct EntryQueueNamePacket { + /* 0000 */ std::uint16_t id; + /* 0002 */ char queueName[24]; +}; + +// GLOBAL: gl_24868 +CEntryQueueMgr* g_entryQueueMgr; +// GLOBAL: gl_24869 +std::map g_entryQueueList; + +CEntryQueueMgr::~CEntryQueueMgr() { + for (std::map::iterator it = g_entryQueueList.begin(); it != g_entryQueueList.end(); ++it) { + if (it->second) { + delete it->second; + } + } +} + +// OFFSET: 0x00BA1F80 + +// OFFSET: 0x00BA2030 + +// OFFSET: 0x00BA20A0 + +// OFFSET: 0x00BA2110 + +// OFFSET: 0x00BA2180 + +// OFFSET: 0x00BA2250 + +// OFFSET: 0x00BA2270 + +// OFFSET: 0x00BA28B0 +// FUNCTION: fn_19669 +void CEntryQueueMgr::ResetCurrent(int unused) { + this->current = nullptr; + this->ready = 0; +} + +// OFFSET: 0x00BA2EB0 diff --git a/Source/Contents/EntryQueueMgr.h b/Source/Contents/EntryQueueMgr.h new file mode 100644 index 00000000..b204c55b --- /dev/null +++ b/Source/Contents/EntryQueueMgr.h @@ -0,0 +1,55 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_ENTRYQUEUEMGR_H +#define RAGNAROK_SOURCE_CONTENTS_ENTRYQUEUEMGR_H + +#include +#include +#include + +struct EntryQueueName { + /* 0000 */ char text[24]; +}; + +struct EntryQueueInfo { + /* 0000 */ int id; + /* 0004 */ char name[24]; + /* 001C */ unsigned char unknown_001C[0xEC]; + /* 0108 */ char unknown_0108[0x630]; +}; + +struct EntryQueueNotice { + /* 0000 */ std::uint16_t id; + /* 0002 */ std::uint8_t result; +}; + +class CEntryQueueMgr { +public: + virtual ~CEntryQueueMgr(); + + void SendAdmissionReply(int result); + void SendApply(std::uint16_t type, const char* name); + void SendCancel(); + void SendRankingRequest(); + void SetQueueName(const EntryQueueName& name); + void SetCharacterName(const EntryQueueName& name); + void ResetCurrent(int unused); + void OnNotify(const EntryQueueNotice* notice); + + /* 0004 */ EntryQueueName queueName; + /* 001C */ EntryQueueName characterName; + /* 0034 */ EntryQueueInfo* current; + /* 0038 */ unsigned char ready; +}; + +extern CEntryQueueMgr* g_entryQueueMgr; +extern std::map g_entryQueueList; + +void DestroyEntryQueueMgr(); + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(EntryQueueInfo) == 0x738); +static_assert(offsetof(CEntryQueueMgr, characterName) == 0x1C); +static_assert(offsetof(CEntryQueueMgr, current) == 0x34); +static_assert(sizeof(CEntryQueueMgr) == 0x3C); +#endif + +#endif diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index ba3939ef..0fd03914 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -290,6 +290,9 @@ public: std::string DestinationTitle(); float FitToSquare(int* offsetX, int* offsetY, int width, int height, float size) const; void LoadSettings(); + void SaveSettings(); + int StateCount() const; + int NodeCount() const; bool LoadScript(LuaScript* script); bool BuildRoute(int startX, int startY, int destX, int destY, bool collectCells); bool SavedTargetText(char* out, int size); diff --git a/Source/Contents/NavigationRequest.cpp b/Source/Contents/NavigationRequest.cpp index 285e78ae..87af7df1 100644 --- a/Source/Contents/NavigationRequest.cpp +++ b/Source/Contents/NavigationRequest.cpp @@ -109,6 +109,18 @@ bool CNavigationManager::UpdateGround() { return true; } +// OFFSET: 0x00BA12A0 +// FUNCTION: fn_19639 +int CNavigationManager::StateCount() const { + return static_cast(this->states.size()); +} + +// OFFSET: 0x00BA12C0 +// FUNCTION: fn_19640 +int CNavigationManager::NodeCount() const { + return static_cast(this->nodes.size()); +} + // OFFSET: 0x00B97200 // FUNCTION: fn_19598 int CNavigationManager::RequestRoute(int cellX, int cellY) { diff --git a/Source/Contents/NavigationRoute.cpp b/Source/Contents/NavigationRoute.cpp index 958f06ae..baf6afa1 100644 --- a/Source/Contents/NavigationRoute.cpp +++ b/Source/Contents/NavigationRoute.cpp @@ -450,6 +450,8 @@ void CNavigationManager::LoadSettings() { } } +// OFFSET: 0x00BA1330 + // OFFSET: 0x00B99CE0 // FUNCTION: fn_19615 std::vector CNavigationManager::WriteReplayState() { diff --git a/data/compile.json b/data/compile.json index ede6b0b4..72c98c87 100644 --- a/data/compile.json +++ b/data/compile.json @@ -387,6 +387,7 @@ "Source/Contents/Emblems/GuildEmblemReqBundle.cpp": 4, "Source/Contents/EnchantMgr.cpp": 4, "Source/Contents/EnemyMonsterTalk.cpp": 4, + "Source/Contents/EntryQueueMgr.cpp": 4, "Source/Contents/EquipmentResources.cpp": 4, "Source/Contents/ForbiddenWords.cpp": 4, "Source/Contents/Ground/GroundDecals.cpp": 3,