From b3bedef7af1cfc1c2a0995c9770019c537406647 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 03:23:36 -0600 Subject: [PATCH] Bunch of crazy changes to remove logsys --- common/eq_stream.cpp | 20 ++++++++++---------- common/eqemu_logsys.cpp | 20 ++++++++++++++++++++ common/eqemu_logsys.h | 2 ++ common/logsys.cpp | 11 +---------- common/logsys.h | 8 +++++--- common/patches/rof.cpp | 26 +++++++++++++------------- common/patches/rof2.cpp | 26 +++++++++++++------------- common/patches/sod.cpp | 18 +++++++++--------- common/patches/sof.cpp | 4 ++-- common/patches/ss_define.h | 8 ++++---- common/patches/underfoot.cpp | 18 +++++++++--------- 11 files changed, 88 insertions(+), 73 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index c409e275b..aa08070bb 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -93,7 +93,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) { EQRawApplicationPacket *ap=nullptr; Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, p->size); - _raw(NET__APP_CREATE_HEX, 0xFFFF, p); + // _raw(NET__APP_CREATE_HEX, 0xFFFF, p); ap = p->MakeAppPacket(); return ap; } @@ -102,7 +102,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf { EQRawApplicationPacket *ap=nullptr; Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, len); - _hex(NET__APP_CREATE_HEX, buf, len); + Log.Hex(Logs::Netcode, buf, len); ap = new EQRawApplicationPacket(buf, len); return ap; } @@ -133,7 +133,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) { Log.Out(Logs::Detail, Logs::Netcode, _L "Session not initialized, packet ignored" __L); - _raw(NET__DEBUG, 0xFFFF, p); + // _raw(NET__DEBUG, 0xFFFF, p); return; } @@ -144,7 +144,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) subpacket_length=*(p->pBuffer+processed); EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length); Log.Out(Logs::Detail, Logs::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); - _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); + // _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; @@ -185,7 +185,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { Log.Out(Logs::Detail, Logs::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); - _raw(NET__DEBUG, seq, p); + // _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); @@ -194,7 +194,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } else if (check == SeqPast) { Log.Out(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); - _raw(NET__DEBUG, seq, p); + // _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); //we already got this packet but it was out of order } else { // In case we did queue one before as well. @@ -210,7 +210,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2); Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); - _raw(NET__NET_CREATE_HEX, seq, subp); + // _raw(NET__NET_CREATE_HEX, seq, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; @@ -235,7 +235,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { Log.Out(Logs::Detail, Logs::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); - _raw(NET__DEBUG, seq, p); + // _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); @@ -244,7 +244,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } else if (check == SeqPast) { Log.Out(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); - _raw(NET__DEBUG, seq, p); + // _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); } else { // In case we did queue one before as well. @@ -263,7 +263,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset); Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); - //_raw(NET__NET_CREATE_HEX, subp); + //// _raw(NET__NET_CREATE_HEX, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 6f9611012..b8302fe20 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -18,9 +18,11 @@ #include "eqemu_logsys.h" +// #include "base_packet.h" #include "platform.h" #include "string_util.h" #include "database.h" +#include "misc.h" #include #include @@ -162,6 +164,24 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m #endif } +void EQEmuLogSys::Hex(uint16 log_category, const void *data, unsigned long length, unsigned char padding) { + 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 EQEmuLogSys::Raw(uint16 log_category, uint16 seq, const BasePacket *p) { + return; + char buffer[196]; + p->build_raw_header_dump(buffer, seq); + //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; diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index d92fc25aa..5288128fc 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -129,6 +129,8 @@ 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); struct LogSettings{ uint8 log_to_file; diff --git a/common/logsys.cpp b/common/logsys.cpp index f1fa6ed53..8e56ea9d7 100644 --- a/common/logsys.cpp +++ b/common/logsys.cpp @@ -46,16 +46,7 @@ const LogTypeStatus *log_type_info = real_log_type_info; -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 #include "types.h" @@ -70,7 +71,6 @@ extern void log_packet(LogType type, const BasePacket *p); extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); #ifndef DISABLE_LOGSYS -/* these are macros which do not use ..., and work for anybody */ #define _hex( type, data, len) \ do { \ if(log_type_info[ type ].enabled) { \ @@ -83,7 +83,7 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); log_packet(type, packet); \ } \ } while(false) - #define _raw( type, seq, packet) \ + #define // _raw( type, seq, packet) \ do { \ if(log_type_info[ type ].enabled) { \ log_raw_packet(type, seq, packet); \ @@ -93,7 +93,7 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); #else #define _hex( type, data, len) {} #define _pkt( type, packet) {} - #define _raw( type, seq, packet) {} + #define // _raw( type, seq, packet) {} #endif //!DISABLE_LOGSYS #ifdef ZONE class Mob; @@ -114,6 +114,8 @@ extern void log_toggle(LogType t); #define is_log_enabled( type ) \ log_type_info[ type ].enabled +*/ + // extern bool load_log_settings(const char *filename); #endif /*LOGSYS_H_*/ diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 33eac8c24..53b0e9fed 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -592,7 +592,7 @@ namespace RoF delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -986,7 +986,7 @@ namespace RoF structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer; memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1)); memcpy(ggs->name2, gjs->membername, sizeof(ggs->name2)); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; @@ -1062,7 +1062,7 @@ namespace RoF VARSTRUCT_ENCODE_TYPE(uint16, Buffer, 0); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct)); @@ -1090,7 +1090,7 @@ namespace RoF GLAAus->NPCMarkerID = emu->NPCMarkerID; memcpy(&GLAAus->LeaderAAs, &emu->leader_aas, sizeof(GLAAus->LeaderAAs)); - //_hex(NET__ERROR, __packet->pBuffer, __packet->size); + //Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); FINISH_ENCODE(); @@ -2567,7 +2567,7 @@ namespace RoF outapp->WriteUInt32(outapp->size - 9); CRC32::SetEQChecksum(outapp->pBuffer, outapp->size - 1, 8); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); delete in; @@ -2809,7 +2809,7 @@ namespace RoF } } - _hex(NET__ERROR, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); + Log.Hex(Logs::Netcode, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); FINISH_ENCODE(); } @@ -3567,7 +3567,7 @@ namespace RoF VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, x); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; } @@ -3905,7 +3905,7 @@ namespace RoF Log.Out(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4299,7 +4299,7 @@ namespace RoF { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4313,7 +4313,7 @@ namespace RoF { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4327,7 +4327,7 @@ namespace RoF { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4341,7 +4341,7 @@ namespace RoF { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4503,7 +4503,7 @@ namespace RoF emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); - _hex(NET__ERROR, eq, sizeof(structs::MoveItem_Struct)); + Log.Hex(Logs::Netcode, eq, sizeof(structs::MoveItem_Struct)); FINISH_DIRECT_DECODE(); } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 7421eefbd..d376bfb5e 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -658,7 +658,7 @@ namespace RoF2 delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -1052,7 +1052,7 @@ namespace RoF2 structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer; memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1)); memcpy(ggs->name2, gjs->membername, sizeof(ggs->name2)); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; @@ -1128,7 +1128,7 @@ namespace RoF2 VARSTRUCT_ENCODE_TYPE(uint16, Buffer, 0); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct)); @@ -1156,7 +1156,7 @@ namespace RoF2 GLAAus->NPCMarkerID = emu->NPCMarkerID; memcpy(&GLAAus->LeaderAAs, &emu->leader_aas, sizeof(GLAAus->LeaderAAs)); - //_hex(NET__ERROR, __packet->pBuffer, __packet->size); + //Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); FINISH_ENCODE(); @@ -2651,7 +2651,7 @@ namespace RoF2 outapp->WriteUInt32(outapp->size - 9); CRC32::SetEQChecksum(outapp->pBuffer, outapp->size - 1, 8); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); delete in; @@ -2893,7 +2893,7 @@ namespace RoF2 } } - _hex(NET__ERROR, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); + Log.Hex(Logs::Netcode, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); FINISH_ENCODE(); } @@ -3634,7 +3634,7 @@ namespace RoF2 VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, x); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; } @@ -3976,7 +3976,7 @@ namespace RoF2 Log.Out(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4371,7 +4371,7 @@ namespace RoF2 { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4385,7 +4385,7 @@ namespace RoF2 { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4399,7 +4399,7 @@ namespace RoF2 { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4413,7 +4413,7 @@ namespace RoF2 { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4574,7 +4574,7 @@ namespace RoF2 emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); - _hex(NET__ERROR, eq, sizeof(structs::MoveItem_Struct)); + Log.Hex(Logs::Netcode, eq, sizeof(structs::MoveItem_Struct)); FINISH_DIRECT_DECODE(); } diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index a19c4c45d..1639e57ed 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -398,7 +398,7 @@ namespace SoD delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -717,7 +717,7 @@ namespace SoD structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer; memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1)); memcpy(ggs->name2, gjs->membername, sizeof(ggs->name2)); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; @@ -792,7 +792,7 @@ namespace SoD VARSTRUCT_ENCODE_TYPE(uint16, Buffer, 0); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct)); @@ -819,7 +819,7 @@ namespace SoD GLAAus->NPCMarkerID = emu->NPCMarkerID; memcpy(&GLAAus->LeaderAAs, &emu->leader_aas, sizeof(GLAAus->LeaderAAs)); - //_hex(NET__ERROR, __packet->pBuffer, __packet->size); + //Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); FINISH_ENCODE(); @@ -2288,7 +2288,7 @@ namespace SoD VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, x); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; } @@ -2964,7 +2964,7 @@ namespace SoD { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -2978,7 +2978,7 @@ namespace SoD { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -2992,7 +2992,7 @@ namespace SoD { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3006,7 +3006,7 @@ namespace SoD { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index e6f804c66..2e5776a5d 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -378,7 +378,7 @@ namespace SoF delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -2097,7 +2097,7 @@ namespace SoF delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawns"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index 97f824983..1d59287ad 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -65,7 +65,7 @@ #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ - _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ + Log.Hex(Logs::Netcode, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ return; \ @@ -73,7 +73,7 @@ #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ - _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ + Log.Hex(Logs::Netcode, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ return; \ @@ -128,14 +128,14 @@ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ - _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ + Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ - _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ + Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); \ return; \ } diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 8ef3f8fb7..66b379840 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -533,7 +533,7 @@ namespace Underfoot delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -874,7 +874,7 @@ namespace Underfoot structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer; memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1)); memcpy(ggs->name2, gjs->membername, sizeof(ggs->name2)); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; @@ -950,7 +950,7 @@ namespace Underfoot VARSTRUCT_ENCODE_TYPE(uint16, Buffer, 0); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct)); @@ -976,7 +976,7 @@ namespace Underfoot GLAAus->NPCMarkerID = emu->NPCMarkerID; memcpy(&GLAAus->LeaderAAs, &emu->leader_aas, sizeof(GLAAus->LeaderAAs)); - //_hex(NET__ERROR, __packet->pBuffer, __packet->size); + //Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); FINISH_ENCODE(); @@ -2554,7 +2554,7 @@ namespace Underfoot VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, x); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; } @@ -3277,7 +3277,7 @@ namespace Underfoot { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -3291,7 +3291,7 @@ namespace Underfoot { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3305,7 +3305,7 @@ namespace Underfoot { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3319,7 +3319,7 @@ namespace Underfoot { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct);