Maintenance: Centralize EncryptedName: delete 44 per-unit copies (incl. GameModeEncryptedName) and 4 EncryptedSource copies; units in

Batch #16852 by ragnarok-clanker: no function's compiled code changes; checked with 44 compiled unit(s), including every includer of Source/Utility/Cipher/LocalEncryptedName.h.
This commit is contained in:
ragnarok-clanker 2026-11-11 10:05:15 +00:00
commit d074dedcd7
45 changed files with 125 additions and 1528 deletions

View file

@ -72,10 +72,10 @@
#include <windows.h>
#include <timeapi.h>
#include "Contents/Guild/GuildInfo.h"
#include "Utility/Cipher/LocalEncryptedName.h"
extern template void std::list<CRenderObject*>::push_back(CRenderObject*&&);
// GLOBAL: gl_25173
int g_playerPoisoned;
@ -93,43 +93,9 @@ struct CharacterRenderDrawItem {
RenderCommand* command;
};
// GLOBAL: gl_24798
int g_multiHitInterval = 200;
namespace {
template <std::size_t Length, std::uint64_t Key>
class EncryptedName {
public:
explicit EncryptedName(const std::uint8_t (&source)[Length]) : m_encrypted(true) {
for (std::uint64_t index = 0; index < Length; ++index) {
this->m_text[index] = source[index];
}
}
~EncryptedName() {
for (std::uint64_t index = 0; index < Length; ++index) {
this->m_text[index] = 0;
}
}
const char* Text() {
if (this->m_encrypted) {
utility::XorBytes(this->m_text, Length, Key);
this->m_encrypted = false;
}
return reinterpret_cast<const char*>(this->m_text);
}
private:
std::uint8_t m_text[Length];
bool m_encrypted;
};
}
class CGrannyCorpse3d : public CGameObject {
public:
explicit CGrannyCorpse3d(const char* name);
@ -702,7 +668,6 @@ void CRenderObject::SetAnimationSpeed(float speed) {
}
}
// OFFSET: 0x00CC2810
// FUNCTION: fn_21142
void CGameActor::SetHealthState(int value) {
@ -4816,7 +4781,6 @@ CCharacterNpc::~CCharacterNpc() {
}
}
// OFFSET: 0x00CBFC40
// FUNCTION: fn_21120
void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int effectState, bool notify) {