Add hex dump logging for SMSG_QUESTGIVER_QUEST_COMPLETE packet debugging

This commit is contained in:
Kelsi 2026-02-09 23:10:13 -08:00
parent c61a662524
commit ecef6c8d77

View file

@ -838,9 +838,22 @@ void GameHandler::handlePacket(network::Packet& packet) {
break;
case Opcode::SMSG_QUESTGIVER_QUEST_COMPLETE: {
// Mark quest as complete in local log
size_t packetSize = packet.getSize();
size_t readPos = packet.getReadPos();
LOG_INFO("SMSG_QUESTGIVER_QUEST_COMPLETE: size=", packetSize, " readPos=", readPos);
// Dump packet hex for debugging
std::string hexDump;
for (size_t i = readPos; i < std::min(readPos + 32, packetSize); ++i) {
char buf[4];
snprintf(buf, sizeof(buf), "%02x ", static_cast<uint8_t>(packet.getData()[i]));
hexDump += buf;
}
LOG_INFO(" Packet hex: ", hexDump);
if (packet.getSize() - packet.getReadPos() >= 4) {
uint32_t questId = packet.readUInt32();
LOG_INFO("Quest completed: questId=", questId);
LOG_INFO(" Read questId: ", questId);
for (auto it = questLog_.begin(); it != questLog_.end(); ++it) {
if (it->questId == questId) {
questLog_.erase(it);