mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
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:
parent
3f54d8bcb8
commit
2c79d82446
6 changed files with 133 additions and 121 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue