From 3b559dfc3c28394fa1f60fa056eecc0977f21e7c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 20:30:13 +0000 Subject: [PATCH] Decompile 8 functions in Source/Contents/ServerTimeManager.cpp, Source/Contents/ServerTimeManager.h, ... Batch #3111 by youko: 8 byte-identical, 0 confirmed by peer review. - fn_01685 ServerTimeManager::Initialize: byte-identical - fn_01689 ServerTimeManager::GetDay: byte-identical - fn_01690 ServerTimeManager::GetHour: byte-identical - fn_01691 ServerTimeManager::GetMinute: byte-identical - fn_01692 ServerTimeManager::GetMonth: byte-identical - fn_01693 ServerTimeManager::GetSecond: byte-identical - fn_01694 ServerTimeManager::GetYear: byte-identical - fn_01711 ModelQuaternionKey::ModelQuaternionKey: byte-identical Merged automatically: every function is byte-identical to the original. Adds to the build: Source/Contents/ServerTimeManager.cpp --- Source/Contents/ModelKeyframes.cpp | 39 +++++++++++++++++++++ Source/Contents/ServerTimeManager.cpp | 50 +++++++++++++++++++++++++++ Source/Contents/ServerTimeManager.h | 41 ++++++++++++++++++++++ Source/Utility/Singleton.h | 2 +- data/compile.json | 1 + 5 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 Source/Contents/ServerTimeManager.cpp create mode 100644 Source/Contents/ServerTimeManager.h diff --git a/Source/Contents/ModelKeyframes.cpp b/Source/Contents/ModelKeyframes.cpp index 6ead53da..e2163ec8 100644 --- a/Source/Contents/ModelKeyframes.cpp +++ b/Source/Contents/ModelKeyframes.cpp @@ -3,6 +3,22 @@ #include +struct ModelQuaternionKey { + /* 0000 */ int frame; + /* 0004 */ float rotation[4]; + + ModelQuaternionKey(); +}; + +static_assert(sizeof(ModelQuaternionKey) == 20); + +struct ModelVectorKey { + /* 0000 */ int frame; + /* 0004 */ float value[4]; +}; + +static_assert(sizeof(ModelVectorKey) == 20); + struct ModelRotationKeys : std::vector { void Add(int frame, float x, float y, float z, float angle); }; @@ -11,6 +27,23 @@ struct ModelScaleKeys : std::vector { void Add(int frame, float scaleX, float scaleY, float scaleZ, float x, float y, float z, float angle); }; +struct ModelPositionKeysV2 : std::vector { + ModelPositionKeysV2& operator=(const ModelPositionKeysV2& other); +}; + +struct ModelQuaternionKeys : std::vector { + void operator=(const ModelQuaternionKeys& other); +}; + +struct ModelScaleKeysV2 : std::vector { + ModelScaleKeysV2& operator=(const ModelScaleKeysV2& other); +}; + +// OFFSET: 0x0053FB40 +// FUNCTION: fn_01711 +ModelQuaternionKey::ModelQuaternionKey() : frame(0), rotation{0.0f, 0.0f, 0.0f, 1.0f} { +} + // OFFSET: 0x0053FFE0 // FUNCTION: fn_01716 void ModelRotationKeys::Add(int frame, float x, float y, float z, float angle) { @@ -41,3 +74,9 @@ void ModelScaleKeys::Add(int frame, float scaleX, float scaleY, float scaleZ, fl key.rotation[3] = ClientCos(angle); this->push_back(key); } + +// OFFSET: 0x005402D0 + +// OFFSET: 0x005402E0 + +// OFFSET: 0x00540360 diff --git a/Source/Contents/ServerTimeManager.cpp b/Source/Contents/ServerTimeManager.cpp new file mode 100644 index 00000000..0c511f88 --- /dev/null +++ b/Source/Contents/ServerTimeManager.cpp @@ -0,0 +1,50 @@ +#include "Contents/ServerTimeManager.h" + +#include + +// OFFSET: 0x0053E4F0 +// FUNCTION: fn_01685 +void ServerTimeManager::Initialize() { +} + +// OFFSET: 0x0053E500 + +// OFFSET: 0x0053E6A0 +// FUNCTION: fn_01689 +int ServerTimeManager::GetDay() const { + return this->day; +} + +// OFFSET: 0x0053E6B0 +// FUNCTION: fn_01690 +int ServerTimeManager::GetHour() const { + return this->hour; +} + +// OFFSET: 0x0053E6C0 +// FUNCTION: fn_01691 +int ServerTimeManager::GetMinute() const { + return this->minute; +} + +// OFFSET: 0x0053E6D0 +// FUNCTION: fn_01692 +int ServerTimeManager::GetMonth() const { + return this->month; +} + +// OFFSET: 0x0053E6E0 +// FUNCTION: fn_01693 +int ServerTimeManager::GetSecond() const { + return this->second; +} + +// OFFSET: 0x0053E840 +// FUNCTION: fn_01694 +int ServerTimeManager::GetYear() const { + return this->year; +} + +// OFFSET: 0x0053E910 + +// OFFSET: 0x0053E930 diff --git a/Source/Contents/ServerTimeManager.h b/Source/Contents/ServerTimeManager.h new file mode 100644 index 00000000..89160e0f --- /dev/null +++ b/Source/Contents/ServerTimeManager.h @@ -0,0 +1,41 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_SERVERTIMEMANAGER_H +#define RAGNAROK_SOURCE_CONTENTS_SERVERTIMEMANAGER_H + +#include "Utility/Singleton.h" + +#include +#include + +// VTABLE: vt_00057 +class ServerTimeManager : public Singleton { +public: + /* 0008 */ std::chrono::system_clock::time_point now; + /* 0010 */ std::chrono::seconds offset; + /* 0018 */ int year; + /* 001C */ int month; + /* 0020 */ int day; + /* 0024 */ int hour; + /* 0028 */ int minute; + /* 002C */ int second; + + ~ServerTimeManager() override; + + void Initialize(); + int GetDay() const; + int GetHour() const; + int GetMinute() const; + int GetMonth() const; + int GetSecond() const; + int GetYear() const; + void Reset(); + void Update(); +}; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(offsetof(ServerTimeManager, now) == 0x8); +static_assert(offsetof(ServerTimeManager, offset) == 0x10); +static_assert(offsetof(ServerTimeManager, second) == 0x2C); +static_assert(sizeof(ServerTimeManager) == 0x30); +#endif + +#endif diff --git a/Source/Utility/Singleton.h b/Source/Utility/Singleton.h index 982b6579..9247298e 100644 --- a/Source/Utility/Singleton.h +++ b/Source/Utility/Singleton.h @@ -8,7 +8,7 @@ public: static T* GetInstance(); - virtual ~Singleton() {} + virtual ~Singleton() = default; }; #endif diff --git a/data/compile.json b/data/compile.json index 19fc1b92..0fb31d8c 100644 --- a/data/compile.json +++ b/data/compile.json @@ -431,6 +431,7 @@ "Source/Contents/RobeOpacity.cpp": 4, "Source/Contents/RobeResources.cpp": 4, "Source/Contents/RobeTopLayer.cpp": 4, + "Source/Contents/ServerTimeManager.cpp": 4, "Source/Contents/ShowRankingScheduler.cpp": 4, "Source/Contents/Skills/AutomaticSkills.cpp": 4, "Source/Contents/Skills/ClientSkills.cpp": 4,