From 683ff1ea6008e4b5f19ec5dab3afc304825f9aea Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:52:11 -0600 Subject: [PATCH] Convert 'SPELLS' debugging _log to logger.LogDebugType --- common/shareddb.cpp | 8 ++++---- common/spdat.cpp | 2 +- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 2 +- zone/client_process.cpp | 10 +++++----- zone/groups.cpp | 4 ++-- zone/raids.cpp | 4 ++-- zone/spells.cpp | 2 +- zone/worldserver.cpp | 12 ++++++------ 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 0a8148c8d..c9894abc0 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1482,7 +1482,7 @@ int SharedDatabase::GetMaxSpellID() { std::string query = "SELECT MAX(id) FROM spells_new"; auto results = QueryDatabase(query); if (!results.Success()) { - _log(SPELLS__LOAD_ERR, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1497,12 +1497,12 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { const std::string query = "SELECT * FROM spells_new ORDER BY id ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - _log(SPELLS__LOAD_ERR, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) { - _log(SPELLS__LOAD_ERR, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); return; } @@ -1512,7 +1512,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { for (auto row = results.begin(); row != results.end(); ++row) { tempid = atoi(row[0]); if(tempid >= max_spells) { - _log(SPELLS__LOAD_ERR, "Non fatal error: spell.id >= max_spells, ignoring."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); continue; } diff --git a/common/spdat.cpp b/common/spdat.cpp index 8bceec249..22861e53e 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -838,7 +838,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType) // If we have a DamageShieldType for this spell from the damageshieldtypes table, return that, // else, make a guess, based on the resist type. Default return value is DS_THORNS if (IsValidSpell(spell_id)) { - _log(SPELLS__EFFECT_VALUES, "DamageShieldType for spell %i (%s) is %X\n", spell_id, + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, spells[spell_id].name, spells[spell_id].DamageShieldType); if (spells[spell_id].DamageShieldType) diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index f7a73c4cf..0f6df5965 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -1896,7 +1896,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const if (effectmod > effectmodcap) effectmod = effectmodcap; - _log(SPELLS__BARDS, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id, effectmod, effectmodcap); return effectmod; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 07c7de75b..08f52a4bb 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -11714,7 +11714,7 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app) const Resurrect_Struct* ra = (const Resurrect_Struct*)app->pBuffer; - _log(SPELLS__REZ, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); _pkt(SPELLS__REZ, app); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 397c71ac3..01c59236e 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1141,7 +1141,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I { if(PendingRezzXP < 0) { // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer - _log(SPELLS__REZ, "Unexpected OP_RezzAnswer. Ignoring it."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); Message(13, "You have already been resurrected.\n"); return; } @@ -1151,7 +1151,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I // Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the // corpse is in has shutdown since the rez spell was cast. database.MarkCorpseAsRezzed(PendingRezzDBID); - _log(SPELLS__REZ, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", this->name, (uint16)spells[SpellID].base[0], SpellID, ZoneID, InstanceID); @@ -2122,7 +2122,7 @@ void Client::HandleRespawnFromHover(uint32 Option) { if (PendingRezzXP < 0 || PendingRezzSpellID == 0) { - _log(SPELLS__REZ, "Unexpected Rezz from hover request."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); return; } SetHP(GetMaxHP() / 5); @@ -2155,10 +2155,10 @@ void Client::HandleRespawnFromHover(uint32 Option) if (corpse && corpse->IsCorpse()) { - _log(SPELLS__REZ, "Hover Rez in zone %s for corpse %s", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", zone->GetShortName(), PendingRezzCorpseName.c_str()); - _log(SPELLS__REZ, "Found corpse. Marking corpse as rezzed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); corpse->IsRezzed(true); corpse->CompleteResurrection(); diff --git a/zone/groups.cpp b/zone/groups.cpp index eca2884e5..ab90cddec 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -768,7 +768,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { caster->SpellOnTarget(spell_id, members[z]->GetPet()); #endif } else - _log(SPELLS__CASTING, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } @@ -807,7 +807,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) { members[z]->GetPet()->BardPulse(spell_id, caster); #endif } else - _log(SPELLS__BARDS, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } } diff --git a/zone/raids.cpp b/zone/raids.cpp index 3f68f2270..7a35d91ac 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -498,7 +498,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) #endif } else{ - _log(SPELLS__CASTING, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); } } } @@ -799,7 +799,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){ members[z].member->GetPet()->BardPulse(spellid, caster); #endif } else - _log(SPELLS__BARDS, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); } } } diff --git a/zone/spells.cpp b/zone/spells.cpp index ff456fcbc..ba8431814 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -3832,7 +3832,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r void Corpse::CastRezz(uint16 spellid, Mob* Caster) { - _log(SPELLS__REZ, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); if(IsRezzed()){ if(Caster && Caster->IsClient()) diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 2b9a47ecf..2166aba56 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -678,7 +678,7 @@ void WorldServer::Process() { //pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 //also serves to inform Client::OPRezzAnswer to expect a packet. client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); - _log(SPELLS__REZ, "OP_RezzRequest in zone %s for %s, spellid:%i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", zone->GetShortName(), client->GetName(), srs->rez.spellid); EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); @@ -694,10 +694,10 @@ void WorldServer::Process() { // to the zone that the corpse is in. Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name); if (corpse && corpse->IsCorpse()) { - _log(SPELLS__REZ, "OP_RezzComplete received in zone %s for corpse %s", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", zone->GetShortName(), srs->rez.corpse_name); - _log(SPELLS__REZ, "Found corpse. Marking corpse as rezzed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); // I don't know why Rezzed is not set to true in CompleteRezz(). corpse->IsRezzed(true); corpse->CompleteResurrection(); @@ -1974,7 +1974,7 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode) { - _log(SPELLS__REZ, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct)); RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; sem->rezzopcode = opcode; @@ -1983,9 +1983,9 @@ bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 sem->dbid = dbid; bool ret = SendPacket(pack); if (ret) - _log(SPELLS__REZ, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); else - _log(SPELLS__REZ, "NOT Sending player rezz packet to world"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); safe_delete(pack); return ret;