Convert 'SPELLS' debugging _log to logger.LogDebugType

This commit is contained in:
Akkadius 2015-01-12 22:52:11 -06:00
parent 3390164aea
commit 683ff1ea60
9 changed files with 23 additions and 23 deletions

View File

@ -1482,7 +1482,7 @@ int SharedDatabase::GetMaxSpellID() {
std::string query = "SELECT MAX(id) FROM spells_new"; std::string query = "SELECT MAX(id) FROM spells_new";
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) { 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; 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"; const std::string query = "SELECT * FROM spells_new ORDER BY id ASC";
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) { 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; return;
} }
if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) { 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; return;
} }
@ -1512,7 +1512,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
tempid = atoi(row[0]); tempid = atoi(row[0]);
if(tempid >= max_spells) { 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; continue;
} }

View File

@ -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, // 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 // else, make a guess, based on the resist type. Default return value is DS_THORNS
if (IsValidSpell(spell_id)) { 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); spells[spell_id].name, spells[spell_id].DamageShieldType);
if (spells[spell_id].DamageShieldType) if (spells[spell_id].DamageShieldType)

View File

@ -1896,7 +1896,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
if (effectmod > effectmodcap) if (effectmod > effectmodcap)
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); GetName(), spell_id, effectmod, effectmodcap);
return effectmod; return effectmod;

View File

@ -11714,7 +11714,7 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app)
const Resurrect_Struct* ra = (const Resurrect_Struct*)app->pBuffer; 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"); PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE");
_pkt(SPELLS__REZ, app); _pkt(SPELLS__REZ, app);

View File

@ -1141,7 +1141,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
{ {
if(PendingRezzXP < 0) { if(PendingRezzXP < 0) {
// pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer // 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"); Message(13, "You have already been resurrected.\n");
return; 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 // 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. // corpse is in has shutdown since the rez spell was cast.
database.MarkCorpseAsRezzed(PendingRezzDBID); 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], this->name, (uint16)spells[SpellID].base[0],
SpellID, ZoneID, InstanceID); SpellID, ZoneID, InstanceID);
@ -2122,7 +2122,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
{ {
if (PendingRezzXP < 0 || PendingRezzSpellID == 0) 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; return;
} }
SetHP(GetMaxHP() / 5); SetHP(GetMaxHP() / 5);
@ -2155,10 +2155,10 @@ void Client::HandleRespawnFromHover(uint32 Option)
if (corpse && corpse->IsCorpse()) 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()); 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->IsRezzed(true);
corpse->CompleteResurrection(); corpse->CompleteResurrection();

View File

@ -768,7 +768,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) {
caster->SpellOnTarget(spell_id, members[z]->GetPet()); caster->SpellOnTarget(spell_id, members[z]->GetPet());
#endif #endif
} else } 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); members[z]->GetPet()->BardPulse(spell_id, caster);
#endif #endif
} else } 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());
} }
} }
} }

View File

@ -498,7 +498,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid)
#endif #endif
} }
else{ 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); members[z].member->GetPet()->BardPulse(spellid, caster);
#endif #endif
} else } 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());
} }
} }
} }

View File

@ -3832,7 +3832,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
void Corpse::CastRezz(uint16 spellid, Mob* Caster) 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(IsRezzed()){
if(Caster && Caster->IsClient()) if(Caster && Caster->IsClient())

View File

@ -678,7 +678,7 @@ void WorldServer::Process() {
//pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 //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. //also serves to inform Client::OPRezzAnswer to expect a packet.
client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); 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); zone->GetShortName(), client->GetName(), srs->rez.spellid);
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest,
sizeof(Resurrect_Struct)); sizeof(Resurrect_Struct));
@ -694,10 +694,10 @@ void WorldServer::Process() {
// to the zone that the corpse is in. // to the zone that the corpse is in.
Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name); Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name);
if (corpse && corpse->IsCorpse()) { 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); 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(). // I don't know why Rezzed is not set to true in CompleteRezz().
corpse->IsRezzed(true); corpse->IsRezzed(true);
corpse->CompleteResurrection(); 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) 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)); ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct));
RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer;
sem->rezzopcode = opcode; sem->rezzopcode = opcode;
@ -1983,9 +1983,9 @@ bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32
sem->dbid = dbid; sem->dbid = dbid;
bool ret = SendPacket(pack); bool ret = SendPacket(pack);
if (ret) 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 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); safe_delete(pack);
return ret; return ret;