Maintenance: [forced, user-approved] Family G7: remove WindowRetirement, PlayerNameContext, AutomaticSkillContext. (a) WindowRetireme

Batch #10200 by ragnarok-clanker: forced by an admin (2 lower score(s), 7 changed function(s)); checked with 43 compiled unit(s), including every includer of Source/Contents/PlayerNameDictionary.h, Source/Contents/Skills/AutomaticSkills.h, Source/UI/Window/WindowRetirement.h.
Deletes: Source/UI/Window/WindowRetirement.h
This commit is contained in:
ragnarok-clanker 2026-11-02 21:54:00 +00:00
commit 2a8fe0df8a
6 changed files with 14 additions and 84 deletions

View file

@ -8,11 +8,7 @@
#include <timeapi.h>
// INLINED
CPlayerNameDictionary::CPlayerNameDictionary(PlayerNameContext& context) : m_enabled(true), m_context(&context) {
}
// INLINED
CPlayerNameDictionary::CPlayerNameDictionary() : m_enabled(true), m_context(nullptr) {
CPlayerNameDictionary::CPlayerNameDictionary() : m_enabled(true) {
}
// OFFSET: 0x0060A9D0
@ -87,7 +83,7 @@ void CPlayerNameDictionary::Update() {
const std::uint16_t header = 873;
std::memcpy(packet, &header, sizeof(header));
std::memcpy(packet + 2, &id, sizeof(id));
this->m_context->connection.Send(sizeof(packet), packet);
GetRagConnection().Send(sizeof(packet), packet);
this->m_requests.push_back({id, timeGetTime()});
}

View file

@ -8,19 +8,9 @@
#include <string>
#include <windows.h>
class CConnection;
struct PlayerNameContext {
CConnection& connection;
const bool& languagePrefix;
const int& service;
const WORD& language;
};
class CPlayerNameDictionary {
public:
CPlayerNameDictionary();
explicit CPlayerNameDictionary(PlayerNameContext& context);
virtual ~CPlayerNameDictionary();
std::string Lookup(std::uint32_t id);
void Set(std::uint32_t id, std::string name);
@ -49,11 +39,10 @@ private:
/* 0008 */ std::map<std::uint32_t, Entry> m_names;
/* 0010 */ std::deque<std::uint32_t> m_pending;
/* 0024 */ std::deque<Request> m_requests;
PlayerNameContext* m_context;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CPlayerNameDictionary) == 60);
static_assert(sizeof(CPlayerNameDictionary) == 0x38);
#endif
extern CPlayerNameDictionary* g_playerNameDictionary;

View file

@ -1,5 +1,6 @@
#include "Contents/Skills/AutomaticSkills.h"
#include "Client/Session.h"
#include "Network/Connection/Connection.h"
#include <cstring>
@ -19,15 +20,15 @@ namespace {
}
// INLINED
void Cancel(CConnection& connection, std::int16_t id) {
void Cancel(std::int16_t id) {
const std::uint16_t packet[2] = {2833, static_cast<std::uint16_t>(id)};
connection.Send(sizeof(packet), packet);
GetRagConnection().Send(sizeof(packet), packet);
}
}
// OFFSET: 0x007AEEE0
// FUNCTION: fn_09148
AutomaticSkills::AutomaticSkills(AutomaticSkillContext& context) : m_ids{2036, 6601, 6552}, m_context(&context) {
AutomaticSkills::AutomaticSkills() : m_ids{2036, 6601, 6552} {
}
// OFFSET: 0x007AF130
@ -60,13 +61,13 @@ int AutomaticSkills::CancelOption(std::int16_t id) {
// OFFSET: 0x007AF2A0
// FUNCTION: fn_09150
void AutomaticSkills::DisableAll() {
this->m_context->activeKey = 0;
g_session.unknown_61A4 = 0;
for (int id : this->m_ids) {
const auto skill = static_cast<std::int16_t>(id);
const int option = ActiveOption(skill);
if (g_session.GetOption(option) != 0) {
Cancel(this->m_context->connection, skill);
Cancel(skill);
g_session.SetOption(option, 0, 0);
}
}
@ -81,14 +82,14 @@ void AutomaticSkills::Use(std::int16_t id, std::int16_t level, std::uint32_t tar
std::memcpy(packet + 2, &id, 2);
std::memcpy(packet + 4, &level, 2);
std::memcpy(packet + 6, &target, 4);
this->m_context->connection.Send(sizeof(packet), packet);
GetRagConnection().Send(sizeof(packet), packet);
const int cancel = AutomaticSkills::CancelOption(id);
if (g_session.GetOption(cancel) != 0) {
Cancel(this->m_context->connection, id);
Cancel(id);
g_session.SetOption(cancel, 0, 0);
} else {
this->m_context->activeKey = this->m_context->currentKey;
g_session.unknown_61A4 = *reinterpret_cast<int*>(g_session.unknown_61A8_0000);
g_session.SetOption(ActiveOption(id), 1, 0);
}
}

View file

@ -1,20 +1,12 @@
#ifndef RAGNAROK_SOURCE_CONTENTS_SKILLS_AUTOMATICSKILLS_H
#define RAGNAROK_SOURCE_CONTENTS_SKILLS_AUTOMATICSKILLS_H
#include "Network/Connection/Connection.h"
#include <cstdint>
#include <set>
struct AutomaticSkillContext {
CConnection& connection;
int& activeKey;
const int& currentKey;
};
class AutomaticSkills {
public:
explicit AutomaticSkills(AutomaticSkillContext& context);
AutomaticSkills();
~AutomaticSkills();
bool Contains(int id) const;
static int CancelOption(std::int16_t id);
@ -24,13 +16,12 @@ public:
private:
/* 0000 */ std::set<int> m_ids;
AutomaticSkillContext* m_context;
AutomaticSkills(const AutomaticSkills&) = delete;
AutomaticSkills& operator=(const AutomaticSkills&) = delete;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(AutomaticSkills) == 12);
static_assert(sizeof(AutomaticSkills) == 8);
#endif
#endif