Core: Fix more warnings, add new function sLog.outStaticDebug() that replaces DEBUG_LOG
--HG-- branch : trunk
This commit is contained in:
@@ -248,11 +248,11 @@ void AuthSocket::OnRead()
|
||||
(table[i].status == STATUS_CONNECTED ||
|
||||
(_authed && table[i].status == STATUS_AUTHED)))
|
||||
{
|
||||
DEBUG_LOG("[Auth] got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
|
||||
sLog.outStaticDebug("[Auth] got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
|
||||
|
||||
if (!(*this.*table[i].handler)())
|
||||
{
|
||||
DEBUG_LOG("Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
|
||||
sLog.outStaticDebug("Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -304,7 +304,7 @@ void AuthSocket::_SetVSFields(const std::string& rI)
|
||||
/// Logon Challenge command handler
|
||||
bool AuthSocket::_HandleLogonChallenge()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleLogonChallenge");
|
||||
sLog.outStaticDebug("Entering _HandleLogonChallenge");
|
||||
if (socket().recv_len() < sizeof(sAuthLogonChallenge_C))
|
||||
return false;
|
||||
|
||||
@@ -316,7 +316,7 @@ bool AuthSocket::_HandleLogonChallenge()
|
||||
|
||||
EndianConvert(*((uint16*)(buf[0])));
|
||||
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
|
||||
DEBUG_LOG("[AuthChallenge] got header, body is %#04x bytes", remaining);
|
||||
sLog.outStaticDebug("[AuthChallenge] got header, body is %#04x bytes", remaining);
|
||||
|
||||
if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining))
|
||||
return false;
|
||||
@@ -328,8 +328,8 @@ bool AuthSocket::_HandleLogonChallenge()
|
||||
|
||||
///- Read the remaining of the packet
|
||||
socket().recv((char *)&buf[4], remaining);
|
||||
DEBUG_LOG("[AuthChallenge] got full packet, %#04x bytes", ch->size);
|
||||
DEBUG_LOG("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I);
|
||||
sLog.outStaticDebug("[AuthChallenge] got full packet, %#04x bytes", ch->size);
|
||||
sLog.outStaticDebug("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I);
|
||||
|
||||
// BigEndian code, nop in little endian case
|
||||
// size already converted
|
||||
@@ -388,19 +388,19 @@ bool AuthSocket::_HandleLogonChallenge()
|
||||
bool locked = false;
|
||||
if ((*result)[2].GetUInt8() == 1) // if ip is locked
|
||||
{
|
||||
DEBUG_LOG("[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), (*result)[3].GetString());
|
||||
DEBUG_LOG("[AuthChallenge] Player address is '%s'", socket().get_remote_address().c_str());
|
||||
sLog.outStaticDebug("[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), (*result)[3].GetString());
|
||||
sLog.outStaticDebug("[AuthChallenge] Player address is '%s'", socket().get_remote_address().c_str());
|
||||
if (strcmp((*result)[3].GetString(),socket().get_remote_address().c_str()))
|
||||
{
|
||||
DEBUG_LOG("[AuthChallenge] Account IP differs");
|
||||
sLog.outStaticDebug("[AuthChallenge] Account IP differs");
|
||||
pkt << (uint8) WOW_FAIL_SUSPENDED;
|
||||
locked=true;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG("[AuthChallenge] Account IP matches");
|
||||
sLog.outStaticDebug("[AuthChallenge] Account IP matches");
|
||||
}
|
||||
else
|
||||
DEBUG_LOG("[AuthChallenge] Account '%s' is not locked to ip", _login.c_str());
|
||||
sLog.outStaticDebug("[AuthChallenge] Account '%s' is not locked to ip", _login.c_str());
|
||||
|
||||
if (!locked)
|
||||
{
|
||||
@@ -506,7 +506,7 @@ bool AuthSocket::_HandleLogonChallenge()
|
||||
/// Logon Proof command handler
|
||||
bool AuthSocket::_HandleLogonProof()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleLogonProof");
|
||||
sLog.outStaticDebug("Entering _HandleLogonProof");
|
||||
///- Read the packet
|
||||
sAuthLogonProof_C lp;
|
||||
|
||||
@@ -693,7 +693,7 @@ bool AuthSocket::_HandleLogonProof()
|
||||
/// Reconnect Challenge command handler
|
||||
bool AuthSocket::_HandleReconnectChallenge()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleReconnectChallenge");
|
||||
sLog.outStaticDebug("Entering _HandleReconnectChallenge");
|
||||
if (socket().recv_len() < sizeof(sAuthLogonChallenge_C))
|
||||
return false;
|
||||
|
||||
@@ -705,7 +705,7 @@ bool AuthSocket::_HandleReconnectChallenge()
|
||||
|
||||
EndianConvert(*((uint16*)(buf[0])));
|
||||
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
|
||||
DEBUG_LOG("[ReconnectChallenge] got header, body is %#04x bytes", remaining);
|
||||
sLog.outStaticDebug("[ReconnectChallenge] got header, body is %#04x bytes", remaining);
|
||||
|
||||
if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining))
|
||||
return false;
|
||||
@@ -717,8 +717,8 @@ bool AuthSocket::_HandleReconnectChallenge()
|
||||
|
||||
///- Read the remaining of the packet
|
||||
socket().recv((char *)&buf[4], remaining);
|
||||
DEBUG_LOG("[ReconnectChallenge] got full packet, %#04x bytes", ch->size);
|
||||
DEBUG_LOG("[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I);
|
||||
sLog.outStaticDebug("[ReconnectChallenge] got full packet, %#04x bytes", ch->size);
|
||||
sLog.outStaticDebug("[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I);
|
||||
|
||||
_login = (const char*)ch->I;
|
||||
_safelogin = _login;
|
||||
@@ -750,7 +750,7 @@ bool AuthSocket::_HandleReconnectChallenge()
|
||||
/// Reconnect Proof command handler
|
||||
bool AuthSocket::_HandleReconnectProof()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleReconnectProof");
|
||||
sLog.outStaticDebug("Entering _HandleReconnectProof");
|
||||
///- Read the packet
|
||||
sAuthReconnectProof_C lp;
|
||||
if (!socket().recv((char *)&lp, sizeof(sAuthReconnectProof_C)))
|
||||
@@ -793,7 +793,7 @@ bool AuthSocket::_HandleReconnectProof()
|
||||
/// %Realm List command handler
|
||||
bool AuthSocket::_HandleRealmList()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleRealmList");
|
||||
sLog.outStaticDebug("Entering _HandleRealmList");
|
||||
if (socket().recv_len() < 5)
|
||||
return false;
|
||||
|
||||
@@ -895,7 +895,7 @@ bool AuthSocket::_HandleRealmList()
|
||||
/// Resume patch transfer
|
||||
bool AuthSocket::_HandleXferResume()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleXferResume");
|
||||
sLog.outStaticDebug("Entering _HandleXferResume");
|
||||
///- Check packet length and patch existence
|
||||
if (socket().recv_len() < 9 || !pPatch)
|
||||
{
|
||||
@@ -916,7 +916,7 @@ bool AuthSocket::_HandleXferResume()
|
||||
/// Cancel patch transfer
|
||||
bool AuthSocket::_HandleXferCancel()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleXferCancel");
|
||||
sLog.outStaticDebug("Entering _HandleXferCancel");
|
||||
|
||||
///- Close and delete the socket
|
||||
socket().recv_skip(1); //clear input buffer
|
||||
@@ -929,7 +929,7 @@ bool AuthSocket::_HandleXferCancel()
|
||||
/// Accept patch transfer
|
||||
bool AuthSocket::_HandleXferAccept()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleXferAccept");
|
||||
sLog.outStaticDebug("Entering _HandleXferAccept");
|
||||
|
||||
///- Check packet length and patch existence
|
||||
if (!pPatch)
|
||||
|
||||
@@ -61,7 +61,7 @@ void GuardAI::EnterEvadeMode()
|
||||
{
|
||||
if (!me->isAlive())
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking because he is dead [guid=%u]", me->GetGUIDLow());
|
||||
sLog.outStaticDebug("Creature stopped attacking because he is dead [guid=%u]", me->GetGUIDLow());
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
|
||||
i_state = STATE_NORMAL;
|
||||
@@ -76,23 +76,23 @@ void GuardAI::EnterEvadeMode()
|
||||
|
||||
if (!victim)
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking because victim does not exist [guid=%u]", me->GetGUIDLow());
|
||||
sLog.outStaticDebug("Creature stopped attacking because victim does not exist [guid=%u]", me->GetGUIDLow());
|
||||
}
|
||||
else if (!victim ->isAlive())
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking because victim is dead [guid=%u]", me->GetGUIDLow());
|
||||
sLog.outStaticDebug("Creature stopped attacking because victim is dead [guid=%u]", me->GetGUIDLow());
|
||||
}
|
||||
else if (victim ->HasStealthAura())
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking because victim is using stealth [guid=%u]", me->GetGUIDLow());
|
||||
sLog.outStaticDebug("Creature stopped attacking because victim is using stealth [guid=%u]", me->GetGUIDLow());
|
||||
}
|
||||
else if (victim ->isInFlight())
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking because victim is flying away [guid=%u]", me->GetGUIDLow());
|
||||
sLog.outStaticDebug("Creature stopped attacking because victim is flying away [guid=%u]", me->GetGUIDLow());
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking because victim outran him [guid=%u]", me->GetGUIDLow());
|
||||
sLog.outStaticDebug("Creature stopped attacking because victim outran him [guid=%u]", me->GetGUIDLow());
|
||||
}
|
||||
|
||||
me->RemoveAllAuras();
|
||||
|
||||
@@ -64,7 +64,7 @@ void PetAI::_stopAttack()
|
||||
{
|
||||
if (!me->isAlive())
|
||||
{
|
||||
DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow());
|
||||
sLog.outStaticDebug("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow());
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->CombatStop();
|
||||
@@ -96,7 +96,7 @@ void PetAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (_needToStop())
|
||||
{
|
||||
DEBUG_LOG("Pet AI stoped attacking [guid=%u]", me->GetGUIDLow());
|
||||
sLog.outStaticDebug("Pet AI stoped attacking [guid=%u]", me->GetGUIDLow());
|
||||
_stopAttack();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace FactorySelector
|
||||
// select NullCreatureAI if not another cases
|
||||
ainame = (ai_factory == NULL) ? "NullCreatureAI" : ai_factory->key();
|
||||
|
||||
DEBUG_LOG("Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str());
|
||||
sLog.outStaticDebug("Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str());
|
||||
return (ai_factory == NULL ? new NullCreatureAI(creature) : ai_factory->Create(creature));
|
||||
}
|
||||
|
||||
|
||||
@@ -488,7 +488,7 @@ void Creature::Update(uint32 diff)
|
||||
else if (m_deathTimer <= diff)
|
||||
{
|
||||
RemoveCorpse();
|
||||
DEBUG_LOG("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
|
||||
sLog.outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -506,7 +506,7 @@ void Creature::Update(uint32 diff)
|
||||
if (m_deathTimer <= diff)
|
||||
{
|
||||
RemoveCorpse();
|
||||
DEBUG_LOG("Removing alive corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
|
||||
sLog.outStaticDebug("Removing alive corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1569,7 +1569,7 @@ void Creature::Respawn(bool force)
|
||||
if (m_DBTableGuid)
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
|
||||
DEBUG_LOG("Respawning...");
|
||||
sLog.outStaticDebug("Respawning...");
|
||||
m_respawnTime = 0;
|
||||
lootForPickPocketed = false;
|
||||
lootForBody = false;
|
||||
|
||||
@@ -1239,7 +1239,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
int32 roll = irand(1,100);
|
||||
|
||||
DEBUG_LOG("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll);
|
||||
sLog.outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll);
|
||||
|
||||
// but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
|
||||
if (chance >= roll)
|
||||
|
||||
@@ -1020,7 +1020,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
||||
{
|
||||
if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage
|
||||
{
|
||||
DEBUG_LOG("We are fall to death, loosing 10 percents durability");
|
||||
sLog.outStaticDebug("We are fall to death, loosing 10 percents durability");
|
||||
DurabilityLossAll(0.10f,false);
|
||||
// durability lost message
|
||||
WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0);
|
||||
@@ -5053,7 +5053,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
|
||||
{
|
||||
if (GetGuildId() == 0)
|
||||
{
|
||||
DEBUG_LOG("You are not member of a guild");
|
||||
sLog.outStaticDebug("You are not member of a guild");
|
||||
return TotalCost;
|
||||
}
|
||||
|
||||
@@ -5063,19 +5063,19 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
|
||||
|
||||
if (!pGuild->HasRankRight(GetRank(), GR_RIGHT_WITHDRAW_REPAIR))
|
||||
{
|
||||
DEBUG_LOG("You do not have rights to withdraw for repairs");
|
||||
sLog.outStaticDebug("You do not have rights to withdraw for repairs");
|
||||
return TotalCost;
|
||||
}
|
||||
|
||||
if (pGuild->GetMemberMoneyWithdrawRem(GetGUIDLow()) < costs)
|
||||
{
|
||||
DEBUG_LOG("You do not have enough money withdraw amount remaining");
|
||||
sLog.outStaticDebug("You do not have enough money withdraw amount remaining");
|
||||
return TotalCost;
|
||||
}
|
||||
|
||||
if (pGuild->GetGuildBankMoney() < costs)
|
||||
{
|
||||
DEBUG_LOG("There is not enough money in bank");
|
||||
sLog.outStaticDebug("There is not enough money in bank");
|
||||
return TotalCost;
|
||||
}
|
||||
|
||||
@@ -5088,7 +5088,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
|
||||
}
|
||||
else if (GetMoney() < costs)
|
||||
{
|
||||
DEBUG_LOG("You do not have enough money");
|
||||
sLog.outStaticDebug("You do not have enough money");
|
||||
return TotalCost;
|
||||
}
|
||||
else
|
||||
@@ -7731,7 +7731,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id);
|
||||
sLog.outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id);
|
||||
|
||||
CastSpell(this,spellInfo,true,item);
|
||||
}
|
||||
@@ -17596,7 +17596,7 @@ bool Player::_LoadHomeBind(QueryResult_AutoPtr result)
|
||||
GetGUIDLow(), m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ);
|
||||
}
|
||||
|
||||
DEBUG_LOG("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f",
|
||||
sLog.outStaticDebug("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f",
|
||||
m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ);
|
||||
|
||||
return true;
|
||||
@@ -22964,7 +22964,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
}
|
||||
|
||||
//Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction
|
||||
DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
|
||||
sLog.outStaticDebug("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
|
||||
}
|
||||
}
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LANDING); // No fly zone - Parachute
|
||||
|
||||
@@ -666,7 +666,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
return damage;
|
||||
}
|
||||
|
||||
DEBUG_LOG("DealDamageStart");
|
||||
sLog.outStaticDebug("DealDamageStart");
|
||||
|
||||
uint32 health = pVictim->GetHealth();
|
||||
sLog.outDetail("deal dmg:%d to health:%d ",damage,health);
|
||||
@@ -714,7 +714,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
|
||||
if (health <= damage)
|
||||
{
|
||||
DEBUG_LOG("DealDamage: victim just died");
|
||||
sLog.outStaticDebug("DealDamage: victim just died");
|
||||
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -754,7 +754,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
}
|
||||
else // if (health <= damage)
|
||||
{
|
||||
DEBUG_LOG("DealDamageAlive");
|
||||
sLog.outStaticDebug("DealDamageAlive");
|
||||
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
pVictim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, damage);
|
||||
@@ -851,7 +851,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG("DealDamageEnd returned %d damage", damage);
|
||||
sLog.outStaticDebug("DealDamageEnd returned %d damage", damage);
|
||||
|
||||
return damage;
|
||||
}
|
||||
@@ -892,7 +892,7 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I
|
||||
targets.setUnitTarget(Victim);
|
||||
|
||||
if (castItem)
|
||||
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
|
||||
if (!originalCaster && triggeredByAura)
|
||||
originalCaster = triggeredByAura->GetCasterGUID();
|
||||
@@ -941,7 +941,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit*
|
||||
|
||||
if (castItem)
|
||||
{
|
||||
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
spell->m_CastItem = castItem;
|
||||
}
|
||||
|
||||
@@ -963,7 +963,7 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
|
||||
}
|
||||
|
||||
if (castItem)
|
||||
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
|
||||
if (!originalCaster && triggeredByAura)
|
||||
originalCaster = triggeredByAura->GetCasterGUID();
|
||||
@@ -999,7 +999,7 @@ void Unit::CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castI
|
||||
}
|
||||
|
||||
if (castItem)
|
||||
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
|
||||
if (!originalCaster && triggeredByAura)
|
||||
originalCaster = triggeredByAura->GetCasterGUID();
|
||||
@@ -2361,10 +2361,10 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool /*
|
||||
DealMeleeDamage(&damageInfo,true);
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
DEBUG_LOG("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||
sLog.outStaticDebug("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||
GetGUIDLow(), pVictim->GetGUIDLow(), pVictim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
|
||||
else
|
||||
DEBUG_LOG("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||
sLog.outStaticDebug("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||
GetGUIDLow(), pVictim->GetGUIDLow(), pVictim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
|
||||
|
||||
// if damage pVictim call AI reaction
|
||||
@@ -2390,7 +2390,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit *pVictim, WeaponAttackT
|
||||
float parry_chance = pVictim->GetUnitParryChance();
|
||||
|
||||
// Useful if want to specify crit & miss chances for melee, else it could be removed
|
||||
DEBUG_LOG("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance,crit_chance,dodge_chance,parry_chance,block_chance);
|
||||
sLog.outStaticDebug("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance,crit_chance,dodge_chance,parry_chance,block_chance);
|
||||
|
||||
return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100),int32(parry_chance*100),int32(block_chance*100));
|
||||
}
|
||||
@@ -2411,22 +2411,22 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
int32 sum = 0, tmp = 0;
|
||||
int32 roll = urand (0, 10000);
|
||||
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d",
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d",
|
||||
roll, miss_chance, dodge_chance, parry_chance, block_chance, crit_chance);
|
||||
|
||||
tmp = miss_chance;
|
||||
|
||||
if (tmp > 0 && roll < (sum += tmp))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: MISS");
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: MISS");
|
||||
return MELEE_HIT_MISS;
|
||||
}
|
||||
|
||||
// always crit against a sitting target (except 0 crit chance)
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER && crit_chance > 0 && !pVictim->IsStandState())
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT (sitting victim)");
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRIT (sitting victim)");
|
||||
return MELEE_HIT_CRIT;
|
||||
}
|
||||
|
||||
@@ -2435,7 +2435,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
// only players can't dodge if attacker is behind
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2454,7 +2454,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
&& ((tmp -= skillBonus) > 0)
|
||||
&& roll < (sum += tmp))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum);
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum);
|
||||
return MELEE_HIT_DODGE;
|
||||
}
|
||||
}
|
||||
@@ -2464,7 +2464,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
// check if attack comes from behind, nobody can parry or block if attacker is behind
|
||||
if (!pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind.");
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2481,7 +2481,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
&& (tmp2 -= skillBonus) > 0
|
||||
&& roll < (sum += tmp2))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum);
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum);
|
||||
return MELEE_HIT_PARRY;
|
||||
}
|
||||
}
|
||||
@@ -2493,7 +2493,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
&& (tmp -= skillBonus) > 0
|
||||
&& roll < (sum += tmp))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum);
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum);
|
||||
return MELEE_HIT_BLOCK;
|
||||
}
|
||||
}
|
||||
@@ -2504,9 +2504,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
|
||||
if (tmp > 0 && roll < (sum += tmp))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
|
||||
if (GetTypeId() == TYPEID_UNIT && (this->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT DISABLED)");
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)");
|
||||
else
|
||||
return MELEE_HIT_CRIT;
|
||||
}
|
||||
@@ -2526,7 +2526,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
tmp = tmp > 4000 ? 4000 : tmp;
|
||||
if (roll < (sum += tmp))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum);
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum);
|
||||
return MELEE_HIT_GLANCING;
|
||||
}
|
||||
}
|
||||
@@ -2550,13 +2550,13 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
tmp = tmp * 200 - 1500;
|
||||
if (roll < (sum += tmp))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum);
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum);
|
||||
return MELEE_HIT_CRUSHING;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: NORMAL");
|
||||
sLog.outStaticDebug ("RollMeleeOutcomeAgainst: NORMAL");
|
||||
return MELEE_HIT_NORMAL;
|
||||
}
|
||||
|
||||
@@ -2624,7 +2624,7 @@ void Unit::SendMeleeAttackStart(Unit* pVictim)
|
||||
data << uint64(pVictim->GetGUID());
|
||||
|
||||
SendMessageToSet(&data, true);
|
||||
DEBUG_LOG("WORLD: Sent SMSG_ATTACKSTART");
|
||||
sLog.outStaticDebug("WORLD: Sent SMSG_ATTACKSTART");
|
||||
}
|
||||
|
||||
void Unit::SendMeleeAttackStop(Unit* victim)
|
||||
@@ -2851,7 +2851,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||
case MELEE_HIT_BLOCK: canBlock = false; break;
|
||||
case MELEE_HIT_PARRY: canParry = false; break;
|
||||
default:
|
||||
DEBUG_LOG("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT have unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
|
||||
sLog.outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT have unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -15086,7 +15086,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
|
||||
if (!SpiritOfRedemption)
|
||||
{
|
||||
DEBUG_LOG("SET JUST_DIED");
|
||||
sLog.outStaticDebug("SET JUST_DIED");
|
||||
pVictim->setDeathState(JUST_DIED);
|
||||
}
|
||||
|
||||
@@ -15101,7 +15101,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
// only if not player and not controlled by player pet. And not at BG
|
||||
if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld.getConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
|
||||
{
|
||||
DEBUG_LOG("We are dead, losing %u percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
sLog.outStaticDebug("We are dead, losing %u percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
pVictim->ToPlayer()->DurabilityLossAll(sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH),false);
|
||||
// durability lost message
|
||||
WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
|
||||
@@ -15121,7 +15121,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
}
|
||||
else // creature died
|
||||
{
|
||||
DEBUG_LOG("DealDamageNotPlayer");
|
||||
sLog.outStaticDebug("DealDamageNotPlayer");
|
||||
|
||||
if (!creature->isPet())
|
||||
{
|
||||
|
||||
@@ -280,7 +280,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool /*insign
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEBUG_LOG("Deleting Corpse and spawned bones.");
|
||||
sLog.outStaticDebug("Deleting Corpse and spawned bones.");
|
||||
|
||||
//Map* map = corpse->FindMap();
|
||||
|
||||
|
||||
@@ -1871,7 +1871,7 @@ void Group::BroadcastGroupUpdate(void)
|
||||
{
|
||||
pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2);
|
||||
pp->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE);
|
||||
DEBUG_LOG("-- Forced group value update for '%s'", pp->GetName());
|
||||
sLog.outStaticDebug("-- Forced group value update for '%s'", pp->GetName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ void Map::LoadVMap(int gx,int gy)
|
||||
sLog.outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy);
|
||||
break;
|
||||
case VMAP::VMAP_LOAD_RESULT_IGNORED:
|
||||
DEBUG_LOG("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy);
|
||||
sLog.outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -289,7 +289,7 @@ void Map::SwitchGridContainers(T* obj, bool on)
|
||||
if (!loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)))
|
||||
return;
|
||||
|
||||
DEBUG_LOG("Switch object " I64FMT " from grid[%u,%u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
|
||||
sLog.outStaticDebug("Switch object " I64FMT " from grid[%u,%u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
|
||||
NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY());
|
||||
ASSERT(ngrid != NULL);
|
||||
|
||||
@@ -372,11 +372,11 @@ Map::EnsureGridLoadedAtEnter(const Cell &cell, Player *player)
|
||||
|
||||
if (player)
|
||||
{
|
||||
DEBUG_LOG("Player %s enter cell[%u,%u] triggers loading of grid[%u,%u] on map %u", player->GetName(), cell.CellX(), cell.CellY(), cell.GridX(), cell.GridY(), GetId());
|
||||
sLog.outStaticDebug("Player %s enter cell[%u,%u] triggers loading of grid[%u,%u] on map %u", player->GetName(), cell.CellX(), cell.CellY(), cell.GridX(), cell.GridY(), GetId());
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Active object nearby triggers loading of grid [%u,%u] on map %u", cell.GridX(), cell.GridY(), GetId());
|
||||
sLog.outStaticDebug("Active object nearby triggers loading of grid [%u,%u] on map %u", cell.GridX(), cell.GridY(), GetId());
|
||||
}
|
||||
|
||||
// refresh grid state & timer
|
||||
@@ -481,7 +481,7 @@ Map::Add(T *obj)
|
||||
if (obj->isActiveObject())
|
||||
AddToActive(obj);
|
||||
|
||||
DEBUG_LOG("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
|
||||
sLog.outStaticDebug("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
|
||||
|
||||
//something, such as vehicle, needs to be update immediately
|
||||
//also, trigger needs to cast spell, if not update, cannot see visual
|
||||
@@ -724,7 +724,7 @@ void Map::Remove(Player *player, bool remove)
|
||||
sLog.outError("Map::Remove() i_grids was NULL x:%d, y:%d",cell.data.Part.grid_x,cell.data.Part.grid_y);
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Remove player %s from grid[%u,%u]", player->GetName(), cell.GridX(), cell.GridY());
|
||||
sLog.outStaticDebug("Remove player %s from grid[%u,%u]", player->GetName(), cell.GridX(), cell.GridY());
|
||||
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
|
||||
ASSERT(grid != NULL);
|
||||
|
||||
@@ -755,7 +755,7 @@ Map::Remove(T *obj, bool remove)
|
||||
Cell cell(p);
|
||||
if (loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)))
|
||||
{
|
||||
DEBUG_LOG("Remove object " I64FMT " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y);
|
||||
sLog.outStaticDebug("Remove object " I64FMT " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y);
|
||||
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
|
||||
ASSERT(grid != NULL);
|
||||
|
||||
@@ -790,7 +790,7 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati
|
||||
|
||||
if (old_cell.DiffGrid(new_cell) || old_cell.DiffCell(new_cell))
|
||||
{
|
||||
DEBUG_LOG("Player %s relocation grid[%u,%u]cell[%u,%u]->grid[%u,%u]cell[%u,%u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
|
||||
sLog.outStaticDebug("Player %s relocation grid[%u,%u]cell[%u,%u]->grid[%u,%u]cell[%u,%u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
|
||||
|
||||
NGridType* oldGrid = getNGrid(old_cell.GridX(), old_cell.GridY());
|
||||
RemoveFromGrid(player, oldGrid,old_cell);
|
||||
@@ -1035,7 +1035,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll)
|
||||
|
||||
GridMaps[gx][gy] = NULL;
|
||||
}
|
||||
DEBUG_LOG("Unloading grid[%u,%u] for map %u finished", x,y, GetId());
|
||||
sLog.outStaticDebug("Unloading grid[%u,%u] for map %u finished", x,y, GetId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1683,7 +1683,7 @@ bool Map::IsOutdoors(float x, float y, float z) const
|
||||
WMOAreaTableEntry const* wmoEntry= GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
|
||||
if(wmoEntry)
|
||||
{
|
||||
DEBUG_LOG("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId);
|
||||
sLog.outStaticDebug("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId);
|
||||
atEntry = GetAreaEntryByAreaID(wmoEntry->areaId);
|
||||
}
|
||||
return IsOutdoorWMO(mogpFlags, adtId, rootId, groupId, wmoEntry, atEntry);
|
||||
|
||||
@@ -191,7 +191,7 @@ MotionMaster::MoveRandom(float spawndist)
|
||||
{
|
||||
if (i_owner->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
DEBUG_LOG("Creature (GUID: %u) start moving random", i_owner->GetGUIDLow());
|
||||
sLog.outStaticDebug("Creature (GUID: %u) start moving random", i_owner->GetGUIDLow());
|
||||
Mutate(new RandomMovementGenerator<Creature>(spawndist), MOTION_SLOT_IDLE);
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ MotionMaster::MoveTargetedHome()
|
||||
|
||||
if (i_owner->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) targeted home", i_owner->GetEntry(), i_owner->GetGUIDLow());
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) targeted home", i_owner->GetEntry(), i_owner->GetGUIDLow());
|
||||
Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else
|
||||
@@ -220,12 +220,12 @@ MotionMaster::MoveConfused()
|
||||
{
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DEBUG_LOG("Player (GUID: %u) move confused", i_owner->GetGUIDLow());
|
||||
sLog.outStaticDebug("Player (GUID: %u) move confused", i_owner->GetGUIDLow());
|
||||
Mutate(new ConfusedMovementGenerator<Player>(), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) move confused",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) move confused",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow());
|
||||
Mutate(new ConfusedMovementGenerator<Creature>(), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle)
|
||||
i_owner->clearUnitState(UNIT_STAT_FOLLOW);
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DEBUG_LOG("Player (GUID: %u) chase to %s (GUID: %u)",
|
||||
sLog.outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)",
|
||||
i_owner->GetGUIDLow(),
|
||||
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
|
||||
@@ -249,7 +249,7 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle)
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow(),
|
||||
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
|
||||
@@ -267,14 +267,14 @@ MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slo
|
||||
i_owner->addUnitState(UNIT_STAT_FOLLOW);
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DEBUG_LOG("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(),
|
||||
sLog.outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(),
|
||||
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
|
||||
Mutate(new TargetedMovementGenerator<Player>(*target,dist,angle), slot);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow(),
|
||||
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
|
||||
@@ -287,12 +287,12 @@ MotionMaster::MovePoint(uint32 id, float x, float y, float z)
|
||||
{
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DEBUG_LOG("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), id, x, y, z);
|
||||
sLog.outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), id, x, y, z);
|
||||
Mutate(new PointMovementGenerator<Player>(id,x,y,z), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow(), id, x, y, z);
|
||||
Mutate(new PointMovementGenerator<Creature>(id,x,y,z), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
@@ -331,12 +331,12 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee
|
||||
i_owner->m_TempSpeed = speedXY;
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DEBUG_LOG("Player (GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z);
|
||||
sLog.outStaticDebug("Player (GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z);
|
||||
Mutate(new PointMovementGenerator<Player>(0,x,y,z), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) jump to point (X: %f Y: %f Z: %f)",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) jump to point (X: %f Y: %f Z: %f)",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z);
|
||||
Mutate(new PointMovementGenerator<Creature>(0,x,y,z), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
@@ -354,12 +354,12 @@ MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id)
|
||||
i_owner->m_TempSpeed = speed;
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DEBUG_LOG("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z);
|
||||
sLog.outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z);
|
||||
Mutate(new PointMovementGenerator<Player>(id,x,y,z), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z);
|
||||
Mutate(new PointMovementGenerator<Creature>(id,x,y,z), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
@@ -382,7 +382,7 @@ MotionMaster::MoveSeekAssistance(float x, float y, float z)
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z);
|
||||
i_owner->AttackStop();
|
||||
i_owner->ToCreature()->SetReactState(REACT_PASSIVE);
|
||||
@@ -399,7 +399,7 @@ MotionMaster::MoveSeekAssistanceDistract(uint32 time)
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow(), time);
|
||||
Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
@@ -416,14 +416,14 @@ MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
|
||||
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DEBUG_LOG("Player (GUID: %u) flee from %s (GUID: %u)", i_owner->GetGUIDLow(),
|
||||
sLog.outStaticDebug("Player (GUID: %u) flee from %s (GUID: %u)", i_owner->GetGUIDLow(),
|
||||
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow());
|
||||
Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow(),
|
||||
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow(),
|
||||
@@ -442,7 +442,7 @@ MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
|
||||
{
|
||||
if (path < sTaxiPathNodesByPath.size())
|
||||
{
|
||||
DEBUG_LOG("%s taxi to (Path %u node %u)", i_owner->GetName(), path, pathnode);
|
||||
sLog.outStaticDebug("%s taxi to (Path %u node %u)", i_owner->GetName(), path, pathnode);
|
||||
FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(sTaxiPathNodesByPath[path],pathnode);
|
||||
Mutate(mgen, MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
@@ -467,11 +467,11 @@ MotionMaster::MoveDistract(uint32 timer)
|
||||
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DEBUG_LOG("Player (GUID: %u) distracted (timer: %u)", i_owner->GetGUIDLow(), timer);
|
||||
sLog.outStaticDebug("Player (GUID: %u) distracted (timer: %u)", i_owner->GetGUIDLow(), timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature (Entry: %u GUID: %u) (timer: %u)",
|
||||
sLog.outStaticDebug("Creature (Entry: %u GUID: %u) (timer: %u)",
|
||||
i_owner->GetEntry(), i_owner->GetGUIDLow(), timer);
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable)
|
||||
//Mutate(new WaypointMovementGenerator<Player>(path_id, repeatable)):
|
||||
Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
|
||||
|
||||
DEBUG_LOG("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
|
||||
sLog.outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
|
||||
i_owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature",
|
||||
i_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO");
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
|
||||
{
|
||||
DoEventIfAny(player,(*i_path)[i_currentNode], true);
|
||||
|
||||
DEBUG_LOG("loading node %u for player %s", i_currentNode, player.GetName());
|
||||
sLog.outStaticDebug("loading node %u for player %s", i_currentNode, player.GetName());
|
||||
if ((*i_path)[i_currentNode].mapid == curMap)
|
||||
{
|
||||
// do not send movement, it was sent already
|
||||
|
||||
@@ -527,7 +527,7 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data)
|
||||
m_playerLoading = true;
|
||||
uint64 playerGuid = 0;
|
||||
|
||||
DEBUG_LOG("WORLD: Recvd Player Logon Message");
|
||||
sLog.outStaticDebug("WORLD: Recvd Player Logon Message");
|
||||
|
||||
recv_data >> playerGuid;
|
||||
|
||||
@@ -612,13 +612,13 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
data.put(0, linecount);
|
||||
|
||||
SendPacket(&data);
|
||||
DEBUG_LOG("WORLD: Sent motd (SMSG_MOTD)");
|
||||
sLog.outStaticDebug("WORLD: Sent motd (SMSG_MOTD)");
|
||||
|
||||
// send server info
|
||||
if (sWorld.getConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1)
|
||||
chH.PSendSysMessage(_FULLVERSION);
|
||||
|
||||
DEBUG_LOG("WORLD: Sent server info");
|
||||
sLog.outStaticDebug("WORLD: Sent server info");
|
||||
}
|
||||
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow());
|
||||
@@ -646,7 +646,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
data << uint8(1);
|
||||
data << guild->GetMOTD();
|
||||
SendPacket(&data);
|
||||
DEBUG_LOG("WORLD: Sent guild-motd (SMSG_GUILD_EVENT)");
|
||||
sLog.outStaticDebug("WORLD: Sent guild-motd (SMSG_GUILD_EVENT)");
|
||||
|
||||
guild->DisplayGuildBankTabsInfo(this);
|
||||
|
||||
@@ -785,7 +785,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
|
||||
void WorldSession::HandleSetFactionAtWar(WorldPacket & recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: Received CMSG_SET_FACTION_ATWAR");
|
||||
sLog.outStaticDebug("WORLD: Received CMSG_SET_FACTION_ATWAR");
|
||||
|
||||
uint32 repListID;
|
||||
uint8 flag;
|
||||
@@ -824,7 +824,7 @@ void WorldSession::HandleSetFactionCheat(WorldPacket & /*recv_data*/)
|
||||
|
||||
void WorldSession::HandleMeetingStoneInfo(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
DEBUG_LOG("WORLD: Received CMSG_MEETING_STONE_INFO");
|
||||
sLog.outStaticDebug("WORLD: Received CMSG_MEETING_STONE_INFO");
|
||||
|
||||
//SendLfgUpdate(0, 0, 0);
|
||||
}
|
||||
@@ -863,7 +863,7 @@ void WorldSession::HandleTutorialReset(WorldPacket & /*recv_data*/)
|
||||
|
||||
void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: Received CMSG_SET_WATCHED_FACTION");
|
||||
sLog.outStaticDebug("WORLD: Received CMSG_SET_WATCHED_FACTION");
|
||||
uint32 fact;
|
||||
recv_data >> fact;
|
||||
GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact);
|
||||
@@ -871,7 +871,7 @@ void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: Received CMSG_SET_FACTION_INACTIVE");
|
||||
sLog.outStaticDebug("WORLD: Received CMSG_SET_FACTION_INACTIVE");
|
||||
uint32 replistid;
|
||||
uint8 inactive;
|
||||
recv_data >> replistid >> inactive;
|
||||
@@ -881,13 +881,13 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleShowingHelmOpcode(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
DEBUG_LOG("CMSG_SHOWING_HELM for %s", _player->GetName());
|
||||
sLog.outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName());
|
||||
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
|
||||
}
|
||||
|
||||
void WorldSession::HandleShowingCloakOpcode(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
DEBUG_LOG("CMSG_SHOWING_CLOAK for %s", _player->GetName());
|
||||
sLog.outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName());
|
||||
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket & recv_data)
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
DEBUG_LOG("WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid));
|
||||
sLog.outStaticDebug("WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid));
|
||||
|
||||
Unit *pEnemy = ObjectAccessor::GetUnit(*_player, guid);
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
|
||||
//sLog.outDebug("WORLD: received CMSG_DUEL_ACCEPTED");
|
||||
DEBUG_LOG("Player 1 is: %u (%s)", pl->GetGUIDLow(),pl->GetName());
|
||||
DEBUG_LOG("Player 2 is: %u (%s)", plTarget->GetGUIDLow(),plTarget->GetName());
|
||||
sLog.outStaticDebug("Player 1 is: %u (%s)", pl->GetGUIDLow(),pl->GetName());
|
||||
sLog.outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(),plTarget->GetName());
|
||||
|
||||
time_t now = time(NULL);
|
||||
pl->duel->startTimer = now;
|
||||
|
||||
@@ -1072,18 +1072,18 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleCompleteCinematic(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
DEBUG_LOG("WORLD: Player is watching cinema");
|
||||
sLog.outStaticDebug("WORLD: Player is watching cinema");
|
||||
}
|
||||
|
||||
void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
DEBUG_LOG("WORLD: Which movie to play");
|
||||
sLog.outStaticDebug("WORLD: Which movie to play");
|
||||
}
|
||||
|
||||
void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
/* WorldSession::Update(getMSTime());*/
|
||||
DEBUG_LOG("WORLD: Time Lag/Synchronization Resent/Update");
|
||||
sLog.outStaticDebug("WORLD: Time Lag/Synchronization Resent/Update");
|
||||
|
||||
uint64 guid;
|
||||
recv_data.readPackGUID(guid);
|
||||
@@ -1105,7 +1105,7 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleFeatherFallAck(WorldPacket &recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: CMSG_MOVE_FEATHER_FALL_ACK");
|
||||
sLog.outStaticDebug("WORLD: CMSG_MOVE_FEATHER_FALL_ACK");
|
||||
|
||||
// no used
|
||||
recv_data.rpos(recv_data.wpos()); // prevent warnings spam
|
||||
@@ -1203,7 +1203,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
DEBUG_LOG("Inspected guid is " UI64FMTD, guid);
|
||||
sLog.outStaticDebug("Inspected guid is " UI64FMTD, guid);
|
||||
|
||||
_player->SetSelection(guid);
|
||||
|
||||
@@ -1281,7 +1281,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time/1000, mapid, PositionX, PositionY, PositionZ, Orientation);
|
||||
sLog.outStaticDebug("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time/1000, mapid, PositionX, PositionY, PositionZ, Orientation);
|
||||
|
||||
if (GetSecurity() >= SEC_ADMINISTRATOR)
|
||||
GetPlayer()->TeleportTo(mapid,PositionX,PositionY,PositionZ,Orientation);
|
||||
|
||||
@@ -199,8 +199,8 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)
|
||||
|
||||
uint32 flags, time;
|
||||
recv_data >> flags >> time;
|
||||
DEBUG_LOG("Guid " UI64FMTD, guid);
|
||||
DEBUG_LOG("Flags %u, time %u", flags, time/IN_MILLISECONDS);
|
||||
sLog.outStaticDebug("Guid " UI64FMTD, guid);
|
||||
sLog.outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS);
|
||||
|
||||
Unit *mover = _player->m_mover;
|
||||
Player *plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL;
|
||||
|
||||
@@ -417,7 +417,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
|
||||
{
|
||||
if (!GetPlayer()->isGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
|
||||
{
|
||||
DEBUG_LOG("Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid));
|
||||
sLog.outStaticDebug("Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -426,7 +426,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
|
||||
{
|
||||
if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER))
|
||||
{
|
||||
DEBUG_LOG("Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid));
|
||||
sLog.outStaticDebug("Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item **m
|
||||
{
|
||||
if (Item* item = myTrade->GetItem(TradeSlots(i)))
|
||||
{
|
||||
DEBUG_LOG("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
|
||||
sLog.outStaticDebug("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
|
||||
//Can return NULL
|
||||
myItems[i] = item;
|
||||
myItems[i]->SetInTrade();
|
||||
@@ -228,7 +228,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item **m
|
||||
|
||||
if (Item* item = hisTrade->GetItem(TradeSlots(i)))
|
||||
{
|
||||
DEBUG_LOG("partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
|
||||
sLog.outStaticDebug("partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
|
||||
hisItems[i] = item;
|
||||
hisItems[i]->SetInTrade();
|
||||
}
|
||||
|
||||
@@ -314,14 +314,14 @@ int WorldSocket::handle_input (ACE_HANDLE)
|
||||
return Update(); // interesting line ,isn't it ?
|
||||
}
|
||||
|
||||
DEBUG_LOG("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno));
|
||||
sLog.outStaticDebug("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno));
|
||||
|
||||
errno = ECONNRESET;
|
||||
return -1;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
DEBUG_LOG("WorldSocket::handle_input: Peer has closed connection");
|
||||
sLog.outStaticDebug("WorldSocket::handle_input: Peer has closed connection");
|
||||
|
||||
errno = ECONNRESET;
|
||||
return -1;
|
||||
@@ -718,7 +718,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
|
||||
sScriptMgr.OnPacketReceive(this, WorldPacket(*new_pct));
|
||||
return HandleAuthSession (*new_pct);
|
||||
case CMSG_KEEP_ALIVE:
|
||||
DEBUG_LOG ("CMSG_KEEP_ALIVE ,size: %d", new_pct->size());
|
||||
sLog.outStaticDebug ("CMSG_KEEP_ALIVE ,size: %d", new_pct->size());
|
||||
sScriptMgr.OnPacketReceive(this, WorldPacket(*new_pct));
|
||||
return 0;
|
||||
default:
|
||||
@@ -800,7 +800,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
recvPacket >> unk4;
|
||||
recvPacket.read (digest, 20);
|
||||
|
||||
DEBUG_LOG ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u",
|
||||
sLog.outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u",
|
||||
BuiltNumberClient,
|
||||
unk2,
|
||||
account.c_str(),
|
||||
@@ -857,7 +857,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
const char* sStr = s.AsHexStr(); //Must be freed by OPENSSL_free()
|
||||
const char* vStr = v.AsHexStr(); //Must be freed by OPENSSL_free()
|
||||
|
||||
DEBUG_LOG ("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s",
|
||||
sLog.outStaticDebug ("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s",
|
||||
sStr,
|
||||
vStr);
|
||||
|
||||
@@ -970,7 +970,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
|
||||
std::string address = GetRemoteAddress();
|
||||
|
||||
DEBUG_LOG ("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.",
|
||||
sLog.outStaticDebug ("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.",
|
||||
account.c_str(),
|
||||
address.c_str());
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||
|
||||
virtual int svc()
|
||||
{
|
||||
DEBUG_LOG ("Network Thread Starting");
|
||||
sLog.outStaticDebug ("Network Thread Starting");
|
||||
|
||||
bool needInit = true;
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
@@ -218,7 +218,7 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||
if (needInit)
|
||||
MySQL::Thread_End();
|
||||
|
||||
DEBUG_LOG ("Network Thread Exitting");
|
||||
sLog.outStaticDebug ("Network Thread Exitting");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4670,7 +4670,7 @@ void Spell::HandleThreatSpells(uint32 spellId)
|
||||
|
||||
m_targets.getUnitTarget()->AddThreat(m_caster, float(threat));
|
||||
|
||||
DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr.GetSpellRank(spellId), threat);
|
||||
sLog.outStaticDebug("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr.GetSpellRank(spellId), threat);
|
||||
}
|
||||
|
||||
void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i)
|
||||
|
||||
@@ -2081,7 +2081,7 @@ void Spell::EffectTriggerMissileSpell(uint32 effect_idx)
|
||||
}
|
||||
|
||||
if (m_CastItem)
|
||||
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
|
||||
// Remove spell cooldown (not category) if spell triggering spell with cooldown and same category
|
||||
// Needed by freezing arrow and few other spells
|
||||
@@ -6736,7 +6736,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
//pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
|
||||
pGameObj->SetSpellId(m_spellInfo->Id);
|
||||
|
||||
DEBUG_LOG("AddObject at SpellEfects.cpp EffectTransmitted");
|
||||
sLog.outStaticDebug("AddObject at SpellEfects.cpp EffectTransmitted");
|
||||
//m_caster->AddGameObject(pGameObj);
|
||||
//m_ObjToDel.push_back(pGameObj);
|
||||
|
||||
@@ -7385,11 +7385,11 @@ void Spell::EffectBind(uint32 i)
|
||||
data << uint32(area_id);
|
||||
player->SendDirectMessage( &data );
|
||||
|
||||
DEBUG_LOG("New homebind X : %f", loc.m_positionX);
|
||||
DEBUG_LOG("New homebind Y : %f", loc.m_positionY);
|
||||
DEBUG_LOG("New homebind Z : %f", loc.m_positionZ);
|
||||
DEBUG_LOG("New homebind MapId : %u", loc.m_mapId);
|
||||
DEBUG_LOG("New homebind AreaId : %u", area_id);
|
||||
sLog.outStaticDebug("New homebind X : %f", loc.m_positionX);
|
||||
sLog.outStaticDebug("New homebind Y : %f", loc.m_positionY);
|
||||
sLog.outStaticDebug("New homebind Z : %f", loc.m_positionZ);
|
||||
sLog.outStaticDebug("New homebind MapId : %u", loc.m_mapId);
|
||||
sLog.outStaticDebug("New homebind AreaId : %u", area_id);
|
||||
|
||||
// zone update
|
||||
data.Initialize(SMSG_PLAYERBOUND, 8+4);
|
||||
|
||||
@@ -2389,7 +2389,7 @@ void World::ShutdownMsg(bool show, Player* player)
|
||||
ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME;
|
||||
|
||||
SendServerMessage(msgid,str.c_str(),player);
|
||||
DEBUG_LOG("Server is %s in %s",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"),str.c_str());
|
||||
sLog.outStaticDebug("Server is %s in %s",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"),str.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2407,7 +2407,7 @@ void World::ShutdownCancel()
|
||||
m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value
|
||||
SendServerMessage(msgid);
|
||||
|
||||
DEBUG_LOG("Server %s cancelled.",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
|
||||
sLog.outStaticDebug("Server %s cancelled.",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
|
||||
|
||||
sScriptMgr.OnShutdownCancel();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ bool DatabaseWorkerPool::Open(const std::string& infoString, uint8 num_threads)
|
||||
|
||||
void DatabaseWorkerPool::Close()
|
||||
{
|
||||
DEBUG_LOG("Closing down %u connections on this DatabaseWorkerPool", (uint32)m_connections.value());
|
||||
sLog.outStaticDebug("Closing down %u connections on this DatabaseWorkerPool", (uint32)m_connections.value());
|
||||
/// Shuts down worker threads for this connection pool.
|
||||
ACE_Thread_Mutex shutdown_Mtx;
|
||||
ACE_Condition_Thread_Mutex m_condition(shutdown_Mtx);
|
||||
@@ -75,14 +75,14 @@ void DatabaseWorkerPool::Close()
|
||||
delete m_bundle_conn;
|
||||
m_bundle_conn = NULL;
|
||||
--m_connections;
|
||||
DEBUG_LOG("Closed bundled connection.");
|
||||
sLog.outStaticDebug("Closed bundled connection.");
|
||||
|
||||
//- MySQL::Thread_End() should be called manually from the aborting calling threads
|
||||
DEBUG_LOG("Waiting for %u synchroneous database threads to exit.", (uint32)m_connections.value());
|
||||
sLog.outStaticDebug("Waiting for %u synchroneous database threads to exit.", (uint32)m_connections.value());
|
||||
while (!m_sync_connections.empty())
|
||||
{
|
||||
}
|
||||
DEBUG_LOG("Synchroneous database threads exited succesfuly.");
|
||||
sLog.outStaticDebug("Synchroneous database threads exited succesfuly.");
|
||||
|
||||
mysql_library_end();
|
||||
}
|
||||
|
||||
@@ -49,14 +49,14 @@
|
||||
# define DECLSPEC_NORETURN
|
||||
#endif //PLATFORM
|
||||
|
||||
#if !defined(DEBUG)
|
||||
#if !defined(COREDEBUG)
|
||||
# define TRINITY_INLINE inline
|
||||
#else //DEBUG
|
||||
#else //COREDEBUG
|
||||
# if !defined(TRINITY_DEBUG)
|
||||
# define TRINITY_DEBUG
|
||||
# endif //TRINITY_DEBUG
|
||||
# define TRINITY_INLINE
|
||||
#endif //!DEBUG
|
||||
#endif //!COREDEBUG
|
||||
|
||||
#if COMPILER == COMPILER_GNU
|
||||
# define ATTR_NORETURN __attribute__((noreturn))
|
||||
@@ -75,11 +75,4 @@ typedef ACE_UINT32 uint32;
|
||||
typedef ACE_UINT16 uint16;
|
||||
typedef ACE_UINT8 uint8;
|
||||
|
||||
#if COMPILER != COMPILER_MICROSOFT
|
||||
typedef uint16 WORD;
|
||||
typedef uint32 DWORD;
|
||||
#endif //COMPILER
|
||||
|
||||
typedef uint64 OBJECT_HANDLE;
|
||||
|
||||
#endif //TRINITY_DEFINE_H
|
||||
|
||||
@@ -734,6 +734,18 @@ void Log::outDebug(const char * str, ...)
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void Log::outStaticDebug(const char * fmt, ...)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
va_list ap;
|
||||
char str[2048];
|
||||
va_start(ap, str);
|
||||
vsnprintf(str, 2048, fmt, ap);
|
||||
va_end(ap);
|
||||
outDebug(str);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Log::outStringInLine(const char * str, ...)
|
||||
{
|
||||
if (!str)
|
||||
|
||||
@@ -104,6 +104,7 @@ class Log
|
||||
void outBasic( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outDetail( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outDebug( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outStaticDebug( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outChar( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
@@ -174,11 +175,5 @@ class Log
|
||||
|
||||
#define sLog (*ACE_Singleton<Log, ACE_Thread_Mutex>::instance())
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#define DEBUG_LOG sLog.outDebug
|
||||
#else
|
||||
#define DEBUG_LOG
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user