refactor(Core/Misc): acore to Acore (#6043)

This commit is contained in:
Kitzunu
2021-05-31 14:21:54 +02:00
committed by GitHub
parent 7eeae6866e
commit 897a02bb75
224 changed files with 942 additions and 942 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
me->IsFriendlyTo(victim) || !me->CanSeeOrDetect(victim))
{
victim = nullptr;
acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
acore::UnitLastSearcher<acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
Acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
Acore::UnitLastSearcher<Acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
me->VisitNearbyObject(max_range, checker);
}
+10 -10
View File
@@ -28,7 +28,7 @@ enum SelectAggroTarget
};
// default predicate function to select target based on distance, player and/or aura criteria
struct DefaultTargetSelector : public acore::unary_function<Unit*, bool>
struct DefaultTargetSelector : public Acore::unary_function<Unit*, bool>
{
const Unit* me;
float m_dist;
@@ -78,7 +78,7 @@ struct DefaultTargetSelector : public acore::unary_function<Unit*, bool>
// Target selector for spell casts checking range, auras and attributes
// TODO: Add more checks from Spell::CheckCast
struct SpellTargetSelector : public acore::unary_function<Unit*, bool>
struct SpellTargetSelector : public Acore::unary_function<Unit*, bool>
{
public:
SpellTargetSelector(Unit* caster, uint32 spellId);
@@ -92,7 +92,7 @@ private:
// Very simple target selector, will just skip main target
// NOTE: When passing to UnitAI::SelectTarget remember to use 0 as position for random selection
// because tank will not be in the temporary list
struct NonTankTargetSelector : public acore::unary_function<Unit*, bool>
struct NonTankTargetSelector : public Acore::unary_function<Unit*, bool>
{
public:
NonTankTargetSelector(Creature* source, bool playerOnly = true) : _source(source), _playerOnly(playerOnly) { }
@@ -104,7 +104,7 @@ private:
};
// Simple selector for units using mana
struct PowerUsersSelector : public acore::unary_function<Unit*, bool>
struct PowerUsersSelector : public Acore::unary_function<Unit*, bool>
{
Unit const* _me;
Powers const _power;
@@ -134,7 +134,7 @@ struct PowerUsersSelector : public acore::unary_function<Unit*, bool>
}
};
struct FarthestTargetSelector : public acore::unary_function<Unit*, bool>
struct FarthestTargetSelector : public Acore::unary_function<Unit*, bool>
{
FarthestTargetSelector(Unit const* unit, float dist, bool playerOnly, bool inLos) : _me(unit), _dist(dist), _playerOnly(playerOnly), _inLos(inLos) {}
@@ -190,7 +190,7 @@ public:
Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
// Select the targets satifying the predicate.
// predicate shall extend acore::unary_function<Unit*, bool>
// predicate shall extend Acore::unary_function<Unit*, bool>
template <class PREDICATE> Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE const& predicate)
{
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
@@ -206,7 +206,7 @@ public:
return nullptr;
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
targetList.sort(acore::ObjectDistanceOrderPred(me));
targetList.sort(Acore::ObjectDistanceOrderPred(me));
switch (targetType)
{
@@ -240,7 +240,7 @@ public:
void SelectTargetList(std::list<Unit*>& targetList, uint32 num, SelectAggroTarget targetType, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
// Select the targets satifying the predicate.
// predicate shall extend acore::unary_function<Unit*, bool>
// predicate shall extend Acore::unary_function<Unit*, bool>
template <class PREDICATE> void SelectTargetList(std::list<Unit*>& targetList, PREDICATE const& predicate, uint32 maxTargets, SelectAggroTarget targetType)
{
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
@@ -255,13 +255,13 @@ public:
return;
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
targetList.sort(acore::ObjectDistanceOrderPred(me));
targetList.sort(Acore::ObjectDistanceOrderPred(me));
if (targetType == SELECT_TARGET_FARTHEST || targetType == SELECT_TARGET_BOTTOMAGGRO)
targetList.reverse();
if (targetType == SELECT_TARGET_RANDOM)
acore::Containers::RandomResize(targetList, maxTargets);
Acore::Containers::RandomResize(targetList, maxTargets);
else
targetList.resize(maxTargets);
}
@@ -379,8 +379,8 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
{
Unit* unit = nullptr;
acore::MostHPMissingInRange u_check(me, range, minHPDiff);
acore::UnitLastSearcher<acore::MostHPMissingInRange> searcher(me, unit, u_check);
Acore::MostHPMissingInRange u_check(me, range, minHPDiff);
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
return unit;
@@ -389,8 +389,8 @@ Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
{
std::list<Creature*> list;
acore::FriendlyCCedInRange u_check(me, range);
acore::CreatureListSearcher<acore::FriendlyCCedInRange> searcher(me, list, u_check);
Acore::FriendlyCCedInRange u_check(me, range);
Acore::CreatureListSearcher<Acore::FriendlyCCedInRange> searcher(me, list, u_check);
me->VisitNearbyObject(range, searcher);
return list;
}
@@ -398,8 +398,8 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 uiSpellid)
{
std::list<Creature*> list;
acore::FriendlyMissingBuffInRange u_check(me, range, uiSpellid);
acore::CreatureListSearcher<acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
Acore::FriendlyMissingBuffInRange u_check(me, range, uiSpellid);
Acore::CreatureListSearcher<Acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
me->VisitNearbyObject(range, searcher);
return list;
}
@@ -408,13 +408,13 @@ Player* ScriptedAI::GetPlayerAtMinimumRange(float minimumRange)
{
Player* player = nullptr;
CellCoord pair(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
CellCoord pair(Acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
cell.SetNoCreate();
acore::PlayerAtMinimumRangeAway check(me, minimumRange);
acore::PlayerSearcher<acore::PlayerAtMinimumRangeAway> searcher(me, player, check);
TypeContainerVisitor<acore::PlayerSearcher<acore::PlayerAtMinimumRangeAway>, GridTypeMapContainer> visitor(searcher);
Acore::PlayerAtMinimumRangeAway check(me, minimumRange);
Acore::PlayerSearcher<Acore::PlayerAtMinimumRangeAway> searcher(me, player, check);
TypeContainerVisitor<Acore::PlayerSearcher<Acore::PlayerAtMinimumRangeAway>, GridTypeMapContainer> visitor(searcher);
cell.Visit(pair, visitor, *me->GetMap(), *me, minimumRange);
@@ -107,7 +107,7 @@ public:
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
StorageType listCopy = storage_;
acore::Containers::RandomResize<StorageType, Predicate>(listCopy, std::forward<Predicate>(predicate), max);
Acore::Containers::RandomResize<StorageType, Predicate>(listCopy, std::forward<Predicate>(predicate), max);
for (auto const& guid : listCopy)
{
+20 -20
View File
@@ -734,7 +734,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
caster = unit->SummonTrigger(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetOrientation(), 5000);
if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit)
acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
Acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -793,7 +793,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit)
acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
Acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1527,7 +1527,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
// xinef: attack random target
if (Unit* target = acore::Containers::SelectRandomContainerElement(*targets)->ToUnit())
if (Unit* target = Acore::Containers::SelectRandomContainerElement(*targets)->ToUnit())
me->AI()->AttackStart(target);
delete targets;
@@ -1944,7 +1944,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (ObjectList* targets = GetTargets(e, unit))
{
// xinef: we want to move to random element
target = acore::Containers::SelectRandomContainerElement(*targets);
target = Acore::Containers::SelectRandomContainerElement(*targets);
delete targets;
}
}
@@ -2515,7 +2515,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
// xinef: my implementation
if (e.action.jump.selfJump)
{
if (WorldObject* target = acore::Containers::SelectRandomContainerElement(*targets))
if (WorldObject* target = Acore::Containers::SelectRandomContainerElement(*targets))
if (me)
me->GetMotionMaster()->MoveJump(target->GetPositionX() + e.target.x, target->GetPositionY() + e.target.y, target->GetPositionZ() + e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz);
}
@@ -3680,7 +3680,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
l->push_back(*itr);
if (e.target.playerRange.maxCount > 0)
acore::Containers::RandomResize(*l, e.target.playerRange.maxCount);
Acore::Containers::RandomResize(*l, e.target.playerRange.maxCount);
}
delete units;
@@ -3800,7 +3800,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
l->push_back(*itr);
if (e.target.o > 0)
acore::Containers::RandomResize(*l, e.target.o);
Acore::Containers::RandomResize(*l, e.target.o);
delete units;
break;
@@ -3842,7 +3842,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
}
if (e.target.roleSelection.resize > 0)
acore::Containers::RandomResize(*l, e.target.roleSelection.resize);
Acore::Containers::RandomResize(*l, e.target.roleSelection.resize);
delete units;
break;
@@ -3879,8 +3879,8 @@ ObjectList* SmartScript::GetWorldObjectsInDist(float dist)
WorldObject* obj = GetBaseObject();
if (obj)
{
acore::AllWorldObjectsInRange u_check(obj, dist);
acore::WorldObjectListSearcher<acore::AllWorldObjectsInRange> searcher(obj, *targets, u_check);
Acore::AllWorldObjectsInRange u_check(obj, dist);
Acore::WorldObjectListSearcher<Acore::AllWorldObjectsInRange> searcher(obj, *targets, u_check);
obj->VisitNearbyObject(dist, searcher);
}
return targets;
@@ -4010,7 +4010,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
RecalcTimer(e, 1000, 3000);
return;
}
ProcessTimedAction(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax, acore::Containers::SelectRandomContainerElement(pList));
ProcessTimedAction(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax, Acore::Containers::SelectRandomContainerElement(pList));
break;
}
case SMART_EVENT_FRIENDLY_MISSING_BUFF:
@@ -4021,7 +4021,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
if (pList.empty())
return;
ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, acore::Containers::SelectRandomContainerElement(pList));
ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, Acore::Containers::SelectRandomContainerElement(pList));
break;
}
case SMART_EVENT_HAS_AURA:
@@ -4862,8 +4862,8 @@ Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
Unit* unit = nullptr;
acore::MostHPMissingInRange u_check(me, range, MinHPDiff);
acore::UnitLastSearcher<acore::MostHPMissingInRange> searcher(me, unit, u_check);
Acore::MostHPMissingInRange u_check(me, range, MinHPDiff);
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
return unit;
}
@@ -4873,8 +4873,8 @@ void SmartScript::DoFindFriendlyCC(std::list<Creature*>& _list, float range)
if (!me)
return;
acore::FriendlyCCedInRange u_check(me, range);
acore::CreatureListSearcher<acore::FriendlyCCedInRange> searcher(me, _list, u_check);
Acore::FriendlyCCedInRange u_check(me, range);
Acore::CreatureListSearcher<Acore::FriendlyCCedInRange> searcher(me, _list, u_check);
me->VisitNearbyObject(range, searcher);
}
@@ -4883,8 +4883,8 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& list, float ra
if (!me)
return;
acore::FriendlyMissingBuffInRange u_check(me, range, spellid);
acore::CreatureListSearcher<acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
Acore::FriendlyMissingBuffInRange u_check(me, range, spellid);
Acore::CreatureListSearcher<Acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
me->VisitNearbyObject(range, searcher);
}
@@ -4894,8 +4894,8 @@ Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly)
return nullptr;
Unit* unit = nullptr;
acore::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
acore::UnitLastSearcher<acore::AnyFriendlyNotSelfUnitInObjectRangeCheck> searcher(me, unit, u_check);
Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
Acore::UnitLastSearcher<Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
return unit;
}
@@ -1120,7 +1120,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
case SMART_ACTION_LOAD_GRID:
{
if (!acore::IsValidMapCoord(e.target.x, e.target.y))
if (!Acore::IsValidMapCoord(e.target.x, e.target.y))
{
LOG_ERROR("server", "SmartScript: SMART_ACTION_LOAD_GRID uses invalid map coords: %u, skipped.", e.entryOrGuid);
return false;
+6 -6
View File
@@ -34,7 +34,7 @@ namespace AccountMgr
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT);
stmt->setString(0, username);
auto [salt, verifier] = acore::Crypto::SRP6::MakeRegistrationData(username, password);
auto [salt, verifier] = Acore::Crypto::SRP6::MakeRegistrationData(username, password);
stmt->setBinary(1, salt);
stmt->setBinary(2, verifier);
stmt->setInt8(3, uint8(sWorld->getIntConfig(CONFIG_EXPANSION)));
@@ -147,7 +147,7 @@ namespace AccountMgr
stmt->setUInt32(1, accountId);
LoginDatabase.Execute(stmt);
auto [salt, verifier] = acore::Crypto::SRP6::MakeRegistrationData(newUsername, newPassword);
auto [salt, verifier] = Acore::Crypto::SRP6::MakeRegistrationData(newUsername, newPassword);
stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGON);
stmt->setBinary(0, salt);
stmt->setBinary(1, verifier);
@@ -176,7 +176,7 @@ namespace AccountMgr
Utf8ToUpperOnlyLatin(username);
Utf8ToUpperOnlyLatin(newPassword);
auto [salt, verifier] = acore::Crypto::SRP6::MakeRegistrationData(username, newPassword);
auto [salt, verifier] = Acore::Crypto::SRP6::MakeRegistrationData(username, newPassword);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGON);
stmt->setBinary(0, salt);
@@ -245,9 +245,9 @@ namespace AccountMgr
stmt->setUInt32(0, accountId);
if (PreparedQueryResult result = LoginDatabase.Query(stmt))
{
acore::Crypto::SRP6::Salt salt = (*result)[0].GetBinary<acore::Crypto::SRP6::SALT_LENGTH>();
acore::Crypto::SRP6::Verifier verifier = (*result)[1].GetBinary<acore::Crypto::SRP6::VERIFIER_LENGTH>();
if (acore::Crypto::SRP6::CheckLogin(username, password, salt, verifier))
Acore::Crypto::SRP6::Salt salt = (*result)[0].GetBinary<Acore::Crypto::SRP6::SALT_LENGTH>();
Acore::Crypto::SRP6::Verifier verifier = (*result)[1].GetBinary<Acore::Crypto::SRP6::VERIFIER_LENGTH>();
if (Acore::Crypto::SRP6::CheckLogin(username, password, salt, verifier))
return true;
}
@@ -32,7 +32,7 @@
#include "World.h"
#include "WorldPacket.h"
namespace acore
namespace Acore
{
class AchievementChatBuilder
{
@@ -52,7 +52,7 @@ namespace acore
int32 i_textId;
uint32 i_achievementId;
};
} // namespace acore
} // namespace Acore
bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
{
@@ -668,8 +668,8 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId());
if (guild)
{
acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
acore::LocalizedPacketDo<acore::AchievementChatBuilder> say_do(say_builder);
Acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
Acore::LocalizedPacketDo<Acore::AchievementChatBuilder> say_do(say_builder);
guild->BroadcastWorker(say_do, GetPlayer());
}
@@ -706,15 +706,15 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
// if player is in world he can tell his friends about new achievement
else if (GetPlayer()->IsInWorld())
{
CellCoord p = acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
CellCoord p = Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
Cell cell(p);
cell.SetNoCreate();
acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
acore::LocalizedPacketDo<acore::AchievementChatBuilder> say_do(say_builder);
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::AchievementChatBuilder> > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker);
Acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
Acore::LocalizedPacketDo<Acore::AchievementChatBuilder> say_do(say_builder);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::AchievementChatBuilder> > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
}
+2 -2
View File
@@ -1003,8 +1003,8 @@ bool BfCapturePoint::Update(uint32 diff)
}
std::list<Player*> players;
acore::AnyPlayerInObjectRangeCheck checker(capturePoint, radius);
acore::PlayerListSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(capturePoint, players, checker);
Acore::AnyPlayerInObjectRangeCheck checker(capturePoint, radius);
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(capturePoint, players, checker);
capturePoint->VisitNearbyWorldObject(radius, searcher);
for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
@@ -37,7 +37,7 @@
#ifdef ELUNA
#include "LuaEngine.h"
#endif
namespace acore
namespace Acore
{
class BattlegroundChatBuilder
{
@@ -101,7 +101,7 @@ namespace acore
uint32 _arg1;
uint32 _arg2;
};
} // namespace acore
} // namespace Acore
template<class Do>
void Battleground::BroadcastWorker(Do& _do)
@@ -1067,7 +1067,7 @@ uint32 Battleground::GetBonusHonorFromKill(uint32 kills) const
{
//variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill)
uint32 maxLevel = std::min<uint32>(GetMaxLevel(), 80U);
return acore::Honor::hk_honor_at_level(maxLevel, float(kills));
return Acore::Honor::hk_honor_at_level(maxLevel, float(kills));
}
void Battleground::BlockMovement(Player* player)
@@ -1749,8 +1749,8 @@ void Battleground::SendMessageToAll(uint32 entry, ChatMsg type, Player const* so
if (!entry)
return;
acore::BattlegroundChatBuilder bg_builder(type, entry, source);
acore::LocalizedPacketDo<acore::BattlegroundChatBuilder> bg_do(bg_builder);
Acore::BattlegroundChatBuilder bg_builder(type, entry, source);
Acore::LocalizedPacketDo<Acore::BattlegroundChatBuilder> bg_do(bg_builder);
BroadcastWorker(bg_do);
}
@@ -1762,8 +1762,8 @@ void Battleground::PSendMessageToAll(uint32 entry, ChatMsg type, Player const* s
va_list ap;
va_start(ap, source);
acore::BattlegroundChatBuilder bg_builder(type, entry, source, &ap);
acore::LocalizedPacketDo<acore::BattlegroundChatBuilder> bg_do(bg_builder);
Acore::BattlegroundChatBuilder bg_builder(type, entry, source, &ap);
Acore::LocalizedPacketDo<Acore::BattlegroundChatBuilder> bg_do(bg_builder);
BroadcastWorker(bg_do);
va_end(ap);
@@ -1796,8 +1796,8 @@ void Battleground::SendWarningToAll(uint32 entry, ...)
void Battleground::SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 arg1, uint32 arg2)
{
acore::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2);
acore::LocalizedPacketDo<acore::Battleground2ChatBuilder> bg_do(bg_builder);
Acore::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2);
Acore::LocalizedPacketDo<Acore::Battleground2ChatBuilder> bg_do(bg_builder);
BroadcastWorker(bg_do);
}
@@ -655,8 +655,8 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, ObjectGuid
uint32 winner_arena = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_FIRST);
uint32 loser_kills = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_FIRST);
winner_kills = acore::Honor::hk_honor_at_level(player->getLevel(), float(winner_kills));
loser_kills = acore::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills));
winner_kills = Acore::Honor::hk_honor_at_level(player->getLevel(), float(winner_kills));
loser_kills = Acore::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills));
data->Initialize(SMSG_BATTLEFIELD_LIST);
*data << guid; // battlemaster guid
@@ -971,7 +971,7 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId)
}
}
return *acore::Containers::SelectRandomWeightedContainerElement(ids, weights);
return *Acore::Containers::SelectRandomWeightedContainerElement(ids, weights);
}
return BATTLEGROUND_TYPE_NONE;
+2 -2
View File
@@ -886,8 +886,8 @@ GameObject* ChatHandler::GetNearbyGameObject()
Player* pl = m_session->GetPlayer();
GameObject* obj = nullptr;
acore::NearestGameObjectCheck check(*pl);
acore::GameObjectLastSearcher<acore::NearestGameObjectCheck> searcher(pl, obj, check);
Acore::NearestGameObjectCheck check(*pl);
Acore::GameObjectLastSearcher<Acore::NearestGameObjectCheck> searcher(pl, obj, check);
pl->VisitNearbyGridObject(SIZE_OF_GRIDS, searcher);
return obj;
}
+1 -1
View File
@@ -280,7 +280,7 @@ void ThreatContainer::modifyThreatPercent(Unit* victim, int32 percent)
void ThreatContainer::update()
{
if (iDirty && iThreatList.size() > 1)
iThreatList.sort(acore::ThreatOrderPred());
iThreatList.sort(Acore::ThreatOrderPred());
iDirty = false;
}
+1 -1
View File
@@ -256,7 +256,7 @@ private:
//=================================================
namespace acore
namespace Acore
{
// Binary predicate for sorting HostileReferences based on threat value
class ThreatOrderPred
+1 -1
View File
@@ -413,7 +413,7 @@ namespace lfg
proposal.cancelTime = time(nullptr) + LFG_TIME_PROPOSAL;
proposal.state = LFG_PROPOSAL_INITIATING;
proposal.leader.Clear();
proposal.dungeonId = acore::Containers::SelectRandomContainerElement(proposalDungeons);
proposal.dungeonId = Acore::Containers::SelectRandomContainerElement(proposalDungeons);
bool leader = false;
for (LfgRolesMap::const_iterator itRoles = proposalRoles.begin(); itRoles != proposalRoles.end(); ++itRoles)
+2 -2
View File
@@ -74,7 +74,7 @@ bool Corpse::Create(ObjectGuid::LowType guidlow, Player* owner)
SetObjectScale(1);
SetGuidValue(CORPSE_FIELD_OWNER, owner->GetGUID());
_cellCoord = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
_cellCoord = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
return true;
}
@@ -162,7 +162,7 @@ bool Corpse::LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields)
return false;
}
_cellCoord = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
_cellCoord = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
return true;
}
+25 -25
View File
@@ -254,7 +254,7 @@ void Creature::RemoveFromWorld()
Unit::RemoveFromWorld();
if (m_spawnId)
acore::Containers::MultimapErasePair(GetMap()->GetCreatureBySpawnIdStore(), m_spawnId, this);
Acore::Containers::MultimapErasePair(GetMap()->GetCreatureBySpawnIdStore(), m_spawnId, this);
GetMap()->GetObjectsStore().Remove<Creature>(GetGUID());
}
@@ -888,13 +888,13 @@ void Creature::DoFleeToGetAssistance()
{
Creature* creature = nullptr;
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
cell.SetNoCreate();
acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
Acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
Acore::CreatureLastSearcher<Acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
TypeContainerVisitor<acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
TypeContainerVisitor<Acore::CreatureLastSearcher<Acore::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
@@ -1545,7 +1545,7 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad
if (CanFly())
{
float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, true, MAX_FALL_DISTANCE);
if (data->posZ - tz > 0.1f && acore::IsValidMapCoord(tz))
if (data->posZ - tz > 0.1f && Acore::IsValidMapCoord(tz))
{
Relocate(data->posX, data->posY, tz);
}
@@ -2077,7 +2077,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
// select nearest hostile unit within the given distance (regardless of threat list).
Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) const
{
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
cell.SetNoCreate();
@@ -2087,11 +2087,11 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
if (dist == 0.0f)
dist = MAX_SEARCHER_DISTANCE;
acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
acore::UnitLastSearcher<acore::NearestHostileUnitCheck> searcher(this, target, u_check);
Acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck> searcher(this, target, u_check);
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
@@ -2103,7 +2103,7 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
// select nearest hostile unit within the given attack distance (i.e. distance is ignored if > than ATTACK_DISTANCE), regardless of threat list.
Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
{
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
cell.SetNoCreate();
@@ -2115,11 +2115,11 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
dist = MAX_SEARCHER_DISTANCE;
{
acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
Acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
@@ -2155,14 +2155,14 @@ void Creature::CallAssistance()
std::list<Creature*> assistList;
{
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
cell.SetNoCreate();
acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
Acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
TypeContainerVisitor<acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
}
@@ -2187,14 +2187,14 @@ void Creature::CallForHelp(float radius)
if (radius <= 0.0f || !GetVictim() || IsPet() || IsCharmed())
return;
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
cell.SetNoCreate();
acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
Acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
Acore::CreatureWorker<Acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
TypeContainerVisitor<acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
TypeContainerVisitor<Acore::CreatureWorker<Acore::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
}
@@ -2828,7 +2828,7 @@ std::string const& Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const
void Creature::SetPosition(float x, float y, float z, float o)
{
if (!acore::IsValidMapCoord(x, y, z, o))
if (!Acore::IsValidMapCoord(x, y, z, o))
return;
GetMap()->CreatureRelocation(this, x, y, z, o);
@@ -262,8 +262,8 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z, bool run)
float dy = y + sin(followAngle + pathAngle) * followDist;
float dz = z;
acore::NormalizeMapCoord(dx);
acore::NormalizeMapCoord(dy);
Acore::NormalizeMapCoord(dx);
Acore::NormalizeMapCoord(dy);
member->UpdateGroundPositionZ(dx, dy, dz);
@@ -175,7 +175,7 @@ void GameObject::RemoveFromWorld()
WorldObject::RemoveFromWorld();
if (m_spawnId)
acore::Containers::MultimapErasePair(GetMap()->GetGameObjectBySpawnIdStore(), m_spawnId, this);
Acore::Containers::MultimapErasePair(GetMap()->GetGameObjectBySpawnIdStore(), m_spawnId, this);
GetMap()->GetObjectsStore().Remove<GameObject>(GetGUID());
}
}
@@ -459,7 +459,7 @@ void GameObject::Update(uint32 diff)
if (info->summoningRitual.casterTargetSpell && info->summoningRitual.casterTargetSpell != 1) // No idea why this field is a bool in some cases
for (uint32 i = 0; i < info->summoningRitual.casterTargetSpellTargets; i++)
// m_unique_users can contain only player GUIDs
if (Player* target = ObjectAccessor::GetPlayer(*this, acore::Containers::SelectRandomContainerElement(m_unique_users)))
if (Player* target = ObjectAccessor::GetPlayer(*this, Acore::Containers::SelectRandomContainerElement(m_unique_users)))
spellCaster->CastSpell(target, info->summoningRitual.casterTargetSpell, true);
// finish owners spell
@@ -608,8 +608,8 @@ void GameObject::Update(uint32 diff)
// search unfriendly creature
if (owner) // hunter trap
{
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
acore::UnitSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
Acore::UnitSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
VisitNearbyGridObject(radius, searcher);
if (!target)
VisitNearbyWorldObject(radius, searcher);
@@ -619,8 +619,8 @@ void GameObject::Update(uint32 diff)
// environmental damage spells already have around enemies targeting but this not help in case not existed GO casting support
// affect only players
Player* player = nullptr;
acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
Acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
VisitNearbyWorldObject(radius, searcher);
target = player;
}
@@ -1189,13 +1189,13 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
GameObject* trapGO = nullptr;
{
// using original GO distance
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
acore::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
Acore::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
TypeContainerVisitor<acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
TypeContainerVisitor<Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
cell.Visit(p, object_checker, *GetMap(), *target, range);
}
@@ -1209,12 +1209,12 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
{
GameObject* ok = nullptr;
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
acore::NearestGameObjectFishingHole u_check(*this, range);
acore::GameObjectSearcher<acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
Acore::NearestGameObjectFishingHole u_check(*this, range);
Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
TypeContainerVisitor<acore::GameObjectSearcher<acore::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
TypeContainerVisitor<Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
cell.Visit(p, grid_object_checker, *GetMap(), *this, range);
return ok;
@@ -1977,7 +1977,7 @@ void GameObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*s
dist += GetObjectSize();
if (includeMargin)
dist += VISIBILITY_COMPENSATION * 2.0f; // pussywizard: to ensure everyone receives all important packets
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
VisitNearbyWorldObject(dist, notifier);
}
@@ -2481,7 +2481,7 @@ void GameObject::SetPosition(float x, float y, float z, float o)
{
// pussywizard: do not call for MotionTransport and other gobjects not in grid
if (!acore::IsValidMapCoord(x, y, z, o))
if (!Acore::IsValidMapCoord(x, y, z, o))
return;
GetMap()->GameObjectRelocation(this, x, y, z, o);
+63 -63
View File
@@ -1410,8 +1410,8 @@ void WorldObject::GetRandomPoint(const Position& pos, float distance, float& ran
rand_y = pos.m_positionY + new_dist * sin(angle);
rand_z = pos.m_positionZ;
acore::NormalizeMapCoord(rand_x);
acore::NormalizeMapCoord(rand_y);
Acore::NormalizeMapCoord(rand_x);
Acore::NormalizeMapCoord(rand_y);
UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
}
@@ -1510,7 +1510,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, float* grou
bool Position::IsPositionValid() const
{
return acore::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
return Acore::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
}
float WorldObject::GetGridActivationRange() const
@@ -1900,7 +1900,7 @@ void Object::ForceValuesUpdateAtIndex(uint32 i)
AddToObjectUpdateIfNeeded();
}
namespace acore
namespace Acore
{
class MonsterChatBuilder
{
@@ -1948,61 +1948,61 @@ namespace acore
Language i_language;
WorldObject const* i_target;
};
} // namespace acore
} // namespace Acore
void WorldObject::MonsterSay(const char* text, uint32 language, WorldObject const* target)
{
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> say_do(say_build);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
}
void WorldObject::MonsterSay(int32 textId, uint32 language, WorldObject const* target)
{
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> say_do(say_build);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
}
void WorldObject::MonsterYell(const char* text, uint32 language, WorldObject const* target)
{
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> say_do(say_build);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
}
void WorldObject::MonsterYell(int32 textId, uint32 language, WorldObject const* target)
{
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> say_do(say_build);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
}
@@ -2016,15 +2016,15 @@ void WorldObject::MonsterTextEmote(const char* text, WorldObject const* target,
void WorldObject::MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote)
{
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
acore::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
Acore::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> say_do(say_build);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)));
}
@@ -2072,7 +2072,7 @@ void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*
dist += GetObjectSize();
if (includeMargin)
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
VisitNearbyWorldObject(dist, notifier);
}
@@ -2404,8 +2404,8 @@ void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
{
Creature* creature = nullptr;
acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
acore::CreatureLastSearcher<acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
Acore::CreatureLastSearcher<Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
VisitNearbyObject(range, searcher);
return creature;
}
@@ -2413,8 +2413,8 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
{
GameObject* go = nullptr;
acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
Acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
VisitNearbyGridObject(range, searcher);
return go;
}
@@ -2422,8 +2422,8 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float range) const
{
GameObject* go = nullptr;
acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
acore::GameObjectLastSearcher<acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
Acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
Acore::GameObjectLastSearcher<Acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
VisitNearbyGridObject(range, searcher);
return go;
}
@@ -2432,8 +2432,8 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
{
Player* target = nullptr;
acore::NearestPlayerInObjectRangeCheck checker(this, distance);
acore::PlayerLastSearcher<acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
Acore::NearestPlayerInObjectRangeCheck checker(this, distance);
Acore::PlayerLastSearcher<Acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
VisitNearbyObject(distance, searcher);
return target;
@@ -2441,32 +2441,32 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry, float maxSearchRange) const
{
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
Cell cell(pair);
cell.SetNoCreate();
acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
TypeContainerVisitor<acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
Acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
Acore::GameObjectListSearcher<Acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
TypeContainerVisitor<Acore::GameObjectListSearcher<Acore::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
}
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, uint32 entry, float maxSearchRange) const
{
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
Cell cell(pair);
cell.SetNoCreate();
acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
Acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
}
/*
namespace acore
namespace Acore
{
class NearUsedPosDo
{
@@ -2535,7 +2535,7 @@ namespace acore
float i_angle;
ObjectPosSelector& i_selector;
};
} // namespace acore
} // namespace Acore
*/
//===================================================================================================
@@ -2565,8 +2565,8 @@ void WorldObject::GetNearPoint2D(WorldObject const* searcher, float& x, float& y
x = GetPositionX() + (effectiveReach + distance2d) * std::cos(absAngle);
y = GetPositionY() + (effectiveReach + distance2d) * std::sin(absAngle);
acore::NormalizeMapCoord(x);
acore::NormalizeMapCoord(y);
Acore::NormalizeMapCoord(x);
Acore::NormalizeMapCoord(y);
}
void WorldObject::GetNearPoint2D(float& x, float& y, float distance2d, float absAngle) const
@@ -2702,7 +2702,7 @@ void WorldObject::MovePosition(Position& pos, float dist, float angle)
desty = pos.m_positionY + dist * sin(angle);
// Prevent invalid coordinates here, position is unchanged
if (!acore::IsValidMapCoord(destx, desty))
if (!Acore::IsValidMapCoord(destx, desty))
{
LOG_FATAL("server", "WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
return;
@@ -2733,8 +2733,8 @@ void WorldObject::MovePosition(Position& pos, float dist, float angle)
}
}
acore::NormalizeMapCoord(pos.m_positionX);
acore::NormalizeMapCoord(pos.m_positionY);
Acore::NormalizeMapCoord(pos.m_positionX);
Acore::NormalizeMapCoord(pos.m_positionY);
UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
pos.m_orientation = m_orientation;
}
@@ -2841,8 +2841,8 @@ void WorldObject::DestroyForNearbyPlayers()
return;
std::list<Player*> targets;
acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange() + VISIBILITY_COMPENSATION, false);
acore::PlayerListSearcherWithSharedVision<acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
Acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange() + VISIBILITY_COMPENSATION, false);
Acore::PlayerListSearcherWithSharedVision<Acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
VisitNearbyWorldObject(GetVisibilityRange() + VISIBILITY_COMPENSATION, searcher);
for (std::list<Player*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
@@ -2865,7 +2865,7 @@ void WorldObject::DestroyForNearbyPlayers()
void WorldObject::UpdateObjectVisibility(bool /*forced*/, bool /*fromUpdate*/)
{
//updates object's visibility for nearby players
acore::VisibleChangesNotifier notifier(*this);
Acore::VisibleChangesNotifier notifier(*this);
VisitNearbyWorldObject(GetVisibilityRange() + VISIBILITY_COMPENSATION, notifier);
}
@@ -2970,7 +2970,7 @@ struct WorldObjectChangeAccumulator
void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set)
{
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
WorldObjectChangeAccumulator notifier(*this, data_map, player_set);
@@ -2984,17 +2984,17 @@ void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& play
void WorldObject::GetCreaturesWithEntryInRange(std::list<Creature*>& creatureList, float radius, uint32 entry)
{
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
Cell cell(pair);
cell.SetNoCreate();
acore::AllCreaturesOfEntryInRange check(this, entry, radius);
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
Acore::AllCreaturesOfEntryInRange check(this, entry, radius);
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
cell.Visit(pair, world_visitor, *(this->GetMap()), *this, radius);
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
cell.Visit(pair, grid_visitor, *(this->GetMap()), *this, radius);
}
+1 -1
View File
@@ -1095,7 +1095,7 @@ private:
bool CanDetectStealthOf(WorldObject const* obj, bool checkAlert = false) const;
};
namespace acore
namespace Acore
{
// Binary predicate to sort WorldObjects based on the distance to a reference WorldObject
class ObjectDistanceOrderPred
+15 -15
View File
@@ -517,7 +517,7 @@ inline void KillRewarder::_InitGroupData()
}
// 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance,
// for whom victim is not gray;
uint32 grayLevel = acore::XP::GetGrayLevel(lvl);
uint32 grayLevel = Acore::XP::GetGrayLevel(lvl);
if (_victim->getLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->getLevel() < lvl))
{
_maxNotGrayMember = member;
@@ -542,7 +542,7 @@ inline void KillRewarder::_InitXP(Player* player)
// * otherwise, not in PvP;
// * not if killer is on vehicle.
if (_victim && (_isBattleGround || (!_isPvP && !_killer->GetVehicle())))
_xp = acore::XP::Gain(player, _victim, _isBattleGround);
_xp = Acore::XP::Gain(player, _victim, _isBattleGround);
if (_xp && !_isBattleGround && _victim) // pussywizard: npcs with relatively low hp give lower exp
if (_victim->GetTypeId() == TYPEID_UNIT)
@@ -658,7 +658,7 @@ void KillRewarder::_RewardGroup()
{
// 3.1.2. Alter group rate if group is in raid (not for battlegrounds).
const bool isRaid = !_isPvP && sMapStore.LookupEntry(_killer->GetMapId())->IsRaid() && _group->isRaidGroup();
_groupRate = acore::XP::xp_in_group_rate(_count, isRaid);
_groupRate = Acore::XP::xp_in_group_rate(_count, isRaid);
}
// 3.1.3. Reward each group member (even dead or corpse) within reward distance.
@@ -6564,7 +6564,7 @@ void Player::UpdateWeaponSkill(Unit* victim, WeaponAttackType attType)
void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence)
{
uint8 plevel = getLevel(); // if defense than victim == attacker
uint8 greylevel = acore::XP::GetGrayLevel(plevel);
uint8 greylevel = Acore::XP::GetGrayLevel(plevel);
uint8 moblevel = victim->getLevelForTarget(this);
/*if (moblevel < greylevel)
return;*/ // Patch 3.0.8 (2009-01-20): You can no longer skill up weapons on mobs that are immune to damage.
@@ -7065,7 +7065,7 @@ void Player::SendMessageToSetInRange(WorldPacket* data, float dist, bool self, b
dist += GetObjectSize();
if (includeMargin)
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
VisitNearbyWorldObject(dist, notifier);
}
@@ -7075,7 +7075,7 @@ void Player::SendMessageToSetInRange_OwnTeam(WorldPacket* data, float dist, bool
if (self)
GetSession()->SendPacket(data);
acore::MessageDistDeliverer notifier(this, data, dist, true);
Acore::MessageDistDeliverer notifier(this, data, dist, true);
VisitNearbyWorldObject(dist, notifier);
}
@@ -7258,7 +7258,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr
break;
}
if (rate != 1.0f && creatureOrQuestLevel <= acore::XP::GetGrayLevel(getLevel()))
if (rate != 1.0f && creatureOrQuestLevel <= Acore::XP::GetGrayLevel(getLevel()))
percent *= rate;
if (percent <= 0.0f)
@@ -7498,7 +7498,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
return false;
uint8 k_level = getLevel();
uint8 k_grey = acore::XP::GetGrayLevel(k_level);
uint8 k_grey = Acore::XP::GetGrayLevel(k_level);
uint8 v_level = victim->getLevel();
if (v_level <= k_grey)
@@ -7527,7 +7527,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
else
victim_guid.Clear(); // Don't show HK: <rank> message, only log.
honor_f = ceil(acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
honor_f = ceil(Acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
// count the number of playerkills in one day
ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true);
@@ -18335,7 +18335,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, SQLQueryHolder* holder)
m_movementInfo.transport.pos.Relocate(x, y, z, o);
m_transport->CalculatePassengerPosition(x, y, z, &o);
if (!acore::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
if (!Acore::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
{
m_transport = nullptr;
m_movementInfo.transport.Reset();
@@ -21526,8 +21526,8 @@ void Player::TextEmote(const std::string& text)
WorldPacket data;
std::list<Player*> players;
acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
acore::PlayerListSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
Acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
this->VisitNearbyWorldObject(sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), searcher);
for (auto const& itr : players)
@@ -23680,10 +23680,10 @@ void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
void Player::UpdateVisibilityForPlayer(bool mapChange)
{
acore::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
Acore::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
m_seer->VisitNearbyObject(GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS, notifierNoLarge);
notifierNoLarge.SendToSelf();
acore::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
Acore::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
m_seer->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, notifierLarge);
notifierLarge.SendToSelf();
@@ -24753,7 +24753,7 @@ uint32 Player::GetResurrectionSpellId()
bool Player::isHonorOrXPTarget(Unit* victim) const
{
uint8 v_level = victim->getLevel();
uint8 k_grey = acore::XP::GetGrayLevel(getLevel());
uint8 k_grey = Acore::XP::GetGrayLevel(getLevel());
// Victim level less gray level
if (v_level <= k_grey)
@@ -609,7 +609,7 @@ void MotionTransport::UpdatePassengerPositions(PassengerSet& passengers)
CalculatePassengerPosition(x, y, z, &o);
// check if position is valid
if (!acore::IsValidMapCoord(x, y, z))
if (!Acore::IsValidMapCoord(x, y, z))
continue;
switch (passenger->GetTypeId())
@@ -875,7 +875,7 @@ void StaticTransport::RelocateToProgress(uint32 progress)
float oriRotAngle = oriRotAngleCurr + percRot * (oriRotAngleNext - oriRotAngleCurr);
// check if position is valid
if (!acore::IsValidMapCoord(pos.x, pos.y, pos.z))
if (!Acore::IsValidMapCoord(pos.x, pos.y, pos.z))
return;
// update position to new one
@@ -910,7 +910,7 @@ void StaticTransport::UpdatePassengerPositions()
CalculatePassengerPosition(x, y, z, &o);
// check if position is valid
if (!acore::IsValidMapCoord(x, y, z))
if (!Acore::IsValidMapCoord(x, y, z))
continue;
switch (passenger->GetTypeId())
+16 -16
View File
@@ -1893,7 +1893,7 @@ void Unit::CalcAbsorbResist(Unit* attacker, Unit* victim, SpellSchoolMask school
// We're going to call functions which can modify content of the list during iteration over it's elements
// Let's copy the list so we can prevent iterator invalidation
AuraEffectList vSchoolAbsorbCopy(victim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB));
vSchoolAbsorbCopy.sort(acore::AbsorbAuraOrderPred());
vSchoolAbsorbCopy.sort(Acore::AbsorbAuraOrderPred());
// absorb without mana cost
for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
@@ -16294,8 +16294,8 @@ void Unit::UpdateReactives(uint32 p_time)
Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
{
std::list<Unit*> targets;
acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
acore::UnitListSearcher<acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
VisitNearbyObject(dist, searcher);
// remove current target
@@ -16323,14 +16323,14 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
return nullptr;
// select random
return acore::Containers::SelectRandomContainerElement(targets);
return Acore::Containers::SelectRandomContainerElement(targets);
}
Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
{
std::list<Unit*> targets;
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
acore::UnitListSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
Acore::UnitListSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
VisitNearbyObject(dist, searcher);
// remove current target
@@ -16358,7 +16358,7 @@ Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
return nullptr;
// select random
return acore::Containers::SelectRandomContainerElement(targets);
return Acore::Containers::SelectRandomContainerElement(targets);
}
void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
@@ -16893,7 +16893,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura)
if (!nearMembers.empty())
{
nearMembers.sort(acore::HealthPctOrderPred());
nearMembers.sort(Acore::HealthPctOrderPred());
if (Unit* target = nearMembers.front())
{
CastSpell(target, 41637 /*Dummy visual effect triggered by main spell cast*/, true);
@@ -18369,7 +18369,7 @@ void Unit::UpdateObjectVisibility(bool forced, bool /*fromUpdate*/)
// pussywizard: generally this is not needed here, delayed notifier will handle this, call only for pets
if ((IsGuardian() || IsPet()) && GetOwnerGUID().IsPlayer())
{
acore::AIRelocationNotifier notifier(*this);
Acore::AIRelocationNotifier notifier(*this);
float radius = 60.0f;
VisitNearbyObject(radius, notifier);
}
@@ -19220,7 +19220,7 @@ void Unit::SendTeleportPacket(Position& pos)
bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport)
{
if (!acore::IsValidMapCoord(x, y, z, orientation))
if (!Acore::IsValidMapCoord(x, y, z, orientation))
return false;
float old_orientation = GetOrientation();
@@ -19743,10 +19743,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
//active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
}
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
viewPoint->VisitNearbyObject(player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
relocateNoLarge.SendToSelf();
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
relocateLarge.SendToSelf();
}
@@ -19777,10 +19777,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
}
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
viewPoint->VisitNearbyObject(player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
relocateNoLarge.SendToSelf();
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
relocateLarge.SendToSelf();
@@ -19801,7 +19801,7 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
unit->m_last_notify_position.Relocate(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
acore::CreatureRelocationNotifier relocate(*unit);
Acore::CreatureRelocationNotifier relocate(*unit);
unit->VisitNearbyObject(unit->GetVisibilityRange() + VISIBILITY_COMPENSATION, relocate);
this->AddToNotify(NOTIFY_AI_RELOCATION);
@@ -19814,7 +19814,7 @@ void Unit::ExecuteDelayedUnitAINotifyEvent()
if (!this->IsInWorld() || this->IsDuringRemoveFromWorld())
return;
acore::AIRelocationNotifier notifier(*this);
Acore::AIRelocationNotifier notifier(*this);
float radius = 60.0f;
this->VisitNearbyObject(radius, notifier);
}
+1 -1
View File
@@ -2627,7 +2627,7 @@ private:
float processDummyAuras(float TakenTotalMod) const;
};
namespace acore
namespace Acore
{
// Binary predicate for sorting Units based on percent value of a power
class PowerPctOrderPred
+7 -7
View File
@@ -1985,7 +1985,7 @@ void ObjectMgr::AddCreatureToGrid(ObjectGuid::LowType guid, CreatureData const*
{
if (mask & 1)
{
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
cell_guids.creatures.insert(guid);
}
@@ -1999,7 +1999,7 @@ void ObjectMgr::RemoveCreatureFromGrid(ObjectGuid::LowType guid, CreatureData co
{
if (mask & 1)
{
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
cell_guids.creatures.erase(guid);
}
@@ -2286,7 +2286,7 @@ void ObjectMgr::AddGameobjectToGrid(ObjectGuid::LowType guid, GameObjectData con
{
if (mask & 1)
{
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
cell_guids.gameobjects.insert(guid);
}
@@ -2300,7 +2300,7 @@ void ObjectMgr::RemoveGameobjectFromGrid(ObjectGuid::LowType guid, GameObjectDat
{
if (mask & 1)
{
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
cell_guids.gameobjects.erase(guid);
}
@@ -4833,7 +4833,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
continue;
}
if (!acore::IsValidMapCoord(tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation))
if (!Acore::IsValidMapCoord(tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation))
{
LOG_ERROR("sql.sql", "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
tableName.c_str(), tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation, tmp.id);
@@ -4931,7 +4931,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
case SCRIPT_COMMAND_TEMP_SUMMON_CREATURE:
{
if (!acore::IsValidMapCoord(tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation))
if (!Acore::IsValidMapCoord(tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation))
{
LOG_ERROR("sql.sql", "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
tableName.c_str(), tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation, tmp.id);
@@ -7221,7 +7221,7 @@ void ObjectMgr::LoadPointsOfInterest()
POI.Importance = fields[5].GetUInt32();
POI.Name = fields[6].GetString();
if (!acore::IsValidMapCoord(POI.PositionX, POI.PositionY))
if (!Acore::IsValidMapCoord(POI.PositionX, POI.PositionY))
{
LOG_ERROR("sql.sql", "Table `points_of_interest` (ID: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.PositionX, POI.PositionY);
continue;
+4 -4
View File
@@ -24,7 +24,7 @@ inline Cell::Cell(CellCoord const& p)
inline Cell::Cell(float x, float y)
{
CellCoord p = acore::ComputeCellCoord(x, y);
CellCoord p = Acore::ComputeCellCoord(x, y);
data.Part.grid_x = p.x_coord / MAX_NUMBER_OF_CELLS;
data.Part.grid_y = p.y_coord / MAX_NUMBER_OF_CELLS;
data.Part.cell_x = p.x_coord % MAX_NUMBER_OF_CELLS;
@@ -37,12 +37,12 @@ inline CellArea Cell::CalculateCellArea(float x, float y, float radius)
{
if (radius <= 0.0f)
{
CellCoord center = acore::ComputeCellCoord(x, y).normalize();
CellCoord center = Acore::ComputeCellCoord(x, y).normalize();
return CellArea(center, center);
}
CellCoord centerX = acore::ComputeCellCoord(x - radius, y - radius).normalize();
CellCoord centerY = acore::ComputeCellCoord(x + radius, y + radius).normalize();
CellCoord centerX = Acore::ComputeCellCoord(x - radius, y - radius).normalize();
CellCoord centerY = Acore::ComputeCellCoord(x + radius, y + radius).normalize();
return CellArea(centerX, centerY);
}
+1 -1
View File
@@ -158,7 +158,7 @@ bool operator!=(const CoordPair<LIMIT>& p1, const CoordPair<LIMIT>& p2)
typedef CoordPair<MAX_NUMBER_OF_GRIDS> GridCoord;
typedef CoordPair<TOTAL_NUMBER_OF_CELLS_PER_MAP> CellCoord;
namespace acore
namespace Acore
{
template<class RET_TYPE, int CENTER_VAL>
inline RET_TYPE Compute(float x, float y, float center_offset, float size)
@@ -16,7 +16,7 @@
#include "WorldPacket.h"
#include "WorldSession.h"
using namespace acore;
using namespace Acore;
void VisibleNotifier::Visit(GameObjectMapType& m)
{
@@ -23,7 +23,7 @@
class Player;
//class Map;
namespace acore
namespace Acore
{
struct VisibleNotifier
{
@@ -17,7 +17,7 @@
#include "WorldPacket.h"
template<class T>
inline void acore::VisibleNotifier::Visit(GridRefManager<T>& m)
inline void Acore::VisibleNotifier::Visit(GridRefManager<T>& m)
{
// Xinef: Update gameobjects only
if (i_gobjOnly)
@@ -37,7 +37,7 @@ inline void acore::VisibleNotifier::Visit(GridRefManager<T>& m)
// WorldObject searchers & workers
template<class Check>
void acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType& m)
void Acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
return;
@@ -60,7 +60,7 @@ void acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType& m)
}
template<class Check>
void acore::WorldObjectSearcher<Check>::Visit(PlayerMapType& m)
void Acore::WorldObjectSearcher<Check>::Visit(PlayerMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
return;
@@ -83,7 +83,7 @@ void acore::WorldObjectSearcher<Check>::Visit(PlayerMapType& m)
}
template<class Check>
void acore::WorldObjectSearcher<Check>::Visit(CreatureMapType& m)
void Acore::WorldObjectSearcher<Check>::Visit(CreatureMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
return;
@@ -106,7 +106,7 @@ void acore::WorldObjectSearcher<Check>::Visit(CreatureMapType& m)
}
template<class Check>
void acore::WorldObjectSearcher<Check>::Visit(CorpseMapType& m)
void Acore::WorldObjectSearcher<Check>::Visit(CorpseMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
return;
@@ -129,7 +129,7 @@ void acore::WorldObjectSearcher<Check>::Visit(CorpseMapType& m)
}
template<class Check>
void acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType& m)
void Acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
return;
@@ -152,7 +152,7 @@ void acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType& m)
}
template<class Check>
void acore::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
void Acore::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
return;
@@ -168,7 +168,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
}
template<class Check>
void acore::WorldObjectLastSearcher<Check>::Visit(PlayerMapType& m)
void Acore::WorldObjectLastSearcher<Check>::Visit(PlayerMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
return;
@@ -184,7 +184,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(PlayerMapType& m)
}
template<class Check>
void acore::WorldObjectLastSearcher<Check>::Visit(CreatureMapType& m)
void Acore::WorldObjectLastSearcher<Check>::Visit(CreatureMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
return;
@@ -200,7 +200,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(CreatureMapType& m)
}
template<class Check>
void acore::WorldObjectLastSearcher<Check>::Visit(CorpseMapType& m)
void Acore::WorldObjectLastSearcher<Check>::Visit(CorpseMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
return;
@@ -216,7 +216,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(CorpseMapType& m)
}
template<class Check>
void acore::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType& m)
void Acore::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
return;
@@ -232,7 +232,7 @@ void acore::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType& m)
}
template<class Check>
void acore::WorldObjectListSearcher<Check>::Visit(PlayerMapType& m)
void Acore::WorldObjectListSearcher<Check>::Visit(PlayerMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
return;
@@ -243,7 +243,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(PlayerMapType& m)
}
template<class Check>
void acore::WorldObjectListSearcher<Check>::Visit(CreatureMapType& m)
void Acore::WorldObjectListSearcher<Check>::Visit(CreatureMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
return;
@@ -254,7 +254,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(CreatureMapType& m)
}
template<class Check>
void acore::WorldObjectListSearcher<Check>::Visit(CorpseMapType& m)
void Acore::WorldObjectListSearcher<Check>::Visit(CorpseMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
return;
@@ -265,7 +265,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(CorpseMapType& m)
}
template<class Check>
void acore::WorldObjectListSearcher<Check>::Visit(GameObjectMapType& m)
void Acore::WorldObjectListSearcher<Check>::Visit(GameObjectMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
return;
@@ -276,7 +276,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(GameObjectMapType& m)
}
template<class Check>
void acore::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType& m)
void Acore::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType& m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
return;
@@ -289,7 +289,7 @@ void acore::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType& m)
// Gameobject searchers
template<class Check>
void acore::GameObjectSearcher<Check>::Visit(GameObjectMapType& m)
void Acore::GameObjectSearcher<Check>::Visit(GameObjectMapType& m)
{
// already found
if (i_object)
@@ -309,7 +309,7 @@ void acore::GameObjectSearcher<Check>::Visit(GameObjectMapType& m)
}
template<class Check>
void acore::GameObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
void Acore::GameObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
{
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
@@ -322,7 +322,7 @@ void acore::GameObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
}
template<class Check>
void acore::GameObjectListSearcher<Check>::Visit(GameObjectMapType& m)
void Acore::GameObjectListSearcher<Check>::Visit(GameObjectMapType& m)
{
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
if (itr->GetSource()->InSamePhase(i_phaseMask))
@@ -333,7 +333,7 @@ void acore::GameObjectListSearcher<Check>::Visit(GameObjectMapType& m)
// Unit searchers
template<class Check>
void acore::UnitSearcher<Check>::Visit(CreatureMapType& m)
void Acore::UnitSearcher<Check>::Visit(CreatureMapType& m)
{
// already found
if (i_object)
@@ -353,7 +353,7 @@ void acore::UnitSearcher<Check>::Visit(CreatureMapType& m)
}
template<class Check>
void acore::UnitSearcher<Check>::Visit(PlayerMapType& m)
void Acore::UnitSearcher<Check>::Visit(PlayerMapType& m)
{
// already found
if (i_object)
@@ -373,7 +373,7 @@ void acore::UnitSearcher<Check>::Visit(PlayerMapType& m)
}
template<class Check>
void acore::UnitLastSearcher<Check>::Visit(CreatureMapType& m)
void Acore::UnitLastSearcher<Check>::Visit(CreatureMapType& m)
{
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
@@ -386,7 +386,7 @@ void acore::UnitLastSearcher<Check>::Visit(CreatureMapType& m)
}
template<class Check>
void acore::UnitLastSearcher<Check>::Visit(PlayerMapType& m)
void Acore::UnitLastSearcher<Check>::Visit(PlayerMapType& m)
{
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
@@ -399,7 +399,7 @@ void acore::UnitLastSearcher<Check>::Visit(PlayerMapType& m)
}
template<class Check>
void acore::UnitListSearcher<Check>::Visit(PlayerMapType& m)
void Acore::UnitListSearcher<Check>::Visit(PlayerMapType& m)
{
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
if (itr->GetSource()->InSamePhase(i_phaseMask))
@@ -408,7 +408,7 @@ void acore::UnitListSearcher<Check>::Visit(PlayerMapType& m)
}
template<class Check>
void acore::UnitListSearcher<Check>::Visit(CreatureMapType& m)
void Acore::UnitListSearcher<Check>::Visit(CreatureMapType& m)
{
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
if (itr->GetSource()->InSamePhase(i_phaseMask))
@@ -419,7 +419,7 @@ void acore::UnitListSearcher<Check>::Visit(CreatureMapType& m)
// Creature searchers
template<class Check>
void acore::CreatureSearcher<Check>::Visit(CreatureMapType& m)
void Acore::CreatureSearcher<Check>::Visit(CreatureMapType& m)
{
// already found
if (i_object)
@@ -439,7 +439,7 @@ void acore::CreatureSearcher<Check>::Visit(CreatureMapType& m)
}
template<class Check>
void acore::CreatureLastSearcher<Check>::Visit(CreatureMapType& m)
void Acore::CreatureLastSearcher<Check>::Visit(CreatureMapType& m)
{
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
@@ -452,7 +452,7 @@ void acore::CreatureLastSearcher<Check>::Visit(CreatureMapType& m)
}
template<class Check>
void acore::CreatureListSearcher<Check>::Visit(CreatureMapType& m)
void Acore::CreatureListSearcher<Check>::Visit(CreatureMapType& m)
{
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
if (itr->GetSource()->InSamePhase(i_phaseMask))
@@ -461,7 +461,7 @@ void acore::CreatureListSearcher<Check>::Visit(CreatureMapType& m)
}
template<class Check>
void acore::PlayerListSearcher<Check>::Visit(PlayerMapType& m)
void Acore::PlayerListSearcher<Check>::Visit(PlayerMapType& m)
{
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
if (itr->GetSource()->InSamePhase(i_phaseMask))
@@ -470,7 +470,7 @@ void acore::PlayerListSearcher<Check>::Visit(PlayerMapType& m)
}
template<class Check>
void acore::PlayerListSearcherWithSharedVision<Check>::Visit(PlayerMapType& m)
void Acore::PlayerListSearcherWithSharedVision<Check>::Visit(PlayerMapType& m)
{
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
if (itr->GetSource()->InSamePhase(i_phaseMask))
@@ -479,7 +479,7 @@ void acore::PlayerListSearcherWithSharedVision<Check>::Visit(PlayerMapType& m)
}
template<class Check>
void acore::PlayerListSearcherWithSharedVision<Check>::Visit(CreatureMapType& m)
void Acore::PlayerListSearcherWithSharedVision<Check>::Visit(CreatureMapType& m)
{
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
if (itr->GetSource()->InSamePhase(i_phaseMask) && itr->GetSource()->HasSharedVision())
@@ -489,7 +489,7 @@ void acore::PlayerListSearcherWithSharedVision<Check>::Visit(CreatureMapType& m)
}
template<class Check>
void acore::PlayerSearcher<Check>::Visit(PlayerMapType& m)
void Acore::PlayerSearcher<Check>::Visit(PlayerMapType& m)
{
// already found
if (i_object)
@@ -509,7 +509,7 @@ void acore::PlayerSearcher<Check>::Visit(PlayerMapType& m)
}
template<class Check>
void acore::PlayerLastSearcher<Check>::Visit(PlayerMapType& m)
void Acore::PlayerLastSearcher<Check>::Visit(PlayerMapType& m)
{
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
@@ -522,7 +522,7 @@ void acore::PlayerLastSearcher<Check>::Visit(PlayerMapType& m)
}
template<class Builder>
void acore::LocalizedPacketDo<Builder>::operator()(Player* p)
void Acore::LocalizedPacketDo<Builder>::operator()(Player* p)
{
LocaleConstant loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
uint32 cache_idx = loc_idx + 1;
@@ -547,7 +547,7 @@ void acore::LocalizedPacketDo<Builder>::operator()(Player* p)
}
template<class Builder>
void acore::LocalizedPacketListDo<Builder>::operator()(Player* p)
void Acore::LocalizedPacketListDo<Builder>::operator()(Player* p)
{
LocaleConstant loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
uint32 cache_idx = loc_idx + 1;
+2 -2
View File
@@ -1740,7 +1740,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount)
CharacterDatabase.CommitTransaction(trans);
std::string aux = acore::Impl::ByteArrayToHexStr(reinterpret_cast<uint8*>(&m_bankMoney), 8, true);
std::string aux = Acore::Impl::ByteArrayToHexStr(reinterpret_cast<uint8*>(&m_bankMoney), 8, true);
_BroadcastEvent(GE_BANK_MONEY_SET, ObjectGuid::Empty, aux.c_str());
if (amount > 10 * GOLD)
@@ -1791,7 +1791,7 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool
CharacterDatabase.PExecute("INSERT INTO log_money VALUES(%u, %u, \"%s\", \"%s\", %u, \"%s\", %u, \"<GB WITHDRAW> %s (guild id: %u, members: %u, new amount: %u, leader guid low: %u, char level: %u)\", NOW())",
session->GetAccountId(), player->GetGUID().GetCounter(), player->GetName().c_str(), session->GetRemoteAddress().c_str(), 0, "", amount, GetName().c_str(), GetId(), GetMemberCount(), GetTotalBankMoney(), GetLeaderGUID().GetCounter(), player->getLevel());
std::string aux = acore::Impl::ByteArrayToHexStr(reinterpret_cast<uint8*>(&m_bankMoney), 8, true);
std::string aux = Acore::Impl::ByteArrayToHexStr(reinterpret_cast<uint8*>(&m_bankMoney), 8, true);
_BroadcastEvent(GE_BANK_MONEY_SET, ObjectGuid::Empty, aux.c_str());
return true;
}
+7 -7
View File
@@ -693,7 +693,7 @@ void WorldSession::HandleEmoteOpcode(WorldPacket& recvData)
GetPlayer()->HandleEmoteCommand(emote);
}
namespace acore
namespace Acore
{
class EmoteChatBuilder
{
@@ -723,7 +723,7 @@ namespace acore
uint32 i_emote_num;
Unit const* i_target;
};
} // namespace acore
} // namespace Acore
void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
{
@@ -774,15 +774,15 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
CellCoord p = acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
CellCoord p = Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
Cell cell(p);
cell.SetNoCreate();
acore::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit);
acore::LocalizedPacketDo<acore::EmoteChatBuilder > emote_do(emote_builder);
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::EmoteChatBuilder > > emote_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do);
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::EmoteChatBuilder> >, WorldTypeMapContainer> message(emote_worker);
Acore::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit);
Acore::LocalizedPacketDo<Acore::EmoteChatBuilder > emote_do(emote_builder);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::EmoteChatBuilder > > emote_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do);
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::EmoteChatBuilder> >, WorldTypeMapContainer> message(emote_worker);
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit);
+3 -3
View File
@@ -120,7 +120,7 @@ void WorldSession::HandleMoveWorldportAck()
if (!_player->getHostileRefManager().isEmpty())
_player->getHostileRefManager().deleteReferences(); // pussywizard: multithreading crashfix
CellCoord pair(acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
CellCoord pair(Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
Cell cell(pair);
if (!GridCoord(cell.GridX(), cell.GridY()).IsCoordValid())
{
@@ -168,7 +168,7 @@ void WorldSession::HandleMoveWorldportAck()
}
// xinef: do this again, player can be teleported inside bg->AddPlayer(_player)!!!!
CellCoord pair2(acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
CellCoord pair2(Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
Cell cell2(pair2);
if (!GridCoord(cell2.GridX(), cell2.GridY()).IsCoordValid())
{
@@ -408,7 +408,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
return;
}
if (!acore::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.transport.pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.transport.pos.GetPositionY(),
if (!Acore::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.transport.pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.transport.pos.GetPositionY(),
movementInfo.pos.GetPositionZ() + movementInfo.transport.pos.GetPositionZ(), movementInfo.pos.GetOrientation() + movementInfo.transport.pos.GetOrientation()))
{
if (plrMover)
+2 -2
View File
@@ -42,7 +42,7 @@ LootStore LootTemplates_Skinning("skinning_loot_template", "creature s
LootStore LootTemplates_Spell("spell_loot_template", "spell id (random item creating)", false);
// Selects invalid loot items to be removed from group possible entries (before rolling)
struct LootGroupInvalidSelector : public acore::unary_function<LootStoreItem*, bool>
struct LootGroupInvalidSelector : public Acore::unary_function<LootStoreItem*, bool>
{
explicit LootGroupInvalidSelector(Loot const& loot, uint16 lootMode) : _loot(loot), _lootMode(lootMode) { }
@@ -1219,7 +1219,7 @@ LootStoreItem const* LootTemplate::LootGroup::Roll(Loot& loot, Player const* pla
possibleLoot = EqualChanced;
possibleLoot.remove_if(LootGroupInvalidSelector(loot, lootMode));
if (!possibleLoot.empty()) // If nothing selected yet - an item is taken from equal-chanced part
return acore::Containers::SelectRandomContainerElement(possibleLoot);
return Acore::Containers::SelectRandomContainerElement(possibleLoot);
return nullptr; // Empty drop from the group
}
+25 -25
View File
@@ -330,7 +330,7 @@ template<>
void Map::SwitchGridContainers(Creature* obj, bool on)
{
ASSERT(!obj->IsPermanentWorldObject());
CellCoord p = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
CellCoord p = Acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
if (!p.IsCoordValid())
{
LOG_ERROR("server", "Map::SwitchGridContainers: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]",
@@ -370,7 +370,7 @@ template<>
void Map::SwitchGridContainers(GameObject* obj, bool on)
{
ASSERT(!obj->IsPermanentWorldObject());
CellCoord p = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
CellCoord p = Acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
if (!p.IsCoordValid())
{
LOG_ERROR("server", "Map::SwitchGridContainers: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]",
@@ -494,7 +494,7 @@ void Map::LoadAllCells()
bool Map::AddPlayerToMap(Player* player)
{
CellCoord cellCoord = acore::ComputeCellCoord(player->GetPositionX(), player->GetPositionY());
CellCoord cellCoord = Acore::ComputeCellCoord(player->GetPositionX(), player->GetPositionY());
if (!cellCoord.IsCoordValid())
{
LOG_ERROR("server", "Map::Add: Player (%s) has invalid coordinates X:%f Y:%f grid cell [%u:%u]",
@@ -553,7 +553,7 @@ bool Map::AddToMap(T* obj, bool checkTransport)
return true;
}
CellCoord cellCoord = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
CellCoord cellCoord = Acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
//It will create many problems (including crashes) if an object is not added to grid after creation
//The correct way to fix it is to make AddToMap return false and delete the object if it is not added to grid
//But now AddToMap is used in too many places, I will just see how many ASSERT failures it will cause
@@ -606,7 +606,7 @@ bool Map::AddToMap(MotionTransport* obj, bool /*checkTransport*/)
if (obj->IsInWorld())
return true;
CellCoord cellCoord = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
CellCoord cellCoord = Acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
if (!cellCoord.IsCoordValid())
{
LOG_ERROR("server", "Map::Add: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]",
@@ -649,10 +649,10 @@ bool Map::IsGridLoaded(const GridCoord& p) const
return (getNGrid(p.x_coord, p.y_coord) && isGridObjectDataLoaded(p.x_coord, p.y_coord));
}
void Map::VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer>& gridVisitor,
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer>& worldVisitor,
TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer>& largeGridVisitor,
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer>& largeWorldVisitor)
void Map::VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer>& gridVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer>& worldVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer>& largeGridVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer>& largeWorldVisitor)
{
// check for valid position
if (!player->IsPositionValid())
@@ -684,10 +684,10 @@ void Map::VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor<acore::O
}
}
void Map::VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer>& gridVisitor,
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer>& worldVisitor,
TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer>& largeGridVisitor,
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer>& largeWorldVisitor)
void Map::VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer>& gridVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer>& worldVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer>& largeGridVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer>& largeWorldVisitor)
{
// Check for valid position
if (!obj->IsPositionValid())
@@ -766,17 +766,17 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
resetMarkedCells();
resetMarkedCellsLarge();
acore::ObjectUpdater updater(t_diff, false);
Acore::ObjectUpdater updater(t_diff, false);
// for creature
TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer > grid_object_update(updater);
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer > grid_object_update(updater);
// for pets
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater);
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater);
// for large creatures
acore::ObjectUpdater largeObjectUpdater(t_diff, true);
TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer > grid_large_object_update(largeObjectUpdater);
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer > world_large_object_update(largeObjectUpdater);
Acore::ObjectUpdater largeObjectUpdater(t_diff, true);
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer > grid_large_object_update(largeObjectUpdater);
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer > world_large_object_update(largeObjectUpdater);
// pussywizard: container for far creatures in combat with players
std::vector<Creature*> updateList;
@@ -2347,18 +2347,18 @@ char const* Map::GetMapName() const
void Map::UpdateObjectVisibility(WorldObject* obj, Cell cell, CellCoord cellpair)
{
cell.SetNoCreate();
acore::VisibleChangesNotifier notifier(*obj);
TypeContainerVisitor<acore::VisibleChangesNotifier, WorldTypeMapContainer > player_notifier(notifier);
Acore::VisibleChangesNotifier notifier(*obj);
TypeContainerVisitor<Acore::VisibleChangesNotifier, WorldTypeMapContainer > player_notifier(notifier);
cell.Visit(cellpair, player_notifier, *this, *obj, obj->GetVisibilityRange());
}
void Map::UpdateObjectsVisibilityFor(Player* player, Cell cell, CellCoord cellpair)
{
acore::VisibleNotifier notifier(*player, false, false);
Acore::VisibleNotifier notifier(*player, false, false);
cell.SetNoCreate();
TypeContainerVisitor<acore::VisibleNotifier, WorldTypeMapContainer > world_notifier(notifier);
TypeContainerVisitor<acore::VisibleNotifier, GridTypeMapContainer > grid_notifier(notifier);
TypeContainerVisitor<Acore::VisibleNotifier, WorldTypeMapContainer > world_notifier(notifier);
TypeContainerVisitor<Acore::VisibleNotifier, GridTypeMapContainer > grid_notifier(notifier);
cell.Visit(cellpair, world_notifier, *this, *player->m_seer, player->GetSightRange());
cell.Visit(cellpair, grid_notifier, *this, *player->m_seer, player->GetSightRange());
@@ -3715,7 +3715,7 @@ bool Map::CanReachPositionAndGetValidCoords(const WorldObject* source, float sta
bool Map::CheckCollisionAndGetValidCoords(const WorldObject* source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision) const
{
// Prevent invalid coordinates here, position is unchanged
if (!acore::IsValidMapCoord(startX, startY, startZ) || !acore::IsValidMapCoord(destX, destY, destZ))
if (!Acore::IsValidMapCoord(startX, startY, startZ) || !Acore::IsValidMapCoord(destX, destY, destZ))
{
LOG_FATAL("server", "Map::CheckCollisionAndGetValidCoords invalid coordinates startX: %f, startY: %f, startZ: %f, destX: %f, destY: %f, destZ: %f", startX, startY, startZ, destX, destY, destZ);
return false;
+15 -15
View File
@@ -48,7 +48,7 @@ class Transport;
class StaticTransport;
class MotionTransport;
class PathGenerator;
namespace acore
namespace Acore
{
struct ObjectUpdater;
struct LargeObjectUpdater;
@@ -293,14 +293,14 @@ public:
template<class T> bool AddToMap(T*, bool checkTransport = false);
template<class T> void RemoveFromMap(T*, bool);
void VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer>& gridVisitor,
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer>& worldVisitor,
TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer>& largeGridVisitor,
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer>& largeWorldVisitor);
void VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer>& gridVisitor,
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer>& worldVisitor,
TypeContainerVisitor<acore::ObjectUpdater, GridTypeMapContainer>& largeGridVisitor,
TypeContainerVisitor<acore::ObjectUpdater, WorldTypeMapContainer>& largeWorldVisitor);
void VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer>& gridVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer>& worldVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer>& largeGridVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer>& largeWorldVisitor);
void VisitNearbyCellsOfPlayer(Player* player, TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer>& gridVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer>& worldVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer>& largeGridVisitor,
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer>& largeWorldVisitor);
virtual void Update(const uint32, const uint32, bool thread = true);
@@ -318,13 +318,13 @@ public:
[[nodiscard]] bool IsRemovalGrid(float x, float y) const
{
GridCoord p = acore::ComputeGridCoord(x, y);
GridCoord p = Acore::ComputeGridCoord(x, y);
return !getNGrid(p.x_coord, p.y_coord);
}
[[nodiscard]] bool IsGridLoaded(float x, float y) const
{
return IsGridLoaded(acore::ComputeGridCoord(x, y));
return IsGridLoaded(Acore::ComputeGridCoord(x, y));
}
void LoadGrid(float x, float y);
@@ -815,7 +815,7 @@ inline void Map::Visit(Cell const& cell, TypeContainerVisitor<T, CONTAINER>& vis
template<class NOTIFIER>
inline void Map::VisitAll(float const& x, float const& y, float radius, NOTIFIER& notifier)
{
CellCoord p(acore::ComputeCellCoord(x, y));
CellCoord p(Acore::ComputeCellCoord(x, y));
Cell cell(p);
cell.SetNoCreate();
@@ -829,7 +829,7 @@ inline void Map::VisitAll(float const& x, float const& y, float radius, NOTIFIER
template<class NOTIFIER>
inline void Map::VisitFirstFound(const float& x, const float& y, float radius, NOTIFIER& notifier)
{
CellCoord p(acore::ComputeCellCoord(x, y));
CellCoord p(Acore::ComputeCellCoord(x, y));
Cell cell(p);
cell.SetNoCreate();
@@ -845,7 +845,7 @@ inline void Map::VisitFirstFound(const float& x, const float& y, float radius, N
template<class NOTIFIER>
inline void Map::VisitWorld(const float& x, const float& y, float radius, NOTIFIER& notifier)
{
CellCoord p(acore::ComputeCellCoord(x, y));
CellCoord p(Acore::ComputeCellCoord(x, y));
Cell cell(p);
cell.SetNoCreate();
@@ -856,7 +856,7 @@ inline void Map::VisitWorld(const float& x, const float& y, float radius, NOTIFI
template<class NOTIFIER>
inline void Map::VisitGrid(const float& x, const float& y, float radius, NOTIFIER& notifier)
{
CellCoord p(acore::ComputeCellCoord(x, y));
CellCoord p(Acore::ComputeCellCoord(x, y));
Cell cell(p);
cell.SetNoCreate();
+1 -1
View File
@@ -306,7 +306,7 @@ void MapManager::DoDelayedMovesAndRemoves()
bool MapManager::ExistMapAndVMap(uint32 mapid, float x, float y)
{
GridCoord p = acore::ComputeGridCoord(x, y);
GridCoord p = Acore::ComputeGridCoord(x, y);
int gx = 63 - p.x_coord;
int gy = 63 - p.y_coord;
+3 -3
View File
@@ -73,17 +73,17 @@ public:
static bool IsValidMapCoord(uint32 mapid, float x, float y)
{
return IsValidMAP(mapid, false) && acore::IsValidMapCoord(x, y);
return IsValidMAP(mapid, false) && Acore::IsValidMapCoord(x, y);
}
static bool IsValidMapCoord(uint32 mapid, float x, float y, float z)
{
return IsValidMAP(mapid, false) && acore::IsValidMapCoord(x, y, z);
return IsValidMAP(mapid, false) && Acore::IsValidMapCoord(x, y, z);
}
static bool IsValidMapCoord(uint32 mapid, float x, float y, float z, float o)
{
return IsValidMAP(mapid, false) && acore::IsValidMapCoord(x, y, z, o);
return IsValidMAP(mapid, false) && Acore::IsValidMapCoord(x, y, z, o);
}
static bool IsValidMapCoord(WorldLocation const& loc)
+2 -2
View File
@@ -10,7 +10,7 @@
#include "Player.h"
#include "World.h"
uint32 acore::XP::BaseGain(uint8 pl_level, uint8 mob_level, ContentLevels content)
uint32 Acore::XP::BaseGain(uint8 pl_level, uint8 mob_level, ContentLevels content)
{
uint32 baseGain;
uint32 nBaseExp;
@@ -56,7 +56,7 @@ uint32 acore::XP::BaseGain(uint8 pl_level, uint8 mob_level, ContentLevels conten
return baseGain;
}
uint32 acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false*/)
uint32 Acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false*/)
{
Creature* creature = unit->ToCreature();
uint32 gain = 0;
+2 -2
View File
@@ -10,7 +10,7 @@
#include "ScriptMgr.h"
#include "SharedDefines.h"
namespace acore::Honor
namespace Acore::Honor
{
inline float hk_honor_at_level_f(uint8 level, float multiplier = 1.0f)
{
@@ -25,7 +25,7 @@ namespace acore::Honor
}
}
namespace acore::XP
namespace Acore::XP
{
inline uint8 GetGrayLevel(uint8 pl_level)
{
@@ -37,8 +37,8 @@ void ConfusedMovementGenerator<T>::DoInitialize(T* unit)
float wanderY = y + (wander_distance * (float)rand_norm() - wander_distance / 2);
// prevent invalid coordinates generation
acore::NormalizeMapCoord(wanderX);
acore::NormalizeMapCoord(wanderY);
Acore::NormalizeMapCoord(wanderX);
Acore::NormalizeMapCoord(wanderY);
float new_z = unit->GetMapHeight(wanderX, wanderY, z);
if (new_z <= INVALID_HEIGHT || fabs(z - new_z) > 3.0f) // pussywizard
@@ -48,7 +48,7 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo
bool PathGenerator::CalculatePath(float x, float y, float z, float destX, float destY, float destZ, bool forceDest)
{
if (!acore::IsValidMapCoord(destX, destY, destZ) || !acore::IsValidMapCoord(x, y, z))
if (!Acore::IsValidMapCoord(destX, destY, destZ) || !Acore::IsValidMapCoord(x, y, z))
return false;
G3D::Vector3 dest(destX, destY, destZ);
@@ -63,7 +63,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
Map* map = creature->GetMap();
float x = _destinationPoints[newPoint].x, y = _destinationPoints[newPoint].y, z = _destinationPoints[newPoint].z;
// invalid coordinates
if (!acore::IsValidMapCoord(x, y))
if (!Acore::IsValidMapCoord(x, y))
{
_validPointsVector[_currentPoint].erase(randomIter);
_preComputedPaths.erase(pathIdx);
@@ -62,8 +62,8 @@ void WaypointMgr::Load()
float z = fields[4].GetFloat();
float o = fields[5].GetFloat();
acore::NormalizeMapCoord(x);
acore::NormalizeMapCoord(y);
Acore::NormalizeMapCoord(x);
Acore::NormalizeMapCoord(y);
wp->id = fields[1].GetUInt32();
wp->x = x;
@@ -123,8 +123,8 @@ void WaypointMgr::ReloadPath(uint32 id)
float z = fields[3].GetFloat();
float o = fields[4].GetFloat();
acore::NormalizeMapCoord(x);
acore::NormalizeMapCoord(y);
Acore::NormalizeMapCoord(x);
Acore::NormalizeMapCoord(y);
wp->id = fields[0].GetUInt32();
wp->x = x;
+2 -2
View File
@@ -302,8 +302,8 @@ bool OPvPCapturePoint::Update(uint32 diff)
}
std::list<Player*> players;
acore::AnyPlayerInObjectRangeCheck checker(m_capturePoint, radius);
acore::PlayerListSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(m_capturePoint, players, checker);
Acore::AnyPlayerInObjectRangeCheck checker(m_capturePoint, radius);
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(m_capturePoint, players, checker);
m_capturePoint->VisitNearbyWorldObject(radius, searcher);
for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
+3 -3
View File
@@ -334,7 +334,7 @@ void PoolGroup<T>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 trig
return /*object.guid == triggerFrom ||*/ !spawns.IsActiveObject<T>(object.guid);
});
acore::Containers::RandomResize(rolledObjects, count);
Acore::Containers::RandomResize(rolledObjects, count);
}
// try to spawn rolled objects
@@ -495,7 +495,7 @@ void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32
{
do
{
uint32 questId = acore::Containers::SelectRandomContainerElement(currentQuests);
uint32 questId = Acore::Containers::SelectRandomContainerElement(currentQuests);
newQuests.insert(questId);
currentQuests.erase(questId);
} while (newQuests.size() < limit && !currentQuests.empty()); // failsafe
@@ -507,7 +507,7 @@ void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32
// activate <limit> random quests
do
{
uint32 questId = acore::Containers::SelectRandomContainerElement(newQuests);
uint32 questId = Acore::Containers::SelectRandomContainerElement(newQuests);
spawns.ActivateObject<Quest>(questId, poolId);
PoolObject tempObj(questId, 0.0f);
Spawn1Object(&tempObj);
+1 -1
View File
@@ -270,7 +270,7 @@ uint32 Quest::CalculateHonorGain(uint8 level) const
honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1000000014901161);
// Xinef: exactly this is calculated above, however with higher precision...
//honor += acore::Honor::hk_honor_at_level(level, GetRewHonorMultiplier());
//honor += Acore::Honor::hk_honor_at_level(level, GetRewHonorMultiplier());
honor += GetRewHonorAddition();
}
@@ -57,7 +57,7 @@ namespace WorldPackets
template<std::size_t MaxBytesWithoutNullTerminator, typename... Validators>
class String
{
using ValidatorList = std::conditional_t<!acore::has_type<Strings::RawBytes, std::tuple<Validators...>>::value,
using ValidatorList = std::conditional_t<!Acore::has_type<Strings::RawBytes, std::tuple<Validators...>>::value,
std::tuple<Strings::ByteSize<MaxBytesWithoutNullTerminator>, Strings::Utf8, Validators...>,
std::tuple<Strings::ByteSize<MaxBytesWithoutNullTerminator>, Validators...>>;
+4 -4
View File
@@ -148,7 +148,7 @@ WorldSocket::WorldSocket(void): WorldHandler(),
m_RecvWPct(0), m_RecvPct(), m_Header(sizeof (ClientPktHeader)),
m_OutBuffer(0), m_OutBufferSize(65536), m_OutActive(false)
{
acore::Crypto::GetRandomBytes(m_Seed);
Acore::Crypto::GetRandomBytes(m_Seed);
reference_counting_policy().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
@@ -293,7 +293,7 @@ int WorldSocket::open(void* a)
WorldPacket packet (SMSG_AUTH_CHALLENGE, 24);
packet << uint32(1); // 1...31
packet.append(m_Seed);
packet.append(acore::Crypto::GetRandomBytes<32>()); // new encryption seeds
packet.append(Acore::Crypto::GetRandomBytes<32>()); // new encryption seeds
if (SendPacket(packet) == -1)
return -1;
@@ -798,7 +798,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
std::string accountName;
WorldPacket packet, SendAddonPacked;
std::array<uint8, 4> clientSeed;
acore::Crypto::SHA1::Digest digest;
Acore::Crypto::SHA1::Digest digest;
if (sWorld->IsClosed())
{
@@ -902,7 +902,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
// Check that Key and account name are the same on client and server
uint8 t[4] = { 0x00, 0x00, 0x00, 0x00 };
acore::Crypto::SHA1 sha;
Acore::Crypto::SHA1 sha;
sha.UpdateData(accountName);
sha.UpdateData(t);
sha.UpdateData(clientSeed);
@@ -2397,8 +2397,8 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
*/
UnitList targets;
acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
acore::UnitListSearcher<acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(target, targets, u_check);
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(target, targets, u_check);
target->VisitNearbyObject(target->GetVisibilityRange(), searcher); // no VISIBILITY_COMPENSATION, distance is enough
for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
@@ -5204,8 +5204,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
return;
Player* player = nullptr;
acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f);
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
Acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f);
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
target->VisitNearbyWorldObject(10.0f, searcher);
if( player && player->GetGUID() != target->GetGUID() )
@@ -320,7 +320,7 @@ public:
void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
};
namespace acore
namespace Acore
{
// Binary predicate for sorting the priority of absorption aura effects
class AbsorbAuraOrderPred
+12 -12
View File
@@ -2650,23 +2650,23 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8>& targets, Unit* caster)
case SPELL_EFFECT_APPLY_AREA_AURA_RAID:
{
targetList.push_back(GetUnitOwner());
acore::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID);
acore::UnitListSearcher<acore::AnyGroupedUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
Acore::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID);
Acore::UnitListSearcher<Acore::AnyGroupedUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
GetUnitOwner()->VisitNearbyObject(radius, searcher);
break;
}
case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND:
{
targetList.push_back(GetUnitOwner());
acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius);
acore::UnitListSearcher<acore::AnyFriendlyUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
Acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius);
Acore::UnitListSearcher<Acore::AnyFriendlyUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
GetUnitOwner()->VisitNearbyObject(radius, searcher);
break;
}
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
{
acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher
acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
Acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher
Acore::UnitListSearcher<Acore::AnyAoETargetUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
GetUnitOwner()->VisitNearbyObject(radius, searcher);
break;
}
@@ -2726,22 +2726,22 @@ void DynObjAura::FillTargetMap(std::map<Unit*, uint8>& targets, Unit* /*caster*/
if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_ALLY
|| GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ALLY)
{
acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
acore::UnitListSearcher<acore::AnyFriendlyUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
Acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
Acore::UnitListSearcher<Acore::AnyFriendlyUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
GetDynobjOwner()->VisitNearbyObject(radius, searcher);
}
// pussywizard: TARGET_DEST_DYNOBJ_NONE is supposed to search for both friendly and unfriendly targets, so for any unit
// what about EffectImplicitTargetA?
else if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_NONE)
{
acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
acore::UnitListSearcher<acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
Acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
Acore::UnitListSearcher<Acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
GetDynobjOwner()->VisitNearbyObject(radius, searcher);
}
else
{
acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
Acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
Acore::UnitListSearcher<Acore::AnyAoETargetUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
GetDynobjOwner()->VisitNearbyObject(radius, searcher);
}
+22 -22
View File
@@ -1181,9 +1181,9 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge
if (uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList))
{
acore::WorldObjectSpellConeTargetCheck check(coneAngle, radius, m_caster, m_spellInfo, selectionType, condList);
acore::WorldObjectListSearcher<acore::WorldObjectSpellConeTargetCheck> searcher(m_caster, targets, check, containerTypeMask);
SearchTargets<acore::WorldObjectListSearcher<acore::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask, m_caster, m_caster, radius);
Acore::WorldObjectSpellConeTargetCheck check(coneAngle, radius, m_caster, m_spellInfo, selectionType, condList);
Acore::WorldObjectListSearcher<Acore::WorldObjectSpellConeTargetCheck> searcher(m_caster, targets, check, containerTypeMask);
SearchTargets<Acore::WorldObjectListSearcher<Acore::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask, m_caster, m_caster, radius);
CallScriptObjectAreaTargetSelectHandlers(targets, effIndex, targetType);
@@ -1197,7 +1197,7 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge
if ((*j)->IsAffectedOnSpell(m_spellInfo))
maxTargets += (*j)->GetAmount();
acore::Containers::RandomResize(targets, maxTargets);
Acore::Containers::RandomResize(targets, maxTargets);
}
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
@@ -1280,7 +1280,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
if ((*j)->IsAffectedOnSpell(m_spellInfo))
maxTargets += (*j)->GetAmount();
acore::Containers::RandomResize(targets, maxTargets);
Acore::Containers::RandomResize(targets, maxTargets);
}
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
@@ -1617,13 +1617,13 @@ void Spell::SelectImplicitTrajTargets(SpellEffIndex effIndex, SpellImplicitTarge
// xinef: supply correct target type, DEST_DEST and similar are ALWAYS undefined
// xinef: correct target is stored in TRIGGERED SPELL, however as far as i noticed, all checks are ENTRY, ENEMY
std::list<WorldObject*> targets;
acore::WorldObjectSpellTrajTargetCheck check(dist2d, m_targets.GetSrcPos(), m_caster, m_spellInfo, TARGET_CHECK_ENEMY /*targetCheckType*/, m_spellInfo->Effects[effIndex].ImplicitTargetConditions);
acore::WorldObjectListSearcher<acore::WorldObjectSpellTrajTargetCheck> searcher(m_caster, targets, check, GRID_MAP_TYPE_MASK_ALL);
SearchTargets<acore::WorldObjectListSearcher<acore::WorldObjectSpellTrajTargetCheck> > (searcher, GRID_MAP_TYPE_MASK_ALL, m_caster, m_targets.GetSrcPos(), dist2d);
Acore::WorldObjectSpellTrajTargetCheck check(dist2d, m_targets.GetSrcPos(), m_caster, m_spellInfo, TARGET_CHECK_ENEMY /*targetCheckType*/, m_spellInfo->Effects[effIndex].ImplicitTargetConditions);
Acore::WorldObjectListSearcher<Acore::WorldObjectSpellTrajTargetCheck> searcher(m_caster, targets, check, GRID_MAP_TYPE_MASK_ALL);
SearchTargets<Acore::WorldObjectListSearcher<Acore::WorldObjectSpellTrajTargetCheck> > (searcher, GRID_MAP_TYPE_MASK_ALL, m_caster, m_targets.GetSrcPos(), dist2d);
if (targets.empty())
return;
targets.sort(acore::ObjectDistanceOrderPred(m_caster));
targets.sort(Acore::ObjectDistanceOrderPred(m_caster));
float b = tangent(m_targets.GetElevation());
float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d);
@@ -1892,7 +1892,7 @@ void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* refere
x = pos->GetPositionX();
y = pos->GetPositionY();
CellCoord p(acore::ComputeCellCoord(x, y));
CellCoord p(Acore::ComputeCellCoord(x, y));
Cell cell(p);
cell.SetNoCreate();
@@ -1917,9 +1917,9 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargetObjectTypes objec
uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList);
if (!containerTypeMask)
return nullptr;
acore::WorldObjectSpellNearbyTargetCheck check(range, m_caster, m_spellInfo, selectionType, condList);
acore::WorldObjectLastSearcher<acore::WorldObjectSpellNearbyTargetCheck> searcher(m_caster, target, check, containerTypeMask);
SearchTargets<acore::WorldObjectLastSearcher<acore::WorldObjectSpellNearbyTargetCheck> > (searcher, containerTypeMask, m_caster, m_caster, range);
Acore::WorldObjectSpellNearbyTargetCheck check(range, m_caster, m_spellInfo, selectionType, condList);
Acore::WorldObjectLastSearcher<Acore::WorldObjectSpellNearbyTargetCheck> searcher(m_caster, target, check, containerTypeMask);
SearchTargets<Acore::WorldObjectLastSearcher<Acore::WorldObjectSpellNearbyTargetCheck> > (searcher, containerTypeMask, m_caster, m_caster, range);
return target;
}
@@ -1928,9 +1928,9 @@ void Spell::SearchAreaTargets(std::list<WorldObject*>& targets, float range, Pos
uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList);
if (!containerTypeMask)
return;
acore::WorldObjectSpellAreaTargetCheck check(range, position, m_caster, referer, m_spellInfo, selectionType, condList);
acore::WorldObjectListSearcher<acore::WorldObjectSpellAreaTargetCheck> searcher(m_caster, targets, check, containerTypeMask);
SearchTargets<acore::WorldObjectListSearcher<acore::WorldObjectSpellAreaTargetCheck> > (searcher, containerTypeMask, m_caster, position, range);
Acore::WorldObjectSpellAreaTargetCheck check(range, position, m_caster, referer, m_spellInfo, selectionType, condList);
Acore::WorldObjectListSearcher<Acore::WorldObjectSpellAreaTargetCheck> searcher(m_caster, targets, check, containerTypeMask);
SearchTargets<Acore::WorldObjectListSearcher<Acore::WorldObjectSpellAreaTargetCheck> > (searcher, containerTypeMask, m_caster, position, range);
}
void Spell::SearchChainTargets(std::list<WorldObject*>& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, SpellTargetSelectionCategories /*selectCategory*/, ConditionList* condList, bool isChainHeal)
@@ -7090,14 +7090,14 @@ SpellCastResult Spell::CheckSpellFocus()
// check spell focus object
if (m_spellInfo->RequiresSpellFocus)
{
CellCoord p(acore::ComputeCellCoord(m_caster->GetPositionX(), m_caster->GetPositionY()));
CellCoord p(Acore::ComputeCellCoord(m_caster->GetPositionX(), m_caster->GetPositionY()));
Cell cell(p);
GameObject* ok = nullptr;
acore::GameObjectFocusCheck go_check(m_caster, m_spellInfo->RequiresSpellFocus);
acore::GameObjectSearcher<acore::GameObjectFocusCheck> checker(m_caster, ok, go_check);
Acore::GameObjectFocusCheck go_check(m_caster, m_spellInfo->RequiresSpellFocus);
Acore::GameObjectSearcher<Acore::GameObjectFocusCheck> checker(m_caster, ok, go_check);
TypeContainerVisitor<acore::GameObjectSearcher<acore::GameObjectFocusCheck>, GridTypeMapContainer > object_checker(checker);
TypeContainerVisitor<Acore::GameObjectSearcher<Acore::GameObjectFocusCheck>, GridTypeMapContainer > object_checker(checker);
Map& map = *m_caster->GetMap();
cell.Visit(p, object_checker, map, *m_caster, m_caster->GetVisibilityRange());
@@ -8246,7 +8246,7 @@ void Spell::OnSpellLaunch()
}
}
namespace acore
namespace Acore
{
WorldObjectSpellTargetCheck::WorldObjectSpellTargetCheck(Unit* caster, Unit* referer, SpellInfo const* spellInfo,
@@ -8405,4 +8405,4 @@ namespace acore
return WorldObjectSpellAreaTargetCheck::operator ()(target);
}
} //namespace acore
} //namespace Acore
+1 -1
View File
@@ -733,7 +733,7 @@ protected:
#endif
};
namespace acore
namespace Acore
{
struct WorldObjectSpellTargetCheck
{
+8 -8
View File
@@ -1135,7 +1135,7 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex)
float x, y, z;
destTarget->GetPosition(x, y, z);
// xinef: this can happen if MovePositionToFirstCollision detects that X, Y cords are invalid and returns prematurely
if (!acore::IsValidMapCoord(x, y, z) || z <= INVALID_HEIGHT)
if (!Acore::IsValidMapCoord(x, y, z) || z <= INVALID_HEIGHT)
return;
float speedXY, speedZ;
@@ -2007,7 +2007,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
if (!availableElixirs.empty())
{
// cast random elixir on target
m_caster->CastSpell(unitTarget, acore::Containers::SelectRandomContainerElement(availableElixirs), true, m_CastItem);
m_caster->CastSpell(unitTarget, Acore::Containers::SelectRandomContainerElement(availableElixirs), true, m_CastItem);
}
}
}
@@ -2832,7 +2832,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
// do not allow to add too many honor for player (50 * 21) = 1040 at level 70, or (50 * 31) = 1550 at level 80
if (damage <= 50)
{
uint32 honor_reward = acore::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage));
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",
@@ -4295,8 +4295,8 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/)
}
UnitList targets;
acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(unitTarget, unitTarget, unitTarget->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
acore::UnitListSearcher<acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(unitTarget, targets, u_check);
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(unitTarget, unitTarget, unitTarget->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(unitTarget, targets, u_check);
unitTarget->VisitNearbyObject(unitTarget->GetVisibilityRange(), searcher); // no VISIBILITY_COMPENSATION, distance is enough
for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
@@ -4942,7 +4942,7 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/)
data << m_caster->GetGUID();
float dist = m_caster->GetVisibilityRange() + VISIBILITY_COMPENSATION;
acore::MessageDistDelivererToHostile notifier(m_caster, &data, dist);
Acore::MessageDistDelivererToHostile notifier(m_caster, &data, dist);
m_caster->VisitNearbyWorldObject(dist, notifier);
// xinef: we should also force pets to remove us from current target
@@ -4966,8 +4966,8 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/)
return;
UnitList targets;
acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, m_caster->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
acore::UnitListSearcher<acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_caster, targets, u_check);
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, m_caster->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_caster, targets, u_check);
m_caster->VisitNearbyObject(m_caster->GetVisibilityRange(), searcher); // no VISIBILITY_COMPENSATION, distance is enough
for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
+1 -1
View File
@@ -238,7 +238,7 @@ void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder
if (msgType == CHAT_MSG_RAID_BOSS_EMOTE && source->GetMap()->IsDungeon())
dist = 250.0f;
acore::PlayerDistWorker<CreatureTextLocalizer<Builder> > worker(source, dist, localizer);
Acore::PlayerDistWorker<CreatureTextLocalizer<Builder> > worker(source, dist, localizer);
source->VisitNearbyWorldObject(dist, worker);
}
+4 -4
View File
@@ -249,14 +249,14 @@ void Warden::ApplyPenalty(uint16 checkId, std::string const& reason)
if (Player const* plr = _session->GetPlayer())
{
std::string const reportFormat = "Player %s (guid %u, account id: %u) failed warden %u check (%s). Action: %s";
reportMsg = acore::StringFormat(reportFormat, plr->GetName().c_str(), plr->GetGUID().GetCounter(), _session->GetAccountId(),
reportMsg = Acore::StringFormat(reportFormat, plr->GetName().c_str(), plr->GetGUID().GetCounter(), _session->GetAccountId(),
checkId, ((checkData && !checkData->Comment.empty()) ? checkData->Comment.c_str() : "<warden comment is not set>"),
GetWardenActionStr(action).c_str());
}
else
{
std::string const reportFormat = "Account id: %u failed warden %u check. Action: %s";
reportMsg = acore::StringFormat(reportFormat, _session->GetAccountId(), checkId, GetWardenActionStr(action).c_str());
reportMsg = Acore::StringFormat(reportFormat, _session->GetAccountId(), checkId, GetWardenActionStr(action).c_str());
}
}
else
@@ -264,12 +264,12 @@ void Warden::ApplyPenalty(uint16 checkId, std::string const& reason)
if (Player const* plr = _session->GetPlayer())
{
std::string const reportFormat = "Player %s (guid %u, account id: %u) triggered warden penalty by reason: %s. Action: %s";
reportMsg = acore::StringFormat(reportFormat, plr->GetName().c_str(), plr->GetGUID().GetCounter(), _session->GetAccountId(), causeMsg.c_str(), GetWardenActionStr(action).c_str());
reportMsg = Acore::StringFormat(reportFormat, plr->GetName().c_str(), plr->GetGUID().GetCounter(), _session->GetAccountId(), causeMsg.c_str(), GetWardenActionStr(action).c_str());
}
else
{
std::string const reportFormat = "Account id: %u failed warden %u check. Action: %s";
reportMsg = acore::StringFormat(reportFormat, _session->GetAccountId(), causeMsg.c_str(), GetWardenActionStr(action).c_str());
reportMsg = Acore::StringFormat(reportFormat, _session->GetAccountId(), causeMsg.c_str(), GetWardenActionStr(action).c_str());
}
}
+2 -2
View File
@@ -123,8 +123,8 @@ private:
uint8 _inputKey[16];
uint8 _outputKey[16];
uint8 _seed[16];
acore::Crypto::ARC4 _inputCrypto;
acore::Crypto::ARC4 _outputCrypto;
Acore::Crypto::ARC4 _inputCrypto;
Acore::Crypto::ARC4 _outputCrypto;
uint32 _checkTimer; // Timer for sending check requests
uint32 _clientResponseTimer; // Timer for client response delay
bool _dataSent;
+9 -9
View File
@@ -30,7 +30,7 @@ void WardenMac::Init(WorldSession* pClient, SessionKey const& K)
{
_session = pClient;
// Generate Warden Key
SessionKeyGenerator<acore::Crypto::SHA1> WK(K);
SessionKeyGenerator<Acore::Crypto::SHA1> WK(K);
WK.Generate(_inputKey, 16);
WK.Generate(_outputKey, 16);
/*
@@ -49,17 +49,17 @@ void WardenMac::Init(WorldSession* pClient, SessionKey const& K)
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("warden", "Server side warden for client %u initializing...", pClient->GetAccountId());
LOG_DEBUG("warden", "C->S Key: %s", acore::Impl::ByteArrayToHexStr(_inputKey, 16).c_str());
LOG_DEBUG("warden", "S->C Key: %s", acore::Impl::ByteArrayToHexStr(_outputKey, 16 ).c_str());
LOG_DEBUG("warden", " Seed: %s", acore::Impl::ByteArrayToHexStr(_seed, 16).c_str());
LOG_DEBUG("warden", "C->S Key: %s", Acore::Impl::ByteArrayToHexStr(_inputKey, 16).c_str());
LOG_DEBUG("warden", "S->C Key: %s", Acore::Impl::ByteArrayToHexStr(_outputKey, 16 ).c_str());
LOG_DEBUG("warden", " Seed: %s", Acore::Impl::ByteArrayToHexStr(_seed, 16).c_str());
LOG_DEBUG("warden", "Loading Module...");
#endif
_module = GetModuleForClient();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("warden", "Module Key: %s", acore::Impl::ByteArrayToHexStr(_module->Key, 16).c_str());
LOG_DEBUG("warden", "Module ID: %s", acore::Impl::ByteArrayToHexStr(_module->Id, 16).c_str());
LOG_DEBUG("warden", "Module Key: %s", Acore::Impl::ByteArrayToHexStr(_module->Key, 16).c_str());
LOG_DEBUG("warden", "Module ID: %s", Acore::Impl::ByteArrayToHexStr(_module->Id, 16).c_str());
#endif
RequestModule();
}
@@ -155,7 +155,7 @@ void WardenMac::HandleHashResult(ByteBuffer& buff)
buff.rpos(buff.wpos());
acore::Crypto::SHA1 sha1;
Acore::Crypto::SHA1 sha1;
sha1.UpdateData((uint8*)keyIn, 16);
sha1.Finalize();
@@ -243,13 +243,13 @@ void WardenMac::HandleData(ByteBuffer& buff)
std::string str = "Test string!";
acore::Crypto::SHA1 sha1;
Acore::Crypto::SHA1 sha1;
sha1.UpdateData(str);
uint32 magic = 0xFEEDFACE; // unsure
sha1.UpdateData((uint8*)&magic, 4);
sha1.Finalize();
std::array<uint8, acore::Crypto::SHA1::DIGEST_LENGTH> sha1Hash;
std::array<uint8, Acore::Crypto::SHA1::DIGEST_LENGTH> sha1Hash;
buff.read(sha1Hash.data(), sha1Hash.size());
if (sha1Hash != sha1.GetDigest())
+15 -15
View File
@@ -39,7 +39,7 @@ static constexpr uint8 GetCheckPacketBaseSize(uint8 type)
case LUA_EVAL_CHECK: return 1 + sizeof(_luaEvalPrefix) - 1 + sizeof(_luaEvalMidfix) - 1 + 4 + sizeof(_luaEvalPostfix) - 1;
case PAGE_CHECK_A: return (4 + 1);
case PAGE_CHECK_B: return (4 + 1);
case MODULE_CHECK: return (4 + acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES);
case MODULE_CHECK: return (4 + Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES);
case MEM_CHECK: return (1 + 4 + 1);
default: return 0;
}
@@ -95,7 +95,7 @@ void WardenWin::Init(WorldSession* session, SessionKey const& k)
{
_session = session;
// Generate Warden Key
SessionKeyGenerator<acore::Crypto::SHA1> WK(k);
SessionKeyGenerator<Acore::Crypto::SHA1> WK(k);
WK.Generate(_inputKey, 16);
WK.Generate(_outputKey, 16);
@@ -105,17 +105,17 @@ void WardenWin::Init(WorldSession* session, SessionKey const& k)
_outputCrypto.Init(_outputKey);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("warden", "Server side warden for client %u initializing...", session->GetAccountId());
LOG_DEBUG("warden", "C->S Key: %s", acore::Impl::ByteArrayToHexStr(_inputKey, 16).c_str());
LOG_DEBUG("warden", "S->C Key: %s", acore::Impl::ByteArrayToHexStr(_outputKey,16).c_str());
LOG_DEBUG("warden", " Seed: %s", acore::Impl::ByteArrayToHexStr(_seed, 16).c_str());
LOG_DEBUG("warden", "C->S Key: %s", Acore::Impl::ByteArrayToHexStr(_inputKey, 16).c_str());
LOG_DEBUG("warden", "S->C Key: %s", Acore::Impl::ByteArrayToHexStr(_outputKey,16).c_str());
LOG_DEBUG("warden", " Seed: %s", Acore::Impl::ByteArrayToHexStr(_seed, 16).c_str());
LOG_DEBUG("warden", "Loading Module...");
#endif
_module = GetModuleForClient();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("warden", "Module Key: %s", acore::Impl::ByteArrayToHexStr(_module->Key, 16).c_str());
LOG_DEBUG("warden", "Module ID: %s", acore::Impl::ByteArrayToHexStr(_module->Id, 16).c_str());
LOG_DEBUG("warden", "Module Key: %s", Acore::Impl::ByteArrayToHexStr(_module->Key, 16).c_str());
LOG_DEBUG("warden", "Module ID: %s", Acore::Impl::ByteArrayToHexStr(_module->Id, 16).c_str());
#endif
RequestModule();
}
@@ -159,7 +159,7 @@ void WardenWin::InitializeModule()
Request.Function1[1] = 0x000218C0; // 0x00400000 + 0x000218C0 SFileGetFileSize
Request.Function1[2] = 0x00022530; // 0x00400000 + 0x00022530 SFileReadFile
Request.Function1[3] = 0x00022910; // 0x00400000 + 0x00022910 SFileCloseFile
Request.CheckSumm1 = BuildChecksum(&Request.Unk1, acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES);
Request.CheckSumm1 = BuildChecksum(&Request.Unk1, Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES);
Request.Command2 = WARDEN_SMSG_MODULE_INITIALIZE;
Request.Size2 = 8;
@@ -224,7 +224,7 @@ void WardenWin::HandleHashResult(ByteBuffer& buff)
buff.rpos(buff.wpos());
// Verify key
if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES) != 0)
if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES) != 0)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("warden", "Request hash reply: failed");
@@ -331,7 +331,7 @@ void WardenWin::RequestChecks()
// Filtered checks will get passed in next checks
uint16 expectedSize = 4;
_PendingChecks.clear();
acore::Containers::EraseIf(_CurrentChecks,
Acore::Containers::EraseIf(_CurrentChecks,
[this, &expectedSize](uint16 id)
{
uint16 const thisSize = GetCheckPacketSize(sWardenCheckMgr->GetWardenDataById(id));
@@ -418,9 +418,9 @@ void WardenWin::RequestChecks()
}
case MODULE_CHECK:
{
std::array<uint8, 4> seed = acore::Crypto::GetRandomBytes<4>();
std::array<uint8, 4> seed = Acore::Crypto::GetRandomBytes<4>();
buff.append(seed);
buff.append(acore::Crypto::HMAC_SHA1::GetDigestOf(seed, check->Str));
buff.append(Acore::Crypto::HMAC_SHA1::GetDigestOf(seed, check->Str));
break;
}
/*case PROC_CHECK:
@@ -621,17 +621,17 @@ void WardenWin::HandleData(ByteBuffer& buff)
}
WardenCheckResult const* rs = sWardenCheckMgr->GetWardenResultById(checkId);
if (memcmp(buff.contents() + buff.rpos(), rs->Result.ToByteArray<20>(false).data(), acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES) != 0) // SHA1
if (memcmp(buff.contents() + buff.rpos(), rs->Result.ToByteArray<20>(false).data(), Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES) != 0) // SHA1
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("warden", "RESULT MPQ_CHECK fail, CheckId %u account Id %u", checkId, _session->GetAccountId());
#endif
checkFailed = checkId;
buff.rpos(buff.rpos() + acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); // 20 bytes SHA1
buff.rpos(buff.rpos() + Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); // 20 bytes SHA1
continue;
}
buff.rpos(buff.rpos() + acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); // 20 bytes SHA1
buff.rpos(buff.rpos() + Acore::Crypto::Constants::SHA1_DIGEST_LENGTH_BYTES); // 20 bytes SHA1
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("warden", "RESULT MPQ_CHECK passed, CheckId %u account Id %u", checkId, _session->GetAccountId());
#endif
+6 -6
View File
@@ -2411,7 +2411,7 @@ void World::SendGlobalGMMessage(WorldPacket* packet, WorldSession* self, TeamId
}
}
namespace acore
namespace Acore
{
class WorldWorldTextBuilder
{
@@ -2453,7 +2453,7 @@ namespace acore
uint32 i_textId;
va_list* i_args;
};
} // namespace acore
} // namespace Acore
/// Send a System Message to all players (except self if mentioned)
void World::SendWorldText(uint32 string_id, ...)
@@ -2461,8 +2461,8 @@ void World::SendWorldText(uint32 string_id, ...)
va_list ap;
va_start(ap, string_id);
acore::WorldWorldTextBuilder wt_builder(string_id, &ap);
acore::LocalizedPacketListDo<acore::WorldWorldTextBuilder> wt_do(wt_builder);
Acore::WorldWorldTextBuilder wt_builder(string_id, &ap);
Acore::LocalizedPacketListDo<Acore::WorldWorldTextBuilder> wt_do(wt_builder);
for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
{
if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())
@@ -2480,8 +2480,8 @@ void World::SendGMText(uint32 string_id, ...)
va_list ap;
va_start(ap, string_id);
acore::WorldWorldTextBuilder wt_builder(string_id, &ap);
acore::LocalizedPacketListDo<acore::WorldWorldTextBuilder> wt_do(wt_builder);
Acore::WorldWorldTextBuilder wt_builder(string_id, &ap);
Acore::LocalizedPacketListDo<Acore::WorldWorldTextBuilder> wt_do(wt_builder);
for (SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
{
if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())