From 37ec9b816b84fda29049a89437bd9c28c8b2a3ad Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 01:47:16 +0000 Subject: [PATCH] Decompile fn_23501 (CSession::LoadMiniPartyInfo) Batch #6727 by superintelligence: 0 byte-identical, 1 confirmed by peer review. - fn_23501 CSession::LoadMiniPartyInfo: logic confirmed by peer review Peer-reviewed-by: eAthena, KWDev, Tanke Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Session.cpp | 68 +++++++++++++++++++++++++++++++++++++++ Source/Client/Session.h | 1 + 2 files changed, 69 insertions(+) diff --git a/Source/Client/Session.cpp b/Source/Client/Session.cpp index 37bb3fe5..f079bd20 100644 --- a/Source/Client/Session.cpp +++ b/Source/Client/Session.cpp @@ -10,6 +10,7 @@ #include "Contents/World/World.h" #include "Contents/Actors/GameActor.h" #include "Contents/Messenger/ClientMessenger.h" +#include "File/File.h" #include "Network/Connection/Connection.h" #include "Network/Packets/PacketId.h" #include "Network/TextEncoding.h" @@ -25,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -1918,3 +1920,69 @@ int CSession::CountItems17F0() const { void CSession::InvalidateWindowFrames() { reinterpret_cast(g_windowMgr).InvalidateFrames(g_windowMgr.unknown_04FC); } + +// OFFSET: 0x00DE9430 +// FUNCTION: fn_23501 +void CSession::LoadMiniPartyInfo() { + CFile file; + if (!file.Open("savedata\\MiniPartyInfo.lua", 0, false, false)) { + return; + } + + const int size = file.GetSize(); + char* data = new char[size + 1]; + file.Read(data, size); + data[size] = '\0'; + file.Close(); + + int state = 1; + char name[24] = {0}; + char token[24]; + SessionRecord0734 record; + for (int i = 0; i < size; ++i) { + record.unknown_0000 = 1; + switch (data[i]) { + case ',': { + if (_mbsstr(reinterpret_cast(name), + reinterpret_cast(g_session.DecodePlayerName())) != nullptr) { + if (state == 2) { + ++i; + record.id = std::atoi(&data[i]); + state = 3; + } else if (state == 3) { + ++i; + record.unknown_0008 = std::atoi(&data[i]); + state = 1; + } + } + break; + } + case '{': { + ++i; + std::memset(name, 0, sizeof(name)); + std::memset(token, 0, sizeof(token)); + int position = 0; + while (data[i] != ',') { + token[position] += data[i]; + ++position; + ++i; + } + strcpy_s(name, sizeof(name), token); + if (state == 1) { + ++i; + record.unknown_0000 = std::atoi(&data[i]); + state = 2; + } + break; + } + case '}': + this->unknown_0734.push_back(record); + break; + case '\n': + case '\r': + break; + } + } + + std::free(data); +} diff --git a/Source/Client/Session.h b/Source/Client/Session.h index ed73c655..5d121d3c 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -829,6 +829,7 @@ public: void EraseRecord0734(int id); void IgnoreText(std::string text); void SaveMiniPartyInfo(); + void LoadMiniPartyInfo(); void SetItem1768Quantity(int index, int quantity); void SetUnknown5C1C(int value); void UpdateFriendName(std::uint32_t characterId, const char* name);