Files
SatyandClaude Opus 5.5 82879a879d Port the last non-anti-cheat functions: ServerLink, PetAction, emitter params
- Grunt::ServerLink: all CMD_GRUNT_* handlers, send helpers, features/strings, command table 0xB24D70,
  s_localeIds 0xAD3004, Pending::Remove (dead server-side link, docs/0x008CE200.md); ServerLink.h stub removed
- PetAction type for CGPetInfo::m_actions / pet spell actions / cursor pet action, SetAutocast 0x5D32F0
- CParticleEmitter2 fields 0x98-0x11F moved into CParticleEmitter2::Params (ctor 0x979250)
- fixed16(float), C3Vector::FlushDenormals, CGxuLightQueue + static 0xC7C074, CAaSphere(), CMapLowDetail(),
  C2Vector()/C4Plane() out of line, SpellHistory dtor, CGDynamicObject_C GetScale/GetRawFacing
- DB record operator= (PetNameCache, CGPetition, DanceCache): fixes the shallow-copy double free in AddItem
- ClientSetTimer(delay, handler, param) with its five callers, IOMd5Unit::Create without container,
  CDataStore::GetByte / Get(int32_t&), WDataStore::GetHeaderSpace, TSHashTable::Head, TSList::IsEmpty
- CameraTurnPlayer calls CVehicleCamera_C::IsTransitioningFacing 0x5FAA10 (was IsHierarchyChasingFacing)
- OFFSET additions: TSHashTable::Unlink, TInstanceId dtor, DBCACHEHASH dtor (+ ItemNameCache_C dtor),
  CDataStoreCache ctor, BitUnpacker/RunningAverageCalculator deleting dtors, CGTooltip::GetObjectType

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-04 08:10:06 +02:00

80 lines
2.2 KiB
C++

#include "PetNameCache.h"
#include "Engine/Source/Base/CDataStore.h"
#include "Engine/Source/Storm/H/storm.h"
// INLINED
PetNameCache::PetNameCache() {
this->m_petNumber = 0;
this->m_name[0] = '\0';
this->m_declinedNames = nullptr;
this->m_timestamp = 0;
}
// INLINED
PetNameCache::~PetNameCache() {
delete this->m_declinedNames;
}
// VERIFY: f23810ad auto
// OFFSET: 0x00668590
PetNameCache& PetNameCache::operator=(const PetNameCache& source) {
this->m_petNumber = source.m_petNumber;
SStrCopy(this->m_name, source.m_name, sizeof(this->m_name));
if (source.m_declinedNames) {
if (!this->m_declinedNames) {
this->m_declinedNames = static_cast<PetNameCache::DeclinedNames*>(SMemAlloc(sizeof(PetNameCache::DeclinedNames), __FILE__, __LINE__, 0));
}
for (uint32_t i = 0; i < 5; i++) {
SStrCopy(this->m_declinedNames->m_names[i], source.m_declinedNames->m_names[i], sizeof(this->m_declinedNames->m_names[i]));
}
}
this->m_timestamp = source.m_timestamp;
return *this;
}
// VERIFY: b3d5f8cd auto
// OFFSET: 0x007F7550
void PetNameCache::Pack(CDataStore* msg) {
msg->Put(this->m_petNumber);
msg->PutString(this->m_name);
if (this->m_declinedNames) {
msg->Put(static_cast<uint8_t>(1));
for (uint32_t i = 0; i < 5; i++) {
msg->PutString(this->m_declinedNames->m_names[i]);
}
} else {
msg->Put(static_cast<uint8_t>(0));
}
msg->Put(this->m_timestamp);
}
// VERIFY: cb4c25ee manual
// OFFSET: 0x007F75D0
void PetNameCache::Unpack(CDataStore* msg) {
uint8_t hasDeclinedNames;
msg->Get(this->m_petNumber);
msg->GetString(this->m_name, sizeof(this->m_name));
msg->Get(hasDeclinedNames);
if (hasDeclinedNames) {
if (!this->m_declinedNames) {
this->m_declinedNames = static_cast<PetNameCache::DeclinedNames*>(SMemAlloc(sizeof(PetNameCache::DeclinedNames), __FILE__, __LINE__, 0));
}
for (uint32_t i = 0; i < 5; i++) {
msg->GetString(this->m_declinedNames->m_names[i], sizeof(this->m_declinedNames->m_names[i]));
}
}
uint32_t timestamp = 0;
msg->Get(timestamp);
this->m_timestamp = timestamp;
}