refactor: move hasFullPackedGuid into Packet class, deduplicate 2 definitions

Add Packet::hasFullPackedGuid() method and remove identical standalone
definitions from game_handler.cpp and packet_parsers_classic.cpp.
Replace 53 free-function calls with method calls.
This commit is contained in:
Kelsi 2026-03-25 12:46:44 -07:00
parent 376d0a0f77
commit 40dd39feed
4 changed files with 61 additions and 85 deletions

View file

@ -34,6 +34,14 @@ public:
size_t getReadPos() const { return readPos; }
size_t getSize() const { return data.size(); }
size_t getRemainingSize() const { return data.size() - readPos; }
bool hasFullPackedGuid() const {
if (readPos >= data.size()) return false;
uint8_t mask = data[readPos];
size_t guidBytes = 1;
for (int bit = 0; bit < 8; ++bit)
if (mask & (1u << bit)) ++guidBytes;
return getRemainingSize() >= guidBytes;
}
void setReadPos(size_t pos) { readPos = pos; }
private: