_log replacements in various spots

This commit is contained in:
Akkadius 2015-01-12 23:08:35 -06:00
parent 733159923a
commit b219d73163
4 changed files with 8 additions and 8 deletions

View File

@ -40,7 +40,7 @@
#define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \ #define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \
if(Packet->size != sizeof(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); \ DumpPacket(Packet); \
return; \ return; \
} }

View File

@ -64,7 +64,7 @@
//check length of packet before decoding. Call before setup. //check length of packet before decoding. Call before setup.
#define ENCODE_LENGTH_EXACT(struct_) \ #define ENCODE_LENGTH_EXACT(struct_) \
if((*p)->size != sizeof(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); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \
delete *p; \ delete *p; \
*p = nullptr; \ *p = nullptr; \
@ -72,7 +72,7 @@
} }
#define ENCODE_LENGTH_ATLEAST(struct_) \ #define ENCODE_LENGTH_ATLEAST(struct_) \
if((*p)->size < sizeof(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); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \
delete *p; \ delete *p; \
*p = nullptr; \ *p = nullptr; \
@ -127,14 +127,14 @@
#define DECODE_LENGTH_EXACT(struct_) \ #define DECODE_LENGTH_EXACT(struct_) \
if(__packet->size != sizeof(struct_)) { \ if(__packet->size != sizeof(struct_)) { \
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ __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); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \
return; \ return; \
} }
#define DECODE_LENGTH_ATLEAST(struct_) \ #define DECODE_LENGTH_ATLEAST(struct_) \
if(__packet->size < sizeof(struct_)) { \ if(__packet->size < sizeof(struct_)) { \
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ __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); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \
return; \ return; \
} }

View File

@ -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) { 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 = 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() max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2()
if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { 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 //figure out how many AA points we get from the exp were setting
m_pp.aapoints = set_aaxp / max_AAXP; 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 //get remainder exp points, set in PP below
set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints);

View File

@ -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. // I suspect this is the type field to indicate this is a quest task, as opposed to other types.
tcs->unknown04 = 0x00000002; tcs->unknown04 = 0x00000002;
_log("[TASKS]SendTasksComplete"); logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks, "SendTasksComplete");
DumpPacket(outapp); fflush(stdout); DumpPacket(outapp); fflush(stdout);
QueuePacket(outapp); QueuePacket(outapp);