Replaced Debug messages: LogFile->write with logger.LogDebug

This commit is contained in:
Akkadius 2015-01-10 15:26:38 -06:00
parent ebb2659630
commit dadae1a71f
22 changed files with 183 additions and 167 deletions

View File

@ -17,6 +17,7 @@
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include "../common/faction.h" #include "../common/faction.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/spdat.h" #include "../common/spdat.h"
@ -344,7 +345,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
// Aggro // Aggro
#if EQDEBUG>=6 #if EQDEBUG>=6
LogFile->write(EQEmuLog::Debug, "Check aggro for %s target %s.", GetName(), mob->GetName()); logger.LogDebug(EQEmuLogSys::General, "Check aggro for %s target %s.", GetName(), mob->GetName());
#endif #endif
return( mod_will_aggro(mob, this) ); return( mod_will_aggro(mob, this) );
} }
@ -469,7 +470,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) {
//Father Nitwit: make sure we can see them. //Father Nitwit: make sure we can see them.
if(mob->CheckLosFN(sender)) { if(mob->CheckLosFN(sender)) {
#if (EQDEBUG>=5) #if (EQDEBUG>=5)
LogFile->write(EQEmuLog::Debug, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", logger.LogDebug(EQEmuLogSys::General, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f",
sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ())); sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ()));
#endif #endif
mob->AddToHateList(attacker, 1, 0, false); mob->AddToHateList(attacker, 1, 0, false);
@ -696,7 +697,7 @@ type', in which case, the answer is yes.
} }
while( reverse++ == 0 ); while( reverse++ == 0 );
LogFile->write(EQEmuLog::Debug, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); logger.LogDebug(EQEmuLogSys::General, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName());
return false; return false;
} }
@ -836,7 +837,7 @@ bool Mob::IsBeneficialAllowed(Mob *target)
} }
while( reverse++ == 0 ); while( reverse++ == 0 );
LogFile->write(EQEmuLog::Debug, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); logger.LogDebug(EQEmuLogSys::General, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName());
return false; return false;
} }
@ -948,7 +949,7 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION; oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION;
#if LOSDEBUG>=5 #if LOSDEBUG>=5
LogFile->write(EQEmuLog::Debug, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); logger.LogDebug(EQEmuLogSys::General, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize);
#endif #endif
return zone->zonemap->CheckLoS(myloc, oloc); return zone->zonemap->CheckLoS(myloc, oloc);
} }

View File

@ -61,7 +61,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
if (weapon && weapon->IsType(ItemClassCommon)) { if (weapon && weapon->IsType(ItemClassCommon)) {
const Item_Struct* item = weapon->GetItem(); const Item_Struct* item = weapon->GetItem();
#if EQDEBUG >= 11 #if EQDEBUG >= 11
LogFile->write(EQEmuLog::Debug, "Weapon skill:%i", item->ItemType); logger.LogDebug(EQEmuLogSys::General, "Weapon skill:%i", item->ItemType);
#endif #endif
switch (item->ItemType) switch (item->ItemType)
{ {
@ -192,7 +192,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
chancetohit += RuleR(Combat, NPCBonusHitChance); chancetohit += RuleR(Combat, NPCBonusHitChance);
#if ATTACK_DEBUG>=11 #if ATTACK_DEBUG>=11
LogFile->write(EQEmuLog::Debug, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); logger.LogDebug(EQEmuLogSys::General, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
#endif #endif
mlog(COMBAT__TOHIT,"CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); mlog(COMBAT__TOHIT,"CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
@ -334,7 +334,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
//agains a garunteed riposte (for example) discipline... for now, garunteed hit wins //agains a garunteed riposte (for example) discipline... for now, garunteed hit wins
#if EQDEBUG>=11 #if EQDEBUG>=11
LogFile->write(EQEmuLog::Debug, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); logger.LogDebug(EQEmuLogSys::General, "3 FINAL calculated chance to hit is: %5.2f", chancetohit);
#endif #endif
// //
@ -2036,7 +2036,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack
{ {
zone->DelAggroMob(); zone->DelAggroMob();
#if EQDEBUG >= 11 #if EQDEBUG >= 11
LogFile->write(EQEmuLog::Debug,"NPC::Death() Mobs currently Aggro %i", zone->MobsAggroCount()); logger.LogDebug(EQEmuLogSys::General,"NPC::Death() Mobs currently Aggro %i", zone->MobsAggroCount());
#endif #endif
} }
SetHP(0); SetHP(0);

View File

@ -8550,7 +8550,7 @@ int32 Bot::CalcMaxMana() {
} }
default: default:
{ {
LogFile->write(EQEmuLog::Debug, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
max_mana = 0; max_mana = 0;
break; break;
} }

View File

@ -34,6 +34,7 @@
extern volatile bool RunLoops; extern volatile bool RunLoops;
#include "../common/eqemu_logsys.h"
#include "../common/features.h" #include "../common/features.h"
#include "../common/spdat.h" #include "../common/spdat.h"
#include "../common/guilds.h" #include "../common/guilds.h"
@ -339,7 +340,7 @@ Client::~Client() {
ToggleBuyerMode(false); ToggleBuyerMode(false);
if(conn_state != ClientConnectFinished) { if(conn_state != ClientConnectFinished) {
LogFile->write(EQEmuLog::Debug, "Client '%s' was destroyed before reaching the connected state:", GetName()); logger.LogDebug(EQEmuLogSys::General, "Client '%s' was destroyed before reaching the connected state:", GetName());
ReportConnectingState(); ReportConnectingState();
} }
@ -437,31 +438,31 @@ void Client::SendLogoutPackets() {
void Client::ReportConnectingState() { void Client::ReportConnectingState() {
switch(conn_state) { switch(conn_state) {
case NoPacketsReceived: //havent gotten anything case NoPacketsReceived: //havent gotten anything
LogFile->write(EQEmuLog::Debug, "Client has not sent us an initial zone entry packet."); logger.LogDebug(EQEmuLogSys::General, "Client has not sent us an initial zone entry packet.");
break; break;
case ReceivedZoneEntry: //got the first packet, loading up PP case ReceivedZoneEntry: //got the first packet, loading up PP
LogFile->write(EQEmuLog::Debug, "Client sent initial zone packet, but we never got their player info from the database."); logger.LogDebug(EQEmuLogSys::General, "Client sent initial zone packet, but we never got their player info from the database.");
break; break;
case PlayerProfileLoaded: //our DB work is done, sending it case PlayerProfileLoaded: //our DB work is done, sending it
LogFile->write(EQEmuLog::Debug, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); logger.LogDebug(EQEmuLogSys::General, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished.");
break; break;
case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather
LogFile->write(EQEmuLog::Debug, "We successfully sent player info and spawns, waiting for client to request new zone."); logger.LogDebug(EQEmuLogSys::General, "We successfully sent player info and spawns, waiting for client to request new zone.");
break; break;
case NewZoneRequested: //received and sent new zone request case NewZoneRequested: //received and sent new zone request
LogFile->write(EQEmuLog::Debug, "We received client's new zone request, waiting for client spawn request."); logger.LogDebug(EQEmuLogSys::General, "We received client's new zone request, waiting for client spawn request.");
break; break;
case ClientSpawnRequested: //client sent ReqClientSpawn case ClientSpawnRequested: //client sent ReqClientSpawn
LogFile->write(EQEmuLog::Debug, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); logger.LogDebug(EQEmuLogSys::General, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished.");
break; break;
case ZoneContentsSent: //objects, doors, zone points case ZoneContentsSent: //objects, doors, zone points
LogFile->write(EQEmuLog::Debug, "The rest of the zone contents were successfully sent, waiting for client ready notification."); logger.LogDebug(EQEmuLogSys::General, "The rest of the zone contents were successfully sent, waiting for client ready notification.");
break; break;
case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc
LogFile->write(EQEmuLog::Debug, "We received client ready notification, but never finished Client::CompleteConnect"); logger.LogDebug(EQEmuLogSys::General, "We received client ready notification, but never finished Client::CompleteConnect");
break; break;
case ClientConnectFinished: //client finally moved to finished state, were done here case ClientConnectFinished: //client finally moved to finished state, were done here
LogFile->write(EQEmuLog::Debug, "Client is successfully connected."); logger.LogDebug(EQEmuLogSys::General, "Client is successfully connected.");
break; break;
}; };
} }
@ -701,7 +702,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
#if EQDEBUG >= 11 #if EQDEBUG >= 11
LogFile->write(EQEmuLog::Debug,"Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); logger.LogDebug(EQEmuLogSys::General,"Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message);
#endif #endif
if (targetname == nullptr) { if (targetname == nullptr) {
@ -2111,7 +2112,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){
SaveCurrency(); SaveCurrency();
LogFile->write(EQEmuLog::Debug, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); logger.LogDebug(EQEmuLogSys::General, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper);
} }
void Client::EVENT_ITEM_ScriptStopReturn(){ void Client::EVENT_ITEM_ScriptStopReturn(){
@ -2151,7 +2152,7 @@ void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 plat
SaveCurrency(); SaveCurrency();
#if (EQDEBUG>=5) #if (EQDEBUG>=5)
LogFile->write(EQEmuLog::Debug, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", logger.LogDebug(EQEmuLogSys::General, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i",
GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper);
#endif #endif
} }
@ -4550,14 +4551,14 @@ void Client::HandleLDoNOpen(NPC *target)
{ {
if(target->GetClass() != LDON_TREASURE) if(target->GetClass() != LDON_TREASURE)
{ {
LogFile->write(EQEmuLog::Debug, "%s tried to open %s but %s was not a treasure chest.", logger.LogDebug(EQEmuLogSys::General, "%s tried to open %s but %s was not a treasure chest.",
GetName(), target->GetName(), target->GetName()); GetName(), target->GetName(), target->GetName());
return; return;
} }
if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse)) if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse))
{ {
LogFile->write(EQEmuLog::Debug, "%s tried to open %s but %s was out of range", logger.LogDebug(EQEmuLogSys::General, "%s tried to open %s but %s was out of range",
GetName(), target->GetName(), target->GetName()); GetName(), target->GetName(), target->GetName());
Message(13, "Treasure chest out of range."); Message(13, "Treasure chest out of range.");
return; return;
@ -8155,7 +8156,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_
entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name);
#if EQDEBUG >= 5 #if EQDEBUG >= 5
LogFile->write(EQEmuLog::Debug, "Eating from slot:%i", (int)slot); logger.LogDebug(EQEmuLogSys::General, "Eating from slot:%i", (int)slot);
#endif #endif
} }
else else
@ -8172,7 +8173,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name);
#if EQDEBUG >= 5 #if EQDEBUG >= 5
LogFile->write(EQEmuLog::Debug, "Drinking from slot:%i", (int)slot); logger.LogDebug(EQEmuLogSys::General, "Drinking from slot:%i", (int)slot);
#endif #endif
} }
} }

View File

@ -17,6 +17,7 @@
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include "../common/logsys.h" #include "../common/logsys.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/spdat.h" #include "../common/spdat.h"
@ -934,7 +935,7 @@ int32 Client::CalcMaxMana()
break; break;
} }
default: { default: {
LogFile->write(EQEmuLog::Debug, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
max_mana = 0; max_mana = 0;
break; break;
} }
@ -955,7 +956,7 @@ int32 Client::CalcMaxMana()
} }
#if EQDEBUG >= 11 #if EQDEBUG >= 11
LogFile->write(EQEmuLog::Debug, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); logger.LogDebug(EQEmuLogSys::General, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana);
#endif #endif
return max_mana; return max_mana;
} }
@ -1045,14 +1046,14 @@ int32 Client::CalcBaseMana()
break; break;
} }
default: { default: {
LogFile->write(EQEmuLog::Debug, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
max_m = 0; max_m = 0;
break; break;
} }
} }
#if EQDEBUG >= 11 #if EQDEBUG >= 11
LogFile->write(EQEmuLog::Debug, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); logger.LogDebug(EQEmuLogSys::General, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m);
#endif #endif
return max_m; return max_m;
} }

View File

@ -16,6 +16,7 @@
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <math.h> #include <math.h>
@ -415,7 +416,7 @@ int Client::HandlePacket(const EQApplicationPacket *app)
#ifdef SOLAR #ifdef SOLAR
if(0 && opcode != OP_ClientUpdate) if(0 && opcode != OP_ClientUpdate)
{ {
LogFile->write(EQEmuLog::Debug,"HandlePacket() OPCODE debug enabled client %s", GetName()); logger.LogDebug(EQEmuLogSys::General,"HandlePacket() OPCODE debug enabled client %s", GetName());
std::cerr << "OPCODE: " << std::hex << std::setw(4) << std::setfill('0') << opcode << std::dec << ", size: " << app->size << std::endl; std::cerr << "OPCODE: " << std::hex << std::setw(4) << std::setfill('0') << opcode << std::dec << ", size: " << app->size << std::endl;
DumpPacket(app); DumpPacket(app);
} }
@ -482,7 +483,7 @@ int Client::HandlePacket(const EQApplicationPacket *app)
case CLIENT_LINKDEAD: case CLIENT_LINKDEAD:
break; break;
default: default:
LogFile->write(EQEmuLog::Debug, "Unknown client_state: %d\n", client_state); logger.LogDebug(EQEmuLogSys::General, "Unknown client_state: %d\n", client_state);
break; break;
} }
@ -1316,7 +1317,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
ClientVersionBit = 0; ClientVersionBit = 0;
bool siv = m_inv.SetInventoryVersion(ClientVersion); bool siv = m_inv.SetInventoryVersion(ClientVersion);
LogFile->write(EQEmuLog::Debug, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); logger.LogDebug(EQEmuLogSys::General, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion);
/* Antighost code /* Antighost code
tmp var is so the search doesnt find this object tmp var is so the search doesnt find this object
@ -1940,7 +1941,7 @@ void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(AcceptNewTask_Struct)) { if (app->size != sizeof(AcceptNewTask_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_AcceptNewTask expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AcceptNewTask expected %i got %i",
sizeof(AcceptNewTask_Struct), app->size); sizeof(AcceptNewTask_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
@ -2280,7 +2281,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(Adventure_Sell_Struct)) if (app->size != sizeof(Adventure_Sell_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", logger.LogDebug(EQEmuLogSys::General, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u",
app->size, sizeof(Adventure_Sell_Struct)); app->size, sizeof(Adventure_Sell_Struct));
DumpPacket(app); DumpPacket(app);
return; return;
@ -2994,7 +2995,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
DeleteItemInInventory(ApplyPoisonData->inventorySlot, 1, true); DeleteItemInInventory(ApplyPoisonData->inventorySlot, 1, true);
LogFile->write(EQEmuLog::Debug, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); logger.LogDebug(EQEmuLogSys::General, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult);
} }
} }
@ -3009,7 +3010,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
void Client::Handle_OP_Assist(const EQApplicationPacket *app) void Client::Handle_OP_Assist(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(EntityId_Struct)) { if (app->size != sizeof(EntityId_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size);
return; return;
} }
@ -3039,7 +3040,7 @@ void Client::Handle_OP_Assist(const EQApplicationPacket *app)
void Client::Handle_OP_AssistGroup(const EQApplicationPacket *app) void Client::Handle_OP_AssistGroup(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(EntityId_Struct)) { if (app->size != sizeof(EntityId_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size);
return; return;
} }
QueuePacket(app); QueuePacket(app);
@ -3052,7 +3053,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app)
// Some clients this seems to nuke the charm text (ex. Adventurer's Stone) // Some clients this seems to nuke the charm text (ex. Adventurer's Stone)
if (app->size != sizeof(AugmentInfo_Struct)) { if (app->size != sizeof(AugmentInfo_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_AugmentInfo expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AugmentInfo expected %i got %i",
sizeof(AugmentInfo_Struct), app->size); sizeof(AugmentInfo_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
@ -3295,7 +3296,7 @@ void Client::Handle_OP_AutoAttack2(const EQApplicationPacket *app)
void Client::Handle_OP_AutoFire(const EQApplicationPacket *app) void Client::Handle_OP_AutoFire(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(bool)) { if (app->size != sizeof(bool)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -3311,7 +3312,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app)
// Although there are three different structs for OP_Bandolier, they are all the same size. // Although there are three different structs for OP_Bandolier, they are all the same size.
// //
if (app->size != sizeof(BandolierCreate_Struct)) { if (app->size != sizeof(BandolierCreate_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_Bandolier expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Bandolier expected %i got %i",
sizeof(BandolierCreate_Struct), app->size); sizeof(BandolierCreate_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
@ -3330,7 +3331,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app)
SetBandolier(app); SetBandolier(app);
break; break;
default: default:
LogFile->write(EQEmuLog::Debug, "Uknown Bandolier action %i", bs->action); logger.LogDebug(EQEmuLogSys::General, "Uknown Bandolier action %i", bs->action);
} }
} }
@ -3339,7 +3340,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(BankerChange_Struct) && app->size != 4) //Titanium only sends 4 Bytes for this if (app->size != sizeof(BankerChange_Struct) && app->size != 4) //Titanium only sends 4 Bytes for this
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -3424,7 +3425,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app)
if (app->size < 4) if (app->size < 4)
{ {
LogFile->write(EQEmuLog::Debug, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); logger.LogDebug(EQEmuLogSys::General, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -3730,7 +3731,7 @@ void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app)
LogFile->write(EQEmuLog::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); LogFile->write(EQEmuLog::Error, "Bindwound on non-exsistant mob from %s", this->GetName());
} }
else { else {
LogFile->write(EQEmuLog::Debug, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); logger.LogDebug(EQEmuLogSys::General, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName());
BindWound(bindmob, true); BindWound(bindmob, true);
} }
return; return;
@ -3743,7 +3744,7 @@ void Client::Handle_OP_BlockedBuffs(const EQApplicationPacket *app)
if (app->size != sizeof(BlockedBuffs_Struct)) if (app->size != sizeof(BlockedBuffs_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_BlockedBuffs expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_BlockedBuffs expected %i got %i",
sizeof(BlockedBuffs_Struct), app->size); sizeof(BlockedBuffs_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -3941,7 +3942,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(CancelTask_Struct)) { if (app->size != sizeof(CancelTask_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_CancelTask expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_CancelTask expected %i got %i",
sizeof(CancelTask_Struct), app->size); sizeof(CancelTask_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
@ -4006,16 +4007,16 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
targetring_z = castspell->z_pos; targetring_z = castspell->z_pos;
#ifdef _EQDEBUG #ifdef _EQDEBUG
LogFile->write(EQEmuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]);
LogFile->write(EQEmuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]);
LogFile->write(EQEmuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]);
LogFile->write(EQEmuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]);
LogFile->write(EQEmuLog::Debug, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown);
LogFile->write(EQEmuLog::Debug, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown);
LogFile->write(EQEmuLog::Debug, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16));
LogFile->write(EQEmuLog::Debug, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16));
#endif #endif
LogFile->write(EQEmuLog::Debug, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); logger.LogDebug(EQEmuLogSys::General, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot);
std::cout << "OP_CastSpell " << castspell->slot << " spell " << castspell->spell_id << " inventory slot " << castspell->inventoryslot << "\n" << std::endl; std::cout << "OP_CastSpell " << castspell->slot << " spell " << castspell->spell_id << " inventory slot " << castspell->inventoryslot << "\n" << std::endl;
@ -4047,7 +4048,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
//discipline, using the item spell slot //discipline, using the item spell slot
if (castspell->inventoryslot == INVALID_INDEX) { if (castspell->inventoryslot == INVALID_INDEX) {
if (!UseDiscipline(castspell->spell_id, castspell->target_id)) { if (!UseDiscipline(castspell->spell_id, castspell->target_id)) {
LogFile->write(EQEmuLog::Debug, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); logger.LogDebug(EQEmuLogSys::General, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id);
InterruptSpell(castspell->spell_id); InterruptSpell(castspell->spell_id);
} }
return; return;
@ -4190,7 +4191,7 @@ void Client::Handle_OP_ClearBlockedBuffs(const EQApplicationPacket *app)
if (app->size != 1) if (app->size != 1)
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size);
DumpPacket(app); DumpPacket(app);
@ -4212,7 +4213,7 @@ void Client::Handle_OP_ClearNPCMarks(const EQApplicationPacket *app)
if (app->size != 0) if (app->size != 0)
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_ClearNPCMarks expected 0 got %i",
app->size); app->size);
DumpPacket(app); DumpPacket(app);
@ -4718,7 +4719,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(Consider_Struct)) if (app->size != sizeof(Consider_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size);
return; return;
} }
Consider_Struct* conin = (Consider_Struct*)app->pBuffer; Consider_Struct* conin = (Consider_Struct*)app->pBuffer;
@ -4812,7 +4813,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(Consider_Struct)) if (app->size != sizeof(Consider_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size);
return; return;
} }
Consider_Struct* conin = (Consider_Struct*)app->pBuffer; Consider_Struct* conin = (Consider_Struct*)app->pBuffer;
@ -5137,7 +5138,7 @@ void Client::Handle_OP_DelegateAbility(const EQApplicationPacket *app)
if (app->size != sizeof(DelegateAbility_Struct)) if (app->size != sizeof(DelegateAbility_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_DelegateAbility expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_DelegateAbility expected %i got %i",
sizeof(DelegateAbility_Struct), app->size); sizeof(DelegateAbility_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -5312,7 +5313,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app)
if (app->size != sizeof(DoGroupLeadershipAbility_Struct)) { if (app->size != sizeof(DoGroupLeadershipAbility_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i",
sizeof(DoGroupLeadershipAbility_Struct), app->size); sizeof(DoGroupLeadershipAbility_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -5364,7 +5365,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app)
} }
default: default:
LogFile->write(EQEmuLog::Debug, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", logger.LogDebug(EQEmuLogSys::General, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d",
dglas->Ability, dglas->Parameter); dglas->Ability, dglas->Parameter);
break; break;
} }
@ -5930,7 +5931,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app)
void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app) void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(GMTrainEnd_Struct)) { if (app->size != sizeof(GMTrainEnd_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -6180,7 +6181,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)
if (app->size < sizeof(GMSearchCorpse_Struct)) if (app->size < sizeof(GMSearchCorpse_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", logger.LogDebug(EQEmuLogSys::General, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u",
app->size, sizeof(GMSearchCorpse_Struct)); app->size, sizeof(GMSearchCorpse_Struct));
DumpPacket(app); DumpPacket(app);
return; return;
@ -6303,7 +6304,7 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app)
void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) void Client::Handle_OP_GMTraining(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(GMTrainee_Struct)) { if (app->size != sizeof(GMTrainee_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -6314,7 +6315,7 @@ void Client::Handle_OP_GMTraining(const EQApplicationPacket *app)
void Client::Handle_OP_GMTrainSkill(const EQApplicationPacket *app) void Client::Handle_OP_GMTrainSkill(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(GMSkillChange_Struct)) { if (app->size != sizeof(GMSkillChange_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -6448,7 +6449,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app)
return; return;
} }
LogFile->write(EQEmuLog::Debug, "Member Disband Request from %s\n", GetName()); logger.LogDebug(EQEmuLogSys::General, "Member Disband Request from %s\n", GetName());
GroupGeneric_Struct* gd = (GroupGeneric_Struct*)app->pBuffer; GroupGeneric_Struct* gd = (GroupGeneric_Struct*)app->pBuffer;
@ -6728,7 +6729,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app)
if (g->IsLeader(this)) if (g->IsLeader(this))
g->ChangeLeader(NewLeader); g->ChangeLeader(NewLeader);
else { else {
LogFile->write(EQEmuLog::Debug, "Group /makeleader request originated from non-leader member: %s", GetName()); logger.LogDebug(EQEmuLogSys::General, "Group /makeleader request originated from non-leader member: %s", GetName());
DumpPacket(app); DumpPacket(app);
} }
} }
@ -6819,7 +6820,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(GroupUpdate_Struct)) if (app->size != sizeof(GroupUpdate_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch on OP_GroupUpdate: got %u expected %u", logger.LogDebug(EQEmuLogSys::General, "Size mismatch on OP_GroupUpdate: got %u expected %u",
app->size, sizeof(GroupUpdate_Struct)); app->size, sizeof(GroupUpdate_Struct));
DumpPacket(app); DumpPacket(app);
return; return;
@ -6838,7 +6839,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app)
if (group->IsLeader(this)) if (group->IsLeader(this))
group->ChangeLeader(newleader); group->ChangeLeader(newleader);
else { else {
LogFile->write(EQEmuLog::Debug, "Group /makeleader request originated from non-leader member: %s", GetName()); logger.LogDebug(EQEmuLogSys::General, "Group /makeleader request originated from non-leader member: %s", GetName());
DumpPacket(app); DumpPacket(app);
} }
} }
@ -6847,7 +6848,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app)
default: default:
{ {
LogFile->write(EQEmuLog::Debug, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); logger.LogDebug(EQEmuLogSys::General, "Received unhandled OP_GroupUpdate requesting action %u", gu->action);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -7797,7 +7798,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(GuildStatus_Struct)) if (app->size != sizeof(GuildStatus_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GuildStatus expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GuildStatus expected %i got %i",
sizeof(GuildStatus_Struct), app->size); sizeof(GuildStatus_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -7854,7 +7855,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(GuildUpdateURLAndChannel_Struct)) if (app->size != sizeof(GuildUpdateURLAndChannel_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i",
sizeof(GuildUpdateURLAndChannel_Struct), app->size); sizeof(GuildUpdateURLAndChannel_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -7959,7 +7960,7 @@ void Client::Handle_OP_HideCorpse(const EQApplicationPacket *app)
// //
if (app->size != sizeof(HideCorpse_Struct)) if (app->size != sizeof(HideCorpse_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_HideCorpse expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_HideCorpse expected %i got %i",
sizeof(HideCorpse_Struct), app->size); sizeof(HideCorpse_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -8465,7 +8466,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
} }
if (slot_id < 0) { if (slot_id < 0) {
LogFile->write(EQEmuLog::Debug, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); logger.LogDebug(EQEmuLogSys::General, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot);
return; return;
} }
@ -8508,7 +8509,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
return; return;
} }
LogFile->write(EQEmuLog::Debug, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); logger.LogDebug(EQEmuLogSys::General, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id);
if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check
{ {
@ -8546,7 +8547,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
if ((spell_id <= 0) && (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol && item->ItemType != ItemTypeSpell)) if ((spell_id <= 0) && (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol && item->ItemType != ItemTypeSpell))
{ {
LogFile->write(EQEmuLog::Debug, "Item with no effect right clicked by %s", GetName()); logger.LogDebug(EQEmuLogSys::General, "Item with no effect right clicked by %s", GetName());
} }
else if (inst->IsType(ItemClassCommon)) else if (inst->IsType(ItemClassCommon))
{ {
@ -8619,7 +8620,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
{ {
if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol) if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol)
{ {
LogFile->write(EQEmuLog::Debug, "Error: unknown item->Click.Type (%i)", item->Click.Type); logger.LogDebug(EQEmuLogSys::General, "Error: unknown item->Click.Type (%i)", item->Click.Type);
} }
else else
{ {
@ -8635,7 +8636,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
else if (item->ItemType == ItemTypeAlcohol) else if (item->ItemType == ItemTypeAlcohol)
{ {
#if EQDEBUG >= 1 #if EQDEBUG >= 1
LogFile->write(EQEmuLog::Debug, "Drinking Alcohol from slot:%i", slot_id); logger.LogDebug(EQEmuLogSys::General, "Drinking Alcohol from slot:%i", slot_id);
#endif #endif
// This Seems to be handled in OP_DeleteItem handling // This Seems to be handled in OP_DeleteItem handling
//DeleteItemInInventory(slot_id, 1, false); //DeleteItemInInventory(slot_id, 1, false);
@ -8662,7 +8663,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
} }
else else
{ {
LogFile->write(EQEmuLog::Debug, "Error: unknown item->Click.Type (%i)", item->Click.Type); logger.LogDebug(EQEmuLogSys::General, "Error: unknown item->Click.Type (%i)", item->Click.Type);
} }
} }
} }
@ -8803,7 +8804,7 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app)
void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app) void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app)
{ {
if (app->size != 1) { if (app->size != 1) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -9345,7 +9346,7 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app)
if (app->size != sizeof(MercenaryCommand_Struct)) if (app->size != sizeof(MercenaryCommand_Struct))
{ {
Message(13, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); Message(13, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size);
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -9402,7 +9403,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
// The payload is 4 bytes. The EntityID of the Mercenary Liason which are of class 71. // The payload is 4 bytes. The EntityID of the Mercenary Liason which are of class 71.
if (app->size != sizeof(MercenaryMerchantShopRequest_Struct)) if (app->size != sizeof(MercenaryMerchantShopRequest_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size);
DumpPacket(app); DumpPacket(app);
@ -9537,7 +9538,7 @@ void Client::Handle_OP_MercenaryDataUpdateRequest(const EQApplicationPacket *app
if (app->size != 0) if (app->size != 0)
{ {
Message(13, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); Message(13, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size);
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -9557,7 +9558,7 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app)
if (app->size > 1) if (app->size > 1)
{ {
Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size);
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -9582,7 +9583,7 @@ void Client::Handle_OP_MercenaryHire(const EQApplicationPacket *app)
// The payload is 16 bytes. First four bytes are the Merc ID (Template ID) // The payload is 16 bytes. First four bytes are the Merc ID (Template ID)
if (app->size != sizeof(MercenaryMerchantRequest_Struct)) if (app->size != sizeof(MercenaryMerchantRequest_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -9654,7 +9655,7 @@ void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app)
if (app->size != sizeof(SuspendMercenary_Struct)) if (app->size != sizeof(SuspendMercenary_Struct))
{ {
Message(13, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); Message(13, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size);
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -9678,7 +9679,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app)
if (app->size > 1) if (app->size > 1)
{ {
Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size);
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -10534,7 +10535,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(PopupResponse_Struct)) { if (app->size != sizeof(PopupResponse_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_PopupResponse expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PopupResponse expected %i got %i",
sizeof(PopupResponse_Struct), app->size); sizeof(PopupResponse_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
@ -10569,7 +10570,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app)
void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(MovePotionToBelt_Struct)) { if (app->size != sizeof(MovePotionToBelt_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_PotionBelt expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PotionBelt expected %i got %i",
sizeof(MovePotionToBelt_Struct), app->size); sizeof(MovePotionToBelt_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
@ -10577,7 +10578,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app)
MovePotionToBelt_Struct *mptbs = (MovePotionToBelt_Struct*)app->pBuffer; MovePotionToBelt_Struct *mptbs = (MovePotionToBelt_Struct*)app->pBuffer;
if(!EQEmu::ValueWithin(mptbs->SlotNumber, 0U, 3U)) { if(!EQEmu::ValueWithin(mptbs->SlotNumber, 0U, 3U)) {
LogFile->write(EQEmuLog::Debug, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); logger.LogDebug(EQEmuLogSys::General, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range.");
return; return;
} }
@ -10600,7 +10601,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app)
void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(uint32)) { if (app->size != sizeof(uint32)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -10690,7 +10691,7 @@ void Client::Handle_OP_PVPLeaderBoardDetailsRequest(const EQApplicationPacket *a
// //
if (app->size != sizeof(PVPLeaderBoardDetailsRequest_Struct)) if (app->size != sizeof(PVPLeaderBoardDetailsRequest_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i",
sizeof(PVPLeaderBoardDetailsRequest_Struct), app->size); sizeof(PVPLeaderBoardDetailsRequest_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -10717,7 +10718,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app)
// //
if (app->size != sizeof(PVPLeaderBoardRequest_Struct)) if (app->size != sizeof(PVPLeaderBoardRequest_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i",
sizeof(PVPLeaderBoardRequest_Struct), app->size); sizeof(PVPLeaderBoardRequest_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -11403,7 +11404,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app)
TradeskillFavorites_Struct* tsf = (TradeskillFavorites_Struct*)app->pBuffer; TradeskillFavorites_Struct* tsf = (TradeskillFavorites_Struct*)app->pBuffer;
LogFile->write(EQEmuLog::Debug, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); logger.LogDebug(EQEmuLogSys::General, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id);
// results show that object_type is combiner type // results show that object_type is combiner type
// some_id = 0 if world combiner, item number otherwise // some_id = 0 if world combiner, item number otherwise
@ -11464,7 +11465,7 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app)
rss->query[55] = '\0'; //just to be sure. rss->query[55] = '\0'; //just to be sure.
LogFile->write(EQEmuLog::Debug, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); logger.LogDebug(EQEmuLogSys::General, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id);
// make where clause segment for container(s) // make where clause segment for container(s)
char containers[30]; char containers[30];
@ -11524,7 +11525,7 @@ void Client::Handle_OP_RemoveBlockedBuffs(const EQApplicationPacket *app)
if (app->size != sizeof(BlockedBuffs_Struct)) if (app->size != sizeof(BlockedBuffs_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i",
sizeof(BlockedBuffs_Struct), app->size); sizeof(BlockedBuffs_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -11687,7 +11688,7 @@ void Client::Handle_OP_RespawnWindow(const EQApplicationPacket *app)
// //
if (app->size != 4) if (app->size != 4)
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_RespawnWindow expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_RespawnWindow expected %i got %i",
4, app->size); 4, app->size);
DumpPacket(app); DumpPacket(app);
return; return;
@ -11738,7 +11739,7 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(Sacrifice_Struct)) { if (app->size != sizeof(Sacrifice_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -11988,7 +11989,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app)
void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) void Client::Handle_OP_SetTitle(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(SetTitle_Struct)) { if (app->size != sizeof(SetTitle_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -12117,7 +12118,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
t1.start(); t1.start();
Merchant_Sell_Struct* mp = (Merchant_Sell_Struct*)app->pBuffer; Merchant_Sell_Struct* mp = (Merchant_Sell_Struct*)app->pBuffer;
#if EQDEBUG >= 5 #if EQDEBUG >= 5
LogFile->write(EQEmuLog::Debug, "%s, purchase item..", GetName()); logger.LogDebug(EQEmuLogSys::General, "%s, purchase item..", GetName());
DumpPacket(app); DumpPacket(app);
#endif #endif
@ -12853,7 +12854,7 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(Surname_Struct)) if (app->size != sizeof(Surname_Struct))
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size);
return; return;
} }
@ -13168,7 +13169,7 @@ void Client::Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(TaskHistoryRequest_Struct)) { if (app->size != sizeof(TaskHistoryRequest_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_TaskHistoryRequest expected %i got %i",
sizeof(TaskHistoryRequest_Struct), app->size); sizeof(TaskHistoryRequest_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
@ -13710,7 +13711,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app)
{ {
if (app->size != sizeof(Translocate_Struct)) { if (app->size != sizeof(Translocate_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -13855,7 +13856,7 @@ void Client::Handle_OP_VetClaimRequest(const EQApplicationPacket *app)
{ {
if (app->size < sizeof(VeteranClaimRequest)) if (app->size < sizeof(VeteranClaimRequest))
{ {
LogFile->write(EQEmuLog::Debug, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); logger.LogDebug(EQEmuLogSys::General, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest));
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -13895,7 +13896,7 @@ void Client::Handle_OP_VoiceMacroIn(const EQApplicationPacket *app)
if (app->size != sizeof(VoiceMacroIn_Struct)) { if (app->size != sizeof(VoiceMacroIn_Struct)) {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_VoiceMacroIn expected %i got %i", logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_VoiceMacroIn expected %i got %i",
sizeof(VoiceMacroIn_Struct), app->size); sizeof(VoiceMacroIn_Struct), app->size);
DumpPacket(app); DumpPacket(app);
@ -13946,7 +13947,7 @@ void Client::Handle_OP_XTargetAutoAddHaters(const EQApplicationPacket *app)
{ {
if (app->size != 1) if (app->size != 1)
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -13958,7 +13959,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app)
{ {
if (app->size < 12) if (app->size < 12)
{ {
LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size);
DumpPacket(app); DumpPacket(app);
return; return;
} }
@ -14181,7 +14182,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app)
} }
default: default:
LogFile->write(EQEmuLog::Debug, "Unhandled XTarget Type %i", Type); logger.LogDebug(EQEmuLogSys::General, "Unhandled XTarget Type %i", Type);
break; break;
} }

View File

@ -18,6 +18,8 @@
client_process.cpp: client_process.cpp:
Handles client login sequence and packets sent from client to zone Handles client login sequence and packets sent from client to zone
*/ */
#include "../common/eqemu_logsys.h"
#include "../common/debug.h" #include "../common/debug.h"
#include <iostream> #include <iostream>
#include <stdio.h> #include <stdio.h>
@ -1035,7 +1037,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
// Account for merchant lists with gaps. // Account for merchant lists with gaps.
if (ml.slot >= i) { if (ml.slot >= i) {
if (ml.slot > i) if (ml.slot > i)
LogFile->write(EQEmuLog::Debug, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); logger.LogDebug(EQEmuLogSys::General, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid);
i = ml.slot + 1; i = ml.slot + 1;
} }
} }

View File

@ -2464,7 +2464,7 @@ void command_spawn(Client *c, const Seperator *sep)
} }
} }
#if EQDEBUG >= 11 #if EQDEBUG >= 11
LogFile->write(EQEmuLog::Debug,"#spawn Spawning:"); logger.LogDebug(EQEmuLogSys::General,"#spawn Spawning:");
#endif #endif
NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), c); NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), c);
@ -4449,7 +4449,7 @@ void command_time(Client *c, const Seperator *sep)
); );
c->Message(13, "It is now %s.", timeMessage); c->Message(13, "It is now %s.", timeMessage);
#if EQDEBUG >= 11 #if EQDEBUG >= 11
LogFile->write(EQEmuLog::Debug,"Recieved timeMessage:%s", timeMessage); logger.LogDebug(EQEmuLogSys::General,"Recieved timeMessage:%s", timeMessage);
#endif #endif
} }
} }

View File

@ -29,6 +29,7 @@ Child of the Mob class.
#endif #endif
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/string_util.h" #include "../common/string_util.h"
@ -841,7 +842,7 @@ bool Corpse::Process() {
spc->zone_id = zone->graveyard_zoneid(); spc->zone_id = zone->graveyard_zoneid();
worldserver.SendPacket(pack); worldserver.SendPacket(pack);
safe_delete(pack); safe_delete(pack);
LogFile->write(EQEmuLog::Debug, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); logger.LogDebug(EQEmuLogSys::General, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid()));
corpse_db_id = 0; corpse_db_id = 0;
} }
@ -871,7 +872,7 @@ bool Corpse::Process() {
Save(); Save();
player_corpse_depop = true; player_corpse_depop = true;
corpse_db_id = 0; corpse_db_id = 0;
LogFile->write(EQEmuLog::Debug, "Tagged %s player corpse has burried.", this->GetName()); logger.LogDebug(EQEmuLogSys::General, "Tagged %s player corpse has burried.", this->GetName());
} }
else { else {
LogFile->write(EQEmuLog::Error, "Unable to bury %s player corpse.", this->GetName()); LogFile->write(EQEmuLog::Error, "Unable to bury %s player corpse.", this->GetName());
@ -1082,7 +1083,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
for(; cur != end; ++cur) { for(; cur != end; ++cur) {
ServerLootItem_Struct* item_data = *cur; ServerLootItem_Struct* item_data = *cur;
item = database.GetItem(item_data->item_id); item = database.GetItem(item_data->item_id);
LogFile->write(EQEmuLog::Debug, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); logger.LogDebug(EQEmuLogSys::General, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner");
client->Message(0, "Inaccessable Corpse Item: %s", item->Name); client->Message(0, "Inaccessable Corpse Item: %s", item->Name);
} }
} }

View File

@ -17,6 +17,7 @@
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include "../common/string_util.h" #include "../common/string_util.h"
#include "client.h" #include "client.h"
@ -302,7 +303,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1); sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1);
#if EQDEBUG>=5 #if EQDEBUG>=5
LogFile->write(EQEmuLog::Debug, "Client has lockpicks: skill=%f", modskill); logger.LogDebug(EQEmuLogSys::General, "Client has lockpicks: skill=%f", modskill);
#endif #endif
if(GetLockpick() <= modskill) if(GetLockpick() <= modskill)
@ -559,13 +560,13 @@ void Doors::ToggleState(Mob *sender)
} }
void Doors::DumpDoor(){ void Doors::DumpDoor(){
LogFile->write(EQEmuLog::Debug, logger.LogDebug(EQEmuLogSys::General,
"db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f", "db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f",
db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading); db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading);
LogFile->write(EQEmuLog::Debug, logger.LogDebug(EQEmuLogSys::General,
"opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s", "opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s",
opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed"); opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed");
LogFile->write(EQEmuLog::Debug, logger.LogDebug(EQEmuLogSys::General,
"dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f", "dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f",
dest_zone, dest_x, dest_y, dest_z, dest_heading); dest_zone, dest_x, dest_y, dest_z, dest_heading);
} }

View File

@ -16,6 +16,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include "masterentity.h" #include "masterentity.h"
#include "npc_ai.h" #include "npc_ai.h"
#include "../common/packet_functions.h" #include "../common/packet_functions.h"
@ -1097,7 +1098,7 @@ void Group::VerifyGroup() {
for (i = 0; i < MAX_GROUP_MEMBERS; i++) { for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
if (membername[i][0] == '\0') { if (membername[i][0] == '\0') {
#if EQDEBUG >= 7 #if EQDEBUG >= 7
LogFile->write(EQEmuLog::Debug, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); logger.LogDebug(EQEmuLogSys::General, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i);
#endif #endif
members[i] = nullptr; members[i] = nullptr;
continue; continue;
@ -1106,7 +1107,7 @@ void Group::VerifyGroup() {
Mob *them = entity_list.GetMob(membername[i]); Mob *them = entity_list.GetMob(membername[i]);
if(them == nullptr && members[i] != nullptr) { //they aren't in zone if(them == nullptr && members[i] != nullptr) { //they aren't in zone
#if EQDEBUG >= 6 #if EQDEBUG >= 6
LogFile->write(EQEmuLog::Debug, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); logger.LogDebug(EQEmuLogSys::General, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]);
#endif #endif
membername[i][0] = '\0'; membername[i][0] = '\0';
members[i] = nullptr; members[i] = nullptr;
@ -1115,13 +1116,13 @@ void Group::VerifyGroup() {
if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good. if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good.
#if EQDEBUG >= 5 #if EQDEBUG >= 5
LogFile->write(EQEmuLog::Debug, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); logger.LogDebug(EQEmuLogSys::General, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]);
#endif #endif
members[i] = them; members[i] = them;
continue; continue;
} }
#if EQDEBUG >= 8 #if EQDEBUG >= 8
LogFile->write(EQEmuLog::Debug, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); logger.LogDebug(EQEmuLogSys::General, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]);
#endif #endif
} }
} }

View File

@ -17,6 +17,7 @@
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include "../common/logsys.h" #include "../common/logsys.h"
#include "../common/string_util.h" #include "../common/string_util.h"
#include "quest_parser_collection.h" #include "quest_parser_collection.h"
@ -699,7 +700,7 @@ void Client::SendCursorBuffer() {
// Remove item from inventory // Remove item from inventory
void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) { void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) {
#if (EQDEBUG >= 5) #if (EQDEBUG >= 5)
LogFile->write(EQEmuLog::Debug, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); logger.LogDebug(EQEmuLogSys::General, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false");
#endif #endif
// Added 'IsSlotValid(slot_id)' check to both segments of client packet processing. // Added 'IsSlotValid(slot_id)' check to both segments of client packet processing.

View File

@ -145,7 +145,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
drop_chance = zone->random.Real(0.0, 100.0); drop_chance = zone->random.Real(0.0, 100.0);
#if EQDEBUG>=11 #if EQDEBUG>=11
LogFile->write(EQEmuLog::Debug, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); logger.LogDebug(EQEmuLogSys::General, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance);
#endif #endif
if (thischance == 100.0 || drop_chance < thischance) if (thischance == 100.0 || drop_chance < thischance)
{ {
@ -187,7 +187,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
ServerLootItem_Struct* item = new ServerLootItem_Struct; ServerLootItem_Struct* item = new ServerLootItem_Struct;
#if EQDEBUG>=11 #if EQDEBUG>=11
LogFile->write(EQEmuLog::Debug, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); logger.LogDebug(EQEmuLogSys::General, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID);
#endif #endif
EQApplicationPacket* outapp = nullptr; EQApplicationPacket* outapp = nullptr;

View File

@ -6,6 +6,7 @@
#include "groups.h" #include "groups.h"
#include "mob.h" #include "mob.h"
#include "../common/eqemu_logsys.h"
#include "../common/eq_packet_structs.h" #include "../common/eq_packet_structs.h"
#include "../common/eq_constants.h" #include "../common/eq_constants.h"
#include "../common/skills.h" #include "../common/skills.h"
@ -884,7 +885,7 @@ int32 Merc::CalcMaxMana()
break; break;
} }
default: { default: {
LogFile->write(EQEmuLog::Debug, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
max_mana = 0; max_mana = 0;
break; break;
} }
@ -905,7 +906,7 @@ int32 Merc::CalcMaxMana()
} }
#if EQDEBUG >= 11 #if EQDEBUG >= 11
LogFile->write(EQEmuLog::Debug, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); logger.LogDebug(EQEmuLogSys::General, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana);
#endif #endif
return max_mana; return max_mana;
} }

View File

@ -16,6 +16,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include <string.h> #include <string.h>
#ifdef _WINDOWS #ifdef _WINDOWS
#include <process.h> #include <process.h>
@ -258,7 +259,7 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet)
} }
#if EQDEBUG >= 5 #if EQDEBUG >= 5
LogFile->write(EQEmuLog::Debug, "New petition created"); logger.LogDebug(EQEmuLogSys::General, "New petition created");
#endif #endif
} }

View File

@ -51,7 +51,7 @@ SpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, floa
uint32 SpawnGroup::GetNPCType() { uint32 SpawnGroup::GetNPCType() {
#if EQDEBUG >= 10 #if EQDEBUG >= 10
LogFile->write(EQEmuLog::Debug, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); logger.LogDebug(EQEmuLogSys::General, "SpawnGroup[%08x]::GetNPCType()", (uint32) this);
#endif #endif
int npcType = 0; int npcType = 0;
int totalchance = 0; int totalchance = 0;

View File

@ -16,6 +16,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "../common/eqemu_logsys.h"
#include "../common/bodytypes.h" #include "../common/bodytypes.h"
#include "../common/classes.h" #include "../common/classes.h"
#include "../common/debug.h" #include "../common/debug.h"
@ -475,7 +476,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
if(!target_zone) { if(!target_zone) {
#ifdef SPELL_EFFECT_SPAM #ifdef SPELL_EFFECT_SPAM
LogFile->write(EQEmuLog::Debug, "Succor/Evacuation Spell In Same Zone."); logger.LogDebug(EQEmuLogSys::General, "Succor/Evacuation Spell In Same Zone.");
#endif #endif
if(IsClient()) if(IsClient())
CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords); CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords);
@ -484,7 +485,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
} }
else { else {
#ifdef SPELL_EFFECT_SPAM #ifdef SPELL_EFFECT_SPAM
LogFile->write(EQEmuLog::Debug, "Succor/Evacuation Spell To Another Zone."); logger.LogDebug(EQEmuLogSys::General, "Succor/Evacuation Spell To Another Zone.");
#endif #endif
if(IsClient()) if(IsClient())
CastToClient()->MovePC(target_zone, x, y, z, heading); CastToClient()->MovePC(target_zone, x, y, z, heading);
@ -3325,7 +3326,7 @@ snare has both of them negative, yet their range should work the same:
result = ubase * (caster_level * (formula - 2000) + 1); result = ubase * (caster_level * (formula - 2000) + 1);
} }
else else
LogFile->write(EQEmuLog::Debug, "Unknown spell effect value forumula %d", formula); logger.LogDebug(EQEmuLogSys::General, "Unknown spell effect value forumula %d", formula);
} }
} }

View File

@ -69,6 +69,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "../common/bodytypes.h" #include "../common/bodytypes.h"
#include "../common/classes.h" #include "../common/classes.h"
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include "../common/item.h" #include "../common/item.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/skills.h" #include "../common/skills.h"
@ -2672,7 +2673,7 @@ int CalcBuffDuration_formula(int level, int formula, int duration)
return duration ? duration : 3600; return duration ? duration : 3600;
default: default:
LogFile->write(EQEmuLog::Debug, "CalcBuffDuration_formula: unknown formula %d", formula); logger.LogDebug(EQEmuLogSys::General, "CalcBuffDuration_formula: unknown formula %d", formula);
return 0; return 0;
} }
} }

View File

@ -17,6 +17,7 @@
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/string_util.h" #include "../common/string_util.h"
@ -85,7 +86,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
if (!owner || !owner->IsClient()) { if (!owner || !owner->IsClient()) {
// This should never happen // This should never happen
LogFile->write(EQEmuLog::Debug, "Programming error: NPC's should not call Trade::AddEntity()"); logger.LogDebug(EQEmuLogSys::General, "Programming error: NPC's should not call Trade::AddEntity()");
return; return;
} }
@ -295,7 +296,7 @@ void Trade::LogTrade()
void Trade::DumpTrade() void Trade::DumpTrade()
{ {
Mob* with = With(); Mob* with = With();
LogFile->write(EQEmuLog::Debug, "Dumping trade data: '%s' in TradeState %i with '%s'", logger.LogDebug(EQEmuLogSys::General, "Dumping trade data: '%s' in TradeState %i with '%s'",
this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName())); this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName()));
if (!owner->IsClient()) if (!owner->IsClient())
@ -306,7 +307,7 @@ void Trade::DumpTrade()
const ItemInst* inst = trader->GetInv().GetItem(i); const ItemInst* inst = trader->GetInv().GetItem(i);
if (inst) { if (inst) {
LogFile->write(EQEmuLog::Debug, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", logger.LogDebug(EQEmuLogSys::General, "Item %i (Charges=%i, Slot=%i, IsBag=%s)",
inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->ID, inst->GetCharges(),
i, ((inst->IsType(ItemClassContainer)) ? "True" : "False")); i, ((inst->IsType(ItemClassContainer)) ? "True" : "False"));
@ -314,7 +315,7 @@ void Trade::DumpTrade()
for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) {
inst = trader->GetInv().GetItem(i, j); inst = trader->GetInv().GetItem(i, j);
if (inst) { if (inst) {
LogFile->write(EQEmuLog::Debug, "\tBagItem %i (Charges=%i, Slot=%i)", logger.LogDebug(EQEmuLogSys::General, "\tBagItem %i (Charges=%i, Slot=%i)",
inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->ID, inst->GetCharges(),
Inventory::CalcSlotId(i, j)); Inventory::CalcSlotId(i, j));
} }
@ -323,7 +324,7 @@ void Trade::DumpTrade()
} }
} }
LogFile->write(EQEmuLog::Debug, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); logger.LogDebug(EQEmuLogSys::General, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp);
} }
#endif #endif

View File

@ -497,7 +497,7 @@ void Zone::GetMerchantDataForZoneLoad() {
std::map<uint32, std::list<MerchantList> >::iterator cur; std::map<uint32, std::list<MerchantList> >::iterator cur;
uint32 npcid = 0; uint32 npcid = 0;
if (results.RowCount() == 0) { if (results.RowCount() == 0) {
LogFile->write(EQEmuLog::Debug, "No Merchant Data found for %s.", GetShortName()); logger.LogDebug(EQEmuLogSys::General, "No Merchant Data found for %s.", GetShortName());
return; return;
} }
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
@ -660,7 +660,7 @@ void Zone::LoadMercSpells(){
} }
if(MERC_DEBUG > 0) if(MERC_DEBUG > 0)
LogFile->write(EQEmuLog::Debug, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); logger.LogDebug(EQEmuLogSys::General, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size());
} }
@ -801,10 +801,10 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
database.GetZoneLongName(short_name, &long_name, file_name, &psafe_x, &psafe_y, &psafe_z, &pgraveyard_id, &pMaxClients); database.GetZoneLongName(short_name, &long_name, file_name, &psafe_x, &psafe_y, &psafe_z, &pgraveyard_id, &pMaxClients);
if(graveyard_id() > 0) if(graveyard_id() > 0)
{ {
LogFile->write(EQEmuLog::Debug, "Graveyard ID is %i.", graveyard_id()); logger.LogDebug(EQEmuLogSys::General, "Graveyard ID is %i.", graveyard_id());
bool GraveYardLoaded = database.GetZoneGraveyard(graveyard_id(), &pgraveyard_zoneid, &pgraveyard_x, &pgraveyard_y, &pgraveyard_z, &pgraveyard_heading); bool GraveYardLoaded = database.GetZoneGraveyard(graveyard_id(), &pgraveyard_zoneid, &pgraveyard_x, &pgraveyard_y, &pgraveyard_z, &pgraveyard_heading);
if(GraveYardLoaded) if(GraveYardLoaded)
LogFile->write(EQEmuLog::Debug, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); logger.LogDebug(EQEmuLogSys::General, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading());
else else
LogFile->write(EQEmuLog::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); LogFile->write(EQEmuLog::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name);
} }
@ -814,7 +814,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
autoshutdown_timer.Start(AUTHENTICATION_TIMEOUT * 1000, false); autoshutdown_timer.Start(AUTHENTICATION_TIMEOUT * 1000, false);
Weather_Timer = new Timer(60000); Weather_Timer = new Timer(60000);
Weather_Timer->Start(); Weather_Timer->Start();
LogFile->write(EQEmuLog::Debug, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); logger.LogDebug(EQEmuLogSys::General, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000);
zone_weather = 0; zone_weather = 0;
weather_intensity = 0; weather_intensity = 0;
blocked_spells = nullptr; blocked_spells = nullptr;
@ -1403,11 +1403,11 @@ void Zone::ChangeWeather()
weathertimer = weatherTimerRule*1000; weathertimer = weatherTimerRule*1000;
Weather_Timer->Start(weathertimer); Weather_Timer->Start(weathertimer);
} }
LogFile->write(EQEmuLog::Debug, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); logger.LogDebug(EQEmuLogSys::General, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000);
} }
else else
{ {
LogFile->write(EQEmuLog::Debug, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); logger.LogDebug(EQEmuLogSys::General, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration);
this->weatherSend(); this->weatherSend();
} }
} }
@ -1492,7 +1492,7 @@ void Zone::Repop(uint32 delay) {
quest_manager.ClearAllTimers(); quest_manager.ClearAllTimers();
if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay)) if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay))
LogFile->write(EQEmuLog::Debug, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); logger.LogDebug(EQEmuLogSys::General, "Error in Zone::Repop: database.PopulateZoneSpawnList failed");
initgrids_timer.Start(); initgrids_timer.Start();

View File

@ -1,5 +1,5 @@
#include "../common/eqemu_logsys.h"
#include "../common/extprofile.h" #include "../common/extprofile.h"
#include "../common/item.h" #include "../common/item.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Str
bool ZoneDatabase::SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value){ bool ZoneDatabase::SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value){
std::string query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, lang_id, value); QueryDatabase(query); std::string query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, lang_id, value); QueryDatabase(query);
LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value);
return true; return true;
} }
@ -1231,10 +1231,10 @@ bool ZoneDatabase::SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, u
/* Save Home Bind Point */ /* Save Home Bind Point */
std::string query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)" std::string query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)"
" VALUES (%u, %u, %u, %f, %f, %f, %f, %i)", character_id, zone_id, instance_id, x, y, z, heading, is_home); " VALUES (%u, %u, %u, %f, %f, %f, %f, %i)", character_id, zone_id, instance_id, x, y, z, heading, is_home);
LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.RowsAffected()) { if (!results.RowsAffected()) {
LogFile->write(EQEmuLog::Debug, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); logger.LogDebug(EQEmuLogSys::General, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str());
} }
return true; return true;
} }
@ -1245,20 +1245,20 @@ bool ZoneDatabase::SaveCharacterMaterialColor(uint32 character_id, uint32 slot_i
uint8 blue = (color & 0x000000FF); uint8 blue = (color & 0x000000FF);
std::string query = StringFormat("REPLACE INTO `character_material` (id, slot, red, green, blue, color, use_tint) VALUES (%u, %u, %u, %u, %u, %u, 255)", character_id, slot_id, red, green, blue, color); auto results = QueryDatabase(query); std::string query = StringFormat("REPLACE INTO `character_material` (id, slot, red, green, blue, color, use_tint) VALUES (%u, %u, %u, %u, %u, %u, 255)", character_id, slot_id, red, green, blue, color); auto results = QueryDatabase(query);
LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color);
return true; return true;
} }
bool ZoneDatabase::SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value){ bool ZoneDatabase::SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value){
std::string query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, skill_id, value); auto results = QueryDatabase(query); std::string query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, skill_id, value); auto results = QueryDatabase(query);
LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value);
return true; return true;
} }
bool ZoneDatabase::SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id){ bool ZoneDatabase::SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id){
std::string query = StringFormat("REPLACE INTO `character_disciplines` (id, slot_id, disc_id) VALUES (%u, %u, %u)", character_id, slot_id, disc_id); std::string query = StringFormat("REPLACE INTO `character_disciplines` (id, slot_id, disc_id) VALUES (%u, %u, %u)", character_id, slot_id, disc_id);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id);
return true; return true;
} }
@ -1270,7 +1270,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc
if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){ if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){
std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
QueryDatabase(query); QueryDatabase(query);
LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
} }
} }
return true; return true;
@ -1281,7 +1281,7 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i
DoEscapeString(bandolier_name_esc, bandolier_name, strlen(bandolier_name)); DoEscapeString(bandolier_name_esc, bandolier_name, strlen(bandolier_name));
std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc); std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name);
if (!results.RowsAffected()){ std::cout << "ERROR Bandolier Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; } if (!results.RowsAffected()){ std::cout << "ERROR Bandolier Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; }
return true; return true;
} }
@ -1596,7 +1596,7 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla
m_epp->expended_aa m_epp->expended_aa
); );
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
return true; return true;
} }
@ -1637,7 +1637,7 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru
pp->currentEbonCrystals, pp->currentEbonCrystals,
pp->careerEbonCrystals); pp->careerEbonCrystals);
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
LogFile->write(EQEmuLog::Debug, "Saving Currency for character ID: %i, done", character_id); logger.LogDebug(EQEmuLogSys::General, "Saving Currency for character ID: %i, done", character_id);
return true; return true;
} }
@ -1646,7 +1646,7 @@ bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 cur
" VALUES (%u, %u, %u)", " VALUES (%u, %u, %u)",
character_id, aa_id, current_level); character_id, aa_id, current_level);
auto results = QueryDatabase(rquery); auto results = QueryDatabase(rquery);
LogFile->write(EQEmuLog::Debug, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); logger.LogDebug(EQEmuLogSys::General, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level);
return true; return true;
} }

View File

@ -17,6 +17,7 @@
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include "../common/eqemu_logsys.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/string_util.h" #include "../common/string_util.h"
@ -43,12 +44,12 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
zoning = true; zoning = true;
if (app->size != sizeof(ZoneChange_Struct)) { if (app->size != sizeof(ZoneChange_Struct)) {
LogFile->write(EQEmuLog::Debug, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); logger.LogDebug(EQEmuLogSys::General, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct));
return; return;
} }
#if EQDEBUG >= 5 #if EQDEBUG >= 5
LogFile->write(EQEmuLog::Debug, "Zone request from %s", GetName()); logger.LogDebug(EQEmuLogSys::General, "Zone request from %s", GetName());
DumpPacket(app); DumpPacket(app);
#endif #endif
ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer; ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer;
@ -192,7 +193,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
switch(zone_mode) { switch(zone_mode) {
case EvacToSafeCoords: case EvacToSafeCoords:
case ZoneToSafeCoords: case ZoneToSafeCoords:
LogFile->write(EQEmuLog::Debug, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); logger.LogDebug(EQEmuLogSys::General, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id);
dest_x = safe_x; dest_x = safe_x;
dest_y = safe_y; dest_y = safe_y;
dest_z = safe_z; dest_z = safe_z;
@ -533,7 +534,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
heading = m_pp.binds[0].heading; heading = m_pp.binds[0].heading;
zonesummon_ignorerestrictions = 1; zonesummon_ignorerestrictions = 1;
LogFile->write(EQEmuLog::Debug, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); logger.LogDebug(EQEmuLogSys::General, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading);
break; break;
case SummonPC: case SummonPC:
zonesummon_x = x_pos = x; zonesummon_x = x_pos = x;
@ -542,7 +543,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
SetHeading(heading); SetHeading(heading);
break; break;
case Rewind: case Rewind:
LogFile->write(EQEmuLog::Debug, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); logger.LogDebug(EQEmuLogSys::General, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName());
zonesummon_x = x_pos = x; zonesummon_x = x_pos = x;
zonesummon_y = y_pos = y; zonesummon_y = y_pos = y;
zonesummon_z = z_pos = z; zonesummon_z = z_pos = z;