diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 63e7cafb7..3f88d1a2b 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -563,7 +563,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) if (Log.log_settings[Logs::Server_Client_Packet].is_category_enabled == 1){ if (p->GetOpcode() != OP_SpecialMesg){ - Log.Out(Logs::General, Logs::Server_Client_Packet, "[%s - 0x%04x] [Size: %u] \n %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str()); + Log.Out(Logs::General, Logs::Server_Client_Packet, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str()); } } @@ -961,14 +961,15 @@ EQRawApplicationPacket *p=nullptr; MInboundQueue.unlock(); //resolve the opcode if we can. - if(p) { - if(OpMgr != nullptr && *OpMgr != nullptr) { - EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); - if (emu_op == OP_Unknown) { - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + if (Log.log_settings[Logs::Client_Server_Packet_Unhandled].is_category_enabled == 1){ + if (p) { + if (OpMgr != nullptr && *OpMgr != nullptr) { + EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); + if (emu_op == OP_Unknown) { + // Log.Out(Logs::General, Logs::Client_Server_Packet_Unhandled, "Unknown :: [%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->opcode, p->Size(), DumpPacketToString(p).c_str()); + } + p->SetOpcode(emu_op); } - - p->SetOpcode(emu_op); } } diff --git a/common/packet_dump.cpp b/common/packet_dump.cpp index 4f1c2f5f5..4ab1fcbef 100644 --- a/common/packet_dump.cpp +++ b/common/packet_dump.cpp @@ -94,6 +94,9 @@ std::string DumpPacketHexToString(const uchar* buf, uint32 size, uint32 cols, ui std::ostringstream out; if (size == 0 || size > 39565) return ""; + + out << "\n"; + // Output as HEX char output[4]; int j = 0; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 1aece578f..6558b6dee 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -405,7 +405,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) } if (Log.log_settings[Logs::Client_Server_Packet].is_category_enabled == 1) - Log.Out(Logs::General, Logs::Client_Server_Packet, "[%s - 0x%04x] [Size: %u] \n %s", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size(), DumpPacketToString(app).c_str()); + Log.Out(Logs::General, Logs::Client_Server_Packet, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size(), DumpPacketToString(app).c_str()); EmuOpcode opcode = app->GetOpcode(); if (opcode == OP_AckPacket) { @@ -448,14 +448,16 @@ int Client::HandlePacket(const EQApplicationPacket *app) case CLIENT_CONNECTED: { ClientPacketProc p; p = ConnectedOpcodes[opcode]; - if(p == nullptr) { + if(p == nullptr) { std::vector args; args.push_back(const_cast(app)); parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); - if (Log.log_settings[Logs::Client_Server_Packet_Unhandled].is_category_enabled == 1) - Log.Out(Logs::General, Logs::Client_Server_Packet_Unhandled, "Incoming OpCode :: [%s - 0x%04x] [Size: %u] \n%s", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size(), DumpPacketToString(app).c_str()); - + if (Log.log_settings[Logs::Client_Server_Packet_Unhandled].is_category_enabled == 1){ + char buffer[64]; + app->build_header_dump(buffer); + Log.Out(Logs::General, Logs::Client_Server_Packet_Unhandled, "%s %s", buffer, DumpPacketToString(app).c_str()); + } break; }