refactor: add Packet::writePackedGuid, remove redundant static methods

Add writePackedGuid() to Packet class for read/write symmetry. Remove
now-redundant UpdateObjectParser::readPackedGuid and
MovementPacket::writePackedGuid static methods. Replace 6 internal
readPackedGuid calls, 9 writePackedGuid calls, and 1 inline 14-line
transport GUID write with Packet method calls.
This commit is contained in:
Kelsi 2026-03-25 14:06:42 -07:00
parent 2c79d82446
commit 43caf7b5e6
7 changed files with 36 additions and 78 deletions

View file

@ -283,12 +283,12 @@ public:
/** Read a packed GUID from the packet */
virtual uint64_t readPackedGuid(network::Packet& packet) {
return UpdateObjectParser::readPackedGuid(packet);
return packet.readPackedGuid();
}
/** Write a packed GUID to the packet */
virtual void writePackedGuid(network::Packet& packet, uint64_t guid) {
MovementPacket::writePackedGuid(packet, guid);
packet.writePackedGuid(guid);
}
};

View file

@ -449,7 +449,6 @@ struct MovementInfo {
*/
class MovementPacket {
public:
static void writePackedGuid(network::Packet& packet, uint64_t guid);
static void writeMovementPayload(network::Packet& packet, const MovementInfo& info);
/**
@ -526,14 +525,6 @@ public:
*/
static bool parse(network::Packet& packet, UpdateObjectData& data);
/**
* Read packed GUID from packet
*
* @param packet Packet to read from
* @return GUID value
*/
static uint64_t readPackedGuid(network::Packet& packet);
/**
* Parse a single update block
*

View file

@ -28,6 +28,7 @@ public:
uint64_t readUInt64();
float readFloat();
uint64_t readPackedGuid();
void writePackedGuid(uint64_t guid);
std::string readString();
uint16_t getOpcode() const { return opcode; }