From b219d7316301c748f1f24190efbc2477dcac2281 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 23:08:35 -0600 Subject: [PATCH] _log replacements in various spots --- common/misc_functions.h | 2 +- common/patches/ss_define.h | 8 ++++---- zone/exp.cpp | 4 ++-- zone/tasks.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/misc_functions.h b/common/misc_functions.h index 610a86b04..7900bc855 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -40,7 +40,7 @@ #define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \ if(Packet->size != sizeof(StructName)) \ { \ - _log(NET__ERROR, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ DumpPacket(Packet); \ return; \ } diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index 23d5dbbad..fbaee3689 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -64,7 +64,7 @@ //check length of packet before decoding. Call before setup. #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ - _log(NET__STRUCTS, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::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); \ delete *p; \ *p = nullptr; \ @@ -72,7 +72,7 @@ } #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ - _log(NET__STRUCTS, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::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); \ delete *p; \ *p = nullptr; \ @@ -127,14 +127,14 @@ #define DECODE_LENGTH_EXACT(struct_) \ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - _log(NET__STRUCTS, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::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); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - _log(NET__STRUCTS, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::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); \ return; \ } diff --git a/zone/exp.cpp b/zone/exp.cpp index a96b9a9a0..c1ceeeae2 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -240,7 +240,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { } void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { - _log(CLIENT__EXP, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); + logger.LogDebug(EQEmuLogSys::Detail, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); //max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { @@ -308,7 +308,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { //figure out how many AA points we get from the exp were setting m_pp.aapoints = set_aaxp / max_AAXP; - _log(CLIENT__EXP, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); + logger.LogDebug(EQEmuLogSys::Detail, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); //get remainder exp points, set in PP below set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 1cd2588e1..37dc89fc2 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -2262,7 +2262,7 @@ void Client::SendTaskComplete(int TaskIndex) { // I suspect this is the type field to indicate this is a quest task, as opposed to other types. tcs->unknown04 = 0x00000002; - _log("[TASKS]SendTasksComplete"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks, "SendTasksComplete"); DumpPacket(outapp); fflush(stdout); QueuePacket(outapp);