From efee869d24b86a35a1fe742da5213ccd41cb071d Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 11:01:39 +0000 Subject: [PATCH] Decompile fn_17849 (ModeBaseEvents::Send) Batch #1039 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_17849 ModeBaseEvents::Send: logic confirmed by peer review Reviewed-by: ragnarok-clanker Adds to the build: Source/Client/ModeBaseEvents.cpp --- Source/Client/ModeBaseEvents.cpp | 44 ++++++++++++++++++++++++++++++++ Source/Client/ModeBaseEvents.h | 33 ++++++++++++++++++++++++ compile.json | 1 + 3 files changed, 78 insertions(+) create mode 100644 Source/Client/ModeBaseEvents.cpp create mode 100644 Source/Client/ModeBaseEvents.h diff --git a/Source/Client/ModeBaseEvents.cpp b/Source/Client/ModeBaseEvents.cpp new file mode 100644 index 0000000..15e242a --- /dev/null +++ b/Source/Client/ModeBaseEvents.cpp @@ -0,0 +1,44 @@ +#include "Client/ModeBaseEvents.h" +#include "Client/Mode/ActiveGameMode.h" +#include "Contents/Configuration/ServiceConfiguration.h" +#include "Contents/Party/AdventurerAgencyMgr.h" +#include "Contents/UserData/AccountLinkedUserDataMgr.h" +#include "Contents/UserData/CharacterLinkedUserDataMgr.h" + +#include + +// OFFSET: 0x00AD7500 +// FUNCTION: fn_17849 +int ModeBaseEvents::Send(int event, const char* text, int, int, int) { + if (event == 2) { + g_accountLinkedUserDataMgr->Save(this->emotions, this->script, this->persistenceAccountId, this->renderSystem, this->token16, this->work); + if (g_world.state != 1) { + if (g_world.gameMode) { + g_world.gameMode->running = 0; + } + } else if (g_world.gameMode) { + g_characterLinkedUserDataMgr->Save(this->characterSave, this->token16, this->work); + if (g_world.state != 1) { + if (g_world.gameMode) { + g_world.gameMode->running = 0; + } + } else if (g_world.gameMode) { + g_adventurerAgencyMgr->RequestStop(this->agency, this->stopRecruiting); + if (g_world.gameMode) { + g_world.gameMode->running = 0; + } + } + } + + if (g_serviceType == 11) { + ShellExecuteA(this->window, "open", "http://www.ragnarok.co.in/index.php", nullptr, nullptr, SW_SHOWNORMAL); + } + g_world.running = 0; + } else if (event == 68) { + this->transitionRequested = 1; + if (text) { + this->transitionName = text; + } + } + return 0; +} diff --git a/Source/Client/ModeBaseEvents.h b/Source/Client/ModeBaseEvents.h new file mode 100644 index 0000000..9e9d61c --- /dev/null +++ b/Source/Client/ModeBaseEvents.h @@ -0,0 +1,33 @@ +#ifndef RAGNAROK_SOURCE_CLIENT_MODEBASEEVENTS_H +#define RAGNAROK_SOURCE_CLIENT_MODEBASEEVENTS_H + +#include +#include +#include + +class CAsyncWorkMgr; +class CRenderSystemBase; +class LuaScript; +struct EmotionHotkeys; +struct CharacterConfigSave; +struct AgencyRequestContext; +struct StopRecruitingContext; + +struct ModeBaseEvents { + int& transitionRequested; + std::string& transitionName; + EmotionHotkeys& emotions; + LuaScript& script; + const std::uint32_t& persistenceAccountId; + CRenderSystemBase*& renderSystem; + const char* token16; + CAsyncWorkMgr& work; + CharacterConfigSave& characterSave; + AgencyRequestContext& agency; + StopRecruitingContext& stopRecruiting; + HWND& window; + + int Send(int event, const char* text, int argument2, int argument3, int argument4); +}; + +#endif diff --git a/compile.json b/compile.json index 7e33d5a..92a6999 100644 --- a/compile.json +++ b/compile.json @@ -257,6 +257,7 @@ "Source/Client/Mode/ModeCursor.cpp": 0, "Source/Client/Mode/ModeDragState.cpp": 2, "Source/Client/Mode/ModeTooltip.cpp": 2, + "Source/Client/ModeBaseEvents.cpp": 0, "Source/Client/ModeFade.cpp": 0, "Source/Client/ModeFadeOut.cpp": 0, "Source/Client/Registry.cpp": 0,