Optimize logging and make world packet parser callback-safe

This commit is contained in:
Kelsi 2026-02-22 06:38:41 -08:00
parent 85c8b5d5f4
commit 4ea4cb761c
5 changed files with 49 additions and 27 deletions

View file

@ -1,5 +1,6 @@
#include "network/packet.hpp"
#include <cstring>
#include <utility>
namespace wowee {
namespace network {
@ -9,6 +10,9 @@ Packet::Packet(uint16_t opcode) : opcode(opcode) {}
Packet::Packet(uint16_t opcode, const std::vector<uint8_t>& data)
: opcode(opcode), data(data), readPos(0) {}
Packet::Packet(uint16_t opcode, std::vector<uint8_t>&& data)
: opcode(opcode), data(std::move(data)), readPos(0) {}
void Packet::writeUInt8(uint8_t value) {
data.push_back(value);
}