refactor: add Packet::readPackedGuid() and replace 121 static method calls

Move packed GUID reading into Packet class alongside readUInt8/readFloat.
Replace 121 UpdateObjectParser::readPackedGuid(packet) calls with
packet.readPackedGuid() across 4 files, reducing coupling between
Packet and UpdateObjectParser.
This commit is contained in:
Kelsi 2026-03-25 13:58:48 -07:00
parent 3f54d8bcb8
commit 2c79d82446
6 changed files with 133 additions and 121 deletions

View file

@ -86,6 +86,17 @@ float Packet::readFloat() {
return value;
}
uint64_t Packet::readPackedGuid() {
uint8_t mask = readUInt8();
if (mask == 0) return 0;
uint64_t guid = 0;
for (int i = 0; i < 8; ++i) {
if (mask & (1 << i))
guid |= static_cast<uint64_t>(readUInt8()) << (i * 8);
}
return guid;
}
std::string Packet::readString() {
std::string result;
while (readPos < data.size()) {