mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
Buildable state with converting hex packet dumps
This commit is contained in:
parent
14bac9f8c0
commit
83906af9b6
@ -1112,7 +1112,7 @@ uint32 newlength=0;
|
||||
ProcessQueue();
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Incoming packet failed checksum" __L);
|
||||
_hex(NET__NET_CREATE_HEX, buffer, length);
|
||||
Log.Hex(Logs::Netcode, buffer, length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include "database.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
@ -173,7 +174,7 @@ void EQEmuLogSys::Hex(uint16 log_category, const void *data, unsigned long lengt
|
||||
// log_message(type, "%s", buffer); //%s is to prevent % escapes in the ascii
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void EQEmuLogSys::Raw(uint16 log_category, uint16 seq, const BasePacket *p) {
|
||||
return;
|
||||
char buffer[196];
|
||||
@ -181,7 +182,7 @@ void EQEmuLogSys::Raw(uint16 log_category, uint16 seq, const BasePacket *p) {
|
||||
//log_message(type,buffer);
|
||||
EQEmuLogSys::Hex(log_category, (const char *)p->pBuffer, p->size);
|
||||
}
|
||||
|
||||
*/
|
||||
void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@ -129,8 +129,7 @@ public:
|
||||
void MakeDirectory(std::string directory_name);
|
||||
void SetCurrentTimeStamp(char* time_stamp);
|
||||
void StartFileLogs(const std::string log_name);
|
||||
void Hex(uint16 log_category, const void *data, unsigned long length, unsigned char padding);
|
||||
void Raw(uint16 log_category, uint16 seq, const BasePacket *p);
|
||||
void Hex(uint16 log_category, const void *data, unsigned long length, unsigned char padding = 4);
|
||||
|
||||
struct LogSettings{
|
||||
uint8 log_to_file;
|
||||
|
||||
@ -46,7 +46,16 @@ const LogTypeStatus *log_type_info = real_log_type_info;
|
||||
|
||||
|
||||
|
||||
z
|
||||
void log_hex(LogType type, const void *data, unsigned long length, unsigned char padding) {
|
||||
if(!is_log_enabled(type))
|
||||
return;
|
||||
char buffer[80];
|
||||
uint32 offset;
|
||||
for(offset=0;offset<length;offset+=16) {
|
||||
build_hex_line((const char *)data,length,offset,buffer,padding);
|
||||
// log_message(type, "%s", buffer); //%s is to prevent % escapes in the ascii
|
||||
}
|
||||
}
|
||||
|
||||
void log_packet(LogType type, const BasePacket *p) {
|
||||
if(!is_log_enabled(type))
|
||||
|
||||
@ -68,7 +68,7 @@ bool LauncherLink::Process() {
|
||||
|
||||
ServerPacket *pack = 0;
|
||||
while((pack = tcpc->PopPacket())) {
|
||||
_hex(WORLD__ZONE_TRACE,pack->pBuffer,pack->size);
|
||||
Log.Hex(Logs::Netcode, pack->pBuffer, pack->size);
|
||||
if (!authenticated) {
|
||||
if (WorldConfig::get()->SharedKey.length() > 0) {
|
||||
if (pack->opcode == ServerOP_ZAAuth && pack->size == 16) {
|
||||
|
||||
@ -97,7 +97,7 @@ bool LoginServer::Process() {
|
||||
while((pack = tcpc->PopPacket()))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode);
|
||||
_hex(WORLD__LS_TRACE,pack->pBuffer,pack->size);
|
||||
Log.Hex(Logs::Netcode, pack->pBuffer, pack->size);
|
||||
|
||||
switch(pack->opcode) {
|
||||
case 0:
|
||||
|
||||
@ -177,7 +177,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
ServerPacket *pack = 0;
|
||||
while((pack = tcpc->PopPacket())) {
|
||||
_hex(WORLD__ZONE_TRACE,pack->pBuffer,pack->size);
|
||||
Log.Hex(Logs::Netcode, pack->pBuffer, pack->size);
|
||||
if (!authenticated) {
|
||||
if (WorldConfig::get()->SharedKey.length() > 0) {
|
||||
if (pack->opcode == ServerOP_ZAAuth && pack->size == 16) {
|
||||
|
||||
@ -141,7 +141,7 @@ void WorldServer::Process() {
|
||||
ServerPacket *pack = 0;
|
||||
while((pack = tcpc.PopPacket())) {
|
||||
Log.Out(Logs::Detail, Logs::Zone_Server, "Got 0x%04x from world:", pack->opcode);
|
||||
_hex(ZONE__WORLD_TRACE,pack->pBuffer,pack->size);
|
||||
Log.Hex(Logs::Netcode, pack->pBuffer, pack->size);
|
||||
switch(pack->opcode) {
|
||||
case 0: {
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user