mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Buildable state with converting hex packet dumps
This commit is contained in:
@@ -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;
|
||||
|
||||
+10
-1
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user