Files
wowdecomp/WoW/Source/DB/DBClient/DBCache.cpp
T
SatyandClaude Opus 5.5 095603ff2b Client bring-up: login, realm list, world auth, character select
- Grunt login ported end to end (SRP6 challenge/proof, version checksum,
  realm list) and tested against a live server: authenticates, connects to
  the world server (auth session with proof-of-work, header crypt), receives
  the character list and shows character select
- Glue: realm list UI, character select (list, models, scripts), character
  create screen + name generator, delete/rename/decline, Enter World up to
  the loading screen; loading screen drawing and progress
- AccountData (times, update, upload/download), BannedAddOns, addon scan and
  addon info, client cache version, tutorial flags
- Shutdown path at login state: world/map/liquid/weather teardown, NetClient,
  ComSat, streaming stop; Logitech LCD no-device path in Ui/UILCD/Windows
- PCRE 5.0 vendored (core stock; chartables and the posix layer from 12340),
  ValidateName
- Fixes: TSGrowableArray::CalcChunkSize clamps to >= 8 (crash on char list),
  CWorldScene liquid renderer allocation, CMapFootprintTexture element ctor,
  pointer render states on x64, CFrustum/CWFrustum layout, M2 draw callback
  arguments, 37 class/struct forward-declaration mismatches
- IDB name sync (1217 names), verify aliases, harness large-element
  instantiation

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-28 02:39:56 +02:00

117 lines
2.4 KiB
C++

#include "DBCache.h"
#include <cstring>
#include "Engine/Source/Os/OsFile.h"
#include "Engine/Source/Storm/H/storm.h"
#include "WoW/Source/Client.h"
#include "WoW/Source/Game/GameClient/WardenClient.h"
// INLINED
HASHKEY_INT::HASHKEY_INT() {
}
// INLINED
HASHKEY_INT::HASHKEY_INT(int32_t key) {
}
// INLINED
bool HASHKEY_INT::operator==(const HASHKEY_INT& key) {
return true;
}
// INLINED
void DBCacheReadKey(CDataStore& msg, int32_t& key) {
msg.Get(reinterpret_cast<uint32_t&>(key));
}
// INLINED
void DBCacheReadKey(CDataStore& msg, uint64_t& key) {
msg.Get(key);
}
// INLINED
void DBCacheReadKey(CDataStore& msg, CWardenKey& key) {
msg >> key;
}
// INLINED
void DBCacheWriteKey(CDataStore& msg, int32_t key) {
msg.Put(static_cast<uint32_t>(key));
}
// INLINED
void DBCacheWriteKey(CDataStore& msg, uint64_t key) {
msg.Put(key);
}
// INLINED
void DBCacheWriteKey(CDataStore& msg, const CWardenKey& key) {
msg << key;
}
// INLINED
bool DBCacheIsNullKey(int32_t key) {
return !key;
}
// INLINED
bool DBCacheIsNullKey(uint64_t key) {
return !key;
}
// INLINED
bool DBCacheIsNullKey(const CWardenKey& key) {
for (uint32_t i = 0; i < sizeof(key.m_key); i++) {
if (key.m_key[i]) {
return false;
}
}
return true;
}
// INLINED
uint32_t DBCacheHashKey(int32_t key) {
return key;
}
// INLINED
uint32_t DBCacheHashKey(uint64_t key) {
return static_cast<uint32_t>(key);
}
// INLINED
uint32_t DBCacheHashKey(const CWardenKey& key) {
return key.Hash();
}
// VERIFY: 83de7174 auto
// OFFSET: 0x00668720
CWardenKey& CWardenKey::operator=(const CWardenKey& key) {
memcpy(this->m_key, key.m_key, sizeof(this->m_key));
return *this;
}
// VERIFY: e229b1b1 manual
// OFFSET: 0x00668750
bool CWardenKey::operator==(const CWardenKey& key) {
return memcmp(this->m_key, key.m_key, sizeof(this->m_key)) == 0;
}
// VERIFY: 92f182cb auto
// OFFSET: 0x00668800
uint32_t CWardenKey::Hash() const {
return (this->m_key[12] << 24 | this->m_key[13] << 16 | this->m_key[14] << 8 | this->m_key[15]) & 0x7FFFFFFF;
}
// VERIFY: 8655bf5d auto
// OFFSET: 0x00667EF0
void GetCacheDirectory(char* path) {
if (CheckDataFilesExist()) {
SStrPrintf(path, 260, "Cache/%s/%s", "WDB", s_localeCode);
OsCreateDirectory(path, 1);
} else {
SStrCopy(path, "WDB", 260);
OsCreateDirectory(path, 1);
}
}