Batch #17028 by eAthena: 7 byte-identical, 0 confirmed by peer review. - fn_17493 C3dActorV1::Update: byte-identical - fn_17908 CActorPickNode::AddPickInfo: byte-identical - fn_23798 CSession::GetOptionFloat: byte-identical - fn_04322 CWhisperBlockMgr::CWhisperBlockMgr: byte-identical - fn_04325 CWhisperBlockMgr::Initialize: byte-identical (already on main) - fn_03648 CAdventurerAgencyMgr::CAdventurerAgencyMgr: byte-identical - fn_03652 CAdventurerAgencyMgr::Initialize: byte-identical (already on main) Merged automatically: every function is byte-identical to the original.
101 lines
2.1 KiB
C++
101 lines
2.1 KiB
C++
#include "Contents/Messenger/WhisperBlockMgr.h"
|
|
#include "Network/TextEncoding.h"
|
|
|
|
#include <new>
|
|
#include "Utility/StdStringCompare.h"
|
|
|
|
// STATIC: 0x01389940
|
|
// GLOBAL: gl_24357
|
|
CWhisperBlockMgr* g_whisperBlockMgr;
|
|
|
|
// OFFSET: 0x00610E60
|
|
// FUNCTION: fn_04322
|
|
CWhisperBlockMgr::CWhisperBlockMgr() : m_tracking(false), m_changes(0) {
|
|
this->m_enabled = true;
|
|
}
|
|
|
|
// INLINED
|
|
CWhisperBlockMgr::~CWhisperBlockMgr() = default;
|
|
|
|
// OFFSET: 0x00611040
|
|
// FUNCTION: fn_04325
|
|
bool CWhisperBlockMgr::Initialize() {
|
|
if (g_whisperBlockMgr) {
|
|
return false;
|
|
}
|
|
|
|
g_whisperBlockMgr = new (std::nothrow) CWhisperBlockMgr;
|
|
if (!g_whisperBlockMgr) {
|
|
return false;
|
|
}
|
|
|
|
if (!g_whisperBlockMgr->m_enabled) {
|
|
delete g_whisperBlockMgr;
|
|
g_whisperBlockMgr = nullptr;
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// OFFSET: 0x00611140
|
|
// FUNCTION: fn_04326
|
|
void CWhisperBlockMgr::Shutdown() {
|
|
if (g_whisperBlockMgr) {
|
|
delete g_whisperBlockMgr;
|
|
g_whisperBlockMgr = nullptr;
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00611000
|
|
// FUNCTION: fn_04324
|
|
void CWhisperBlockMgr::Clear() {
|
|
if (this->m_tracking) {
|
|
++this->m_changes;
|
|
}
|
|
|
|
this->m_names.clear();
|
|
}
|
|
|
|
// OFFSET: 0x00611160
|
|
// FUNCTION: fn_04327
|
|
void CWhisperBlockMgr::Add(std::string name) {
|
|
if (this->m_tracking) {
|
|
++this->m_changes;
|
|
}
|
|
|
|
this->m_names.insert(std::string(name.c_str()));
|
|
}
|
|
|
|
// OFFSET: 0x00611370
|
|
// FUNCTION: fn_04328
|
|
bool CWhisperBlockMgr::Contains(std::string name) const {
|
|
return this->m_names.end() != this->m_names.find(std::string(name.c_str()));
|
|
}
|
|
|
|
// OFFSET: 0x006114D0
|
|
// FUNCTION: fn_04329
|
|
void CWhisperBlockMgr::Remove(std::string name) {
|
|
if (this->m_tracking) {
|
|
++this->m_changes;
|
|
}
|
|
|
|
this->m_names.erase(std::string(name.c_str()));
|
|
}
|
|
|
|
// OFFSET: 0x006115F0
|
|
// FUNCTION: fn_04330
|
|
void CWhisperBlockMgr::Reset() {
|
|
this->m_names.clear();
|
|
this->m_tracking = false;
|
|
this->m_changes = 0;
|
|
}
|
|
|
|
// OFFSET: 0x005BB190
|
|
// FUNCTION: fn_03454
|
|
void CWhisperBlockMgr::Export(Json::Value& values) const {
|
|
for (const std::string& name : this->m_names) {
|
|
const std::string copy = name;
|
|
values.append(ToUtf8(copy, g_textCodePage));
|
|
}
|
|
}
|