mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
chore(Core/Logging): replace most server loggers (#5726)
* chore(Core/Logging): replace most server loggers Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -225,9 +225,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS] =
|
||||
|
||||
void Spell::EffectNULL(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "WORLD: Spell Effect DUMMY");
|
||||
#endif
|
||||
}
|
||||
|
||||
void Spell::EffectUnused(SpellEffIndex /*effIndex*/)
|
||||
@@ -769,9 +767,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
}
|
||||
|
||||
// normal DB scripted effect
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Spell ScriptStart spellid %u in EffectDummy(%u)", m_spellInfo->Id, effIndex);
|
||||
#endif
|
||||
m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget);
|
||||
#ifdef ELUNA
|
||||
if (gameObjTarget)
|
||||
@@ -917,9 +913,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id);
|
||||
if (!spellInfo)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Spell::EffectTriggerSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -975,9 +969,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id);
|
||||
if (!spellInfo)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1033,7 +1025,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex)
|
||||
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("server", "Spell::EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
|
||||
LOG_ERROR("spells.effect", "Spell::EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1082,7 +1074,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex)
|
||||
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("server", "EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
|
||||
LOG_ERROR("spells.effect", "EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1207,7 +1199,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
|
||||
// If not exist data for dest location - return
|
||||
if (!m_targets.HasDst())
|
||||
{
|
||||
LOG_ERROR("server", "Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id);
|
||||
LOG_ERROR("spells.effect", "Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1219,9 +1211,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
|
||||
destTarget->GetPosition(x, y, z, orientation);
|
||||
if (!orientation && m_targets.GetUnitTarget())
|
||||
orientation = m_targets.GetUnitTarget()->GetOrientation();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation);
|
||||
#endif
|
||||
|
||||
if (mapid == unitTarget->GetMapId())
|
||||
{
|
||||
@@ -1239,7 +1229,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
|
||||
unitTarget->ToPlayer()->TeleportTo(mapid, x, y, z, orientation, unitTarget == m_caster ? TELE_TO_SPELL : 0);
|
||||
else
|
||||
{
|
||||
LOG_ERROR("server", "Spell::EffectTeleportUnits - spellId %u attempted to teleport creature to a different map.", m_spellInfo->Id);
|
||||
LOG_ERROR("spells.effect", "Spell::EffectTeleportUnits - spellId %u attempted to teleport creature to a different map.", m_spellInfo->Id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1374,10 +1364,8 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex)
|
||||
uint32 spellToUnlearn = m_spellInfo->Effects[effIndex].TriggerSpell;
|
||||
|
||||
player->removeSpell(spellToUnlearn, SPEC_MASK_ALL, false);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Spell: Player %s has unlearned spell %u from Npc: %s",
|
||||
player->GetGUID().ToString().c_str(), spellToUnlearn, m_caster->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
void Spell::EffectPowerDrain(SpellEffIndex effIndex)
|
||||
@@ -1449,9 +1437,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex)
|
||||
// TODO: there should be a possibility to pass dest target to event script
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->Effects[effIndex].MiscValue, m_spellInfo->Id);
|
||||
#endif
|
||||
|
||||
if (ZoneScript* zoneScript = m_caster->GetZoneScript())
|
||||
zoneScript->ProcessEvent(target, m_spellInfo->Effects[effIndex].MiscValue);
|
||||
@@ -1566,7 +1552,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
|
||||
|
||||
if (!targetAura)
|
||||
{
|
||||
LOG_ERROR("server", "Target(%s) has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID().ToString().c_str());
|
||||
LOG_ERROR("spells.effect", "Target(%s) has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID().ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1656,9 +1642,7 @@ void Spell::EffectHealthLeech(SpellEffIndex /*effIndex*/)
|
||||
damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE);
|
||||
damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "HealthLeech :%i", damage);
|
||||
#endif
|
||||
|
||||
// xinef: handled in spell.cpp
|
||||
//float healMultiplier = m_spellInfo->Effects[effIndex].CalcValueMultiplier(m_originalCaster, this);
|
||||
@@ -2041,10 +2025,8 @@ void Spell::SendLoot(ObjectGuid guid, LootType loottype)
|
||||
// Players shouldn't be able to loot gameobjects that are currently despawned
|
||||
if (!gameObjTarget->isSpawned() && !player->IsGameMaster())
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_ERROR("server", "Possible hacking attempt: Player %s [%s] tried to loot a gameobject [%s] which is on respawn time without being in GM mode!",
|
||||
LOG_ERROR("spells.effect", "Possible hacking attempt: Player %s [%s] tried to loot a gameobject [%s] which is on respawn time without being in GM mode!",
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), gameObjTarget->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
// special case, already has GossipHello inside so return and avoid calling twice
|
||||
@@ -2105,9 +2087,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
|
||||
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "WORLD: Open Lock - No Player Caster!");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2165,9 +2145,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "WORLD: Open Lock - No GameObject/Item Target!");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2353,7 +2331,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
|
||||
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(m_spellInfo->Effects[effIndex].MiscValueB);
|
||||
if (!properties)
|
||||
{
|
||||
LOG_ERROR("server", "EffectSummonType: Unhandled summon type %u", m_spellInfo->Effects[effIndex].MiscValueB);
|
||||
LOG_ERROR("spells.effect", "EffectSummonType: Unhandled summon type %u", m_spellInfo->Effects[effIndex].MiscValueB);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2568,10 +2546,8 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex)
|
||||
uint32 spellToLearn = (m_spellInfo->Id == 483 || m_spellInfo->Id == 55884) ? damage : m_spellInfo->Effects[effIndex].TriggerSpell;
|
||||
player->learnSpell(spellToLearn);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Spell: Player %s has learned spell %u from Npc %s",
|
||||
player->GetGUID().ToString().c_str(), spellToLearn, m_caster->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef std::list<std::pair<uint32, ObjectGuid>> DispelList;
|
||||
@@ -2814,10 +2790,8 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
|
||||
if (m_CastItem)
|
||||
{
|
||||
unitTarget->ToPlayer()->RewardHonor(nullptr, 1, damage / 10, false);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %s",
|
||||
m_spellInfo->Id, damage / 10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2826,19 +2800,15 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
uint32 honor_reward = Acore::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage));
|
||||
unitTarget->ToPlayer()->RewardHonor(nullptr, 1, honor_reward, false);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %s",
|
||||
m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
//maybe we have correct honor_gain in damage already
|
||||
unitTarget->ToPlayer()->RewardHonor(nullptr, 1, damage, false);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %s",
|
||||
m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2941,7 +2911,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
|
||||
}
|
||||
if (!add_socket)
|
||||
{
|
||||
LOG_ERROR("server", "Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.",
|
||||
LOG_ERROR("spells.effect", "Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.",
|
||||
m_spellInfo->Id, SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC, ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET);
|
||||
return;
|
||||
}
|
||||
@@ -3015,14 +2985,14 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
|
||||
spell_id = 36760;
|
||||
break; // 20%
|
||||
default:
|
||||
LOG_ERROR("server", "Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW", damage);
|
||||
LOG_ERROR("spells.effect", "Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW", damage);
|
||||
return;
|
||||
}
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("server", "Spell::EffectEnchantItemTmp: unknown spell id %i", spell_id);
|
||||
LOG_ERROR("spells.effect", "Spell::EffectEnchantItemTmp: unknown spell id %i", spell_id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3048,14 +3018,14 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
|
||||
|
||||
if (!enchant_id)
|
||||
{
|
||||
LOG_ERROR("server", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id", m_spellInfo->Id, effIndex);
|
||||
LOG_ERROR("spells.effect", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id", m_spellInfo->Id, effIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
||||
if (!pEnchant)
|
||||
{
|
||||
LOG_ERROR("server", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id);
|
||||
LOG_ERROR("spells.effect", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4153,7 +4123,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
spell_heal = 48085;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Unknown Lightwell spell caster %u", m_caster->GetEntry());
|
||||
LOG_ERROR("spells.effect", "Unknown Lightwell spell caster %u", m_caster->GetEntry());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4252,9 +4222,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
}
|
||||
|
||||
// normal DB scripted effect
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Spell ScriptStart spellid %u in EffectScriptEffect(%u)", m_spellInfo->Id, effIndex);
|
||||
#endif
|
||||
m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget);
|
||||
}
|
||||
|
||||
@@ -5615,9 +5583,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
|
||||
ExecuteLogEffectSummonObject(effIndex, pGameObj);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "AddObject at SpellEfects.cpp EffectTransmitted");
|
||||
#endif
|
||||
LOG_DEBUG("spells.effect", "AddObject at SpellEfects.cpp EffectTransmitted");
|
||||
//m_caster->AddGameObject(pGameObj);
|
||||
//m_ObjToDel.push_back(pGameObj);
|
||||
|
||||
@@ -5701,9 +5667,7 @@ void Spell::EffectSkill(SpellEffIndex /*effIndex*/)
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "WORLD: SkillEFFECT");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* There is currently no need for this effect. We handle it in Battleground.cpp
|
||||
@@ -5734,9 +5698,7 @@ void Spell::EffectSkinPlayerCorpse(SpellEffIndex /*effIndex*/)
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Effect: SkinPlayerCorpse");
|
||||
#endif
|
||||
if ((m_caster->GetTypeId() != TYPEID_PLAYER) || (unitTarget->GetTypeId() != TYPEID_PLAYER) || (unitTarget->IsAlive()))
|
||||
return;
|
||||
|
||||
@@ -5748,9 +5710,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex)
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Effect: StealBeneficialBuff");
|
||||
#endif
|
||||
|
||||
if (!unitTarget || unitTarget == m_caster) // can't steal from self
|
||||
return;
|
||||
@@ -6227,7 +6187,7 @@ void Spell::EffectPlayMusic(SpellEffIndex effIndex)
|
||||
|
||||
if (!sSoundEntriesStore.LookupEntry(soundid))
|
||||
{
|
||||
LOG_ERROR("server", "EffectPlayMusic: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
|
||||
LOG_ERROR("spells.effect", "EffectPlayMusic: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6280,7 +6240,7 @@ void Spell::EffectPlaySound(SpellEffIndex effIndex)
|
||||
|
||||
if (!sSoundEntriesStore.LookupEntry(soundId))
|
||||
{
|
||||
LOG_ERROR("server", "EffectPlayerSound: Sound (Id: %u) not exist in spell %u.", soundId, m_spellInfo->Id);
|
||||
LOG_ERROR("spells.effect", "EffectPlayerSound: Sound (Id: %u) not exist in spell %u.", soundId, m_spellInfo->Id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6408,10 +6368,8 @@ void Spell::EffectBind(SpellEffIndex effIndex)
|
||||
data << uint32(areaId);
|
||||
player->SendDirectMessage(&data);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "EffectBind: New homebind X: %f, Y: %f, Z: %f, MapId: %u, AreaId: %u",
|
||||
homeLoc.GetPositionX(), homeLoc.GetPositionY(), homeLoc.GetPositionZ(), homeLoc.GetMapId(), areaId);
|
||||
#endif
|
||||
// zone update
|
||||
data.Initialize(SMSG_PLAYERBOUND, 8 + 4);
|
||||
data << m_caster->GetGUID();
|
||||
|
||||
Reference in New Issue
Block a user