Merge remote branch 'origin/master' into 330

This commit is contained in:
tomrus88 2009-11-10 17:35:09 +03:00
commit 3def8fa353
134 changed files with 1751 additions and 2300 deletions

View file

@ -51,9 +51,6 @@ EXTRA_DIST = \
Policies/Singleton.h \
Policies/SingletonImp.h \
Policies/ThreadingModel.h \
Utilities/CountedReference/Reference.h \
Utilities/CountedReference/ReferenceHolder.h \
Utilities/CountedReference/ReferenceImpl.h \
Utilities/LinkedReference/RefManager.h \
Utilities/LinkedReference/Reference.h \
Utilities/ByteConverter.h \

View file

@ -22,14 +22,14 @@
#include "../../dep/tbb/include/tbb/scalable_allocator.h"
void * operator new(size_t sz) throw (std::bad_alloc)
void * operator new(size_t sz)
{
void *res = scalable_malloc(sz);
if (NULL == res) throw std::bad_alloc();
return res;
}
void* operator new[](size_t sz) throw (std::bad_alloc)
void* operator new[](size_t sz)
{
void *res = scalable_malloc(sz);
if (NULL == res) throw std::bad_alloc();

View file

@ -1,97 +0,0 @@
/*
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANGOS_REFERENCE_H
#define MANGOS_REFERENCE_H
/**
* Referencer<T>
* Referencer is an object that holds a reference holder that hold a reference
* counted object. When an object's reference count drop to zero, it removes
* the object. This is a non intrusive mechanism and any object at any point
* in time can be referenced. When and object is reference counted, do not
* pass the object directly to other methods but rather, pass its
* reference around. Objects can be reference counted in both single threaded
* model and multi-threaded model
*/
#include <stdexcept>
#include "Platform/Define.h"
#include "Policies/ThreadingModel.h"
#include "ReferenceHolder.h"
template
<
typename T,
class THREADING_MODEL = MaNGOS::SingleThreaded<T>
>
class MANGOS_DLL_DECL Referencer
{
typedef typename THREADING_MODEL::Lock Lock;
typedef ReferenceHolder<T, THREADING_MODEL> ReferenceeHolder;
public:
/// Constructs a referencer.
Referencer(T *ref = NULL);
/// Copy constructor
Referencer(const Referencer &obj) : i_holder(NULL) { *this = obj; }
/// Destructor
~Referencer();
/// Referencee accessor
T* referencee(void) { return (i_holder == NULL ? NULL : i_holder->i_referencee); }
const T* referencee(void) const { return (i_holder == NULL ? NULL : i_holder->i_referencee); }
//T& referencee(void){ return _referencee(); }
//const T& referencee(void) const { return const_cast<Referencer *>(this)->_referencee(); }
operator T&(void) { return _referencee(); }
operator const T&(void) const { return *const_cast<Referencer *>(this)->_referencee(); }
/// cast operators
T* operator*() { return (i_holder == NULL ? NULL : i_holder->i_referencee); }
T const * operator*() const { return (i_holder == NULL ? NULL : i_holder->i_referencee); }
/// overload operators
T* operator->() { return (i_holder == NULL ? NULL : i_holder->i_referencee); }
const T * operator->() const { return (i_holder == NULL ? NULL : i_holder->i_referencee); }
/// operator =
Referencer& operator=(const Referencer &obj);
Referencer& operator=(T *);
/// returns true if i_referencee is null
bool isNull(void) const { return i_holder == NULL; }
private:
T& _referencee(void)
{
if( i_holder == NULL )
throw std::runtime_error("Invalid access to null pointer");
return *i_holder->i_referencee;
}
void deReference(ReferenceeHolder *);
void addReference(ReferenceeHolder *);
// private data
ReferenceeHolder *i_holder;
};
#endif

View file

@ -1,39 +0,0 @@
/*
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANGOS_REFERENCEHOLDER_H
#define MANGOS_REFERENCEHOLDER_H
/** ReferenceHolder holds the actualy referenced obejct as well the refence
count. The ReferenecHolder implements as a policy base object and
will decided by the Reference class to be consnsitent.
*/
template
<
typename T,
class THREADING_MODEL
>
struct ReferenceHolder : public THREADING_MODEL
{
explicit ReferenceHolder(T *ref) : i_referencee(ref), i_referenceCount(0) {}
T *i_referencee;
unsigned int i_referenceCount;
typedef typename THREADING_MODEL::Lock Lock;
};
#endif

View file

@ -1,130 +0,0 @@
/*
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANGOS_REFERENCEIMPL_H
#define MANGOS_REFERENCEIMPL_H
#include "Reference.h"
template
<
typename T,
class THREADING_MODEL
>
Referencer<T, THREADING_MODEL>::Referencer(T *ref)
: i_holder(NULL)
{
if( ref != NULL )
{
i_holder = new ReferenceeHolder(ref);
++i_holder->i_referenceCount;
}
}
template
<
typename T,
class THREADING_MODEL
>
Referencer<T, THREADING_MODEL>::~Referencer()
{
if( i_holder != NULL )
deReference(i_holder);
i_holder = NULL;
}
template
<
typename T,
class THREADING_MODEL
>
Referencer<T, THREADING_MODEL>&
Referencer<T, THREADING_MODEL>::operator=(const Referencer<T, THREADING_MODEL> &obj)
{
if( i_holder != NULL )
deReference(i_holder);
if( obj.i_holder != NULL )
addReference(obj.i_holder);
i_holder = obj.i_holder;
return *this;
}
template
<
typename T,
class THREADING_MODEL
>
Referencer<T, THREADING_MODEL>&
Referencer<T, THREADING_MODEL>::operator=(T *ref)
{
if( i_holder != NULL )
deReference(i_holder);
i_holder = NULL;
if( ref != NULL )
{
i_holder = new ReferenceeHolder(ref);
++i_holder->i_referenceCount;
}
return *this;
}
template
<
typename T,
class THREADING_MODEL
>
void
Referencer<T, THREADING_MODEL>::deReference(ReferenceHolder<T, THREADING_MODEL> *holder)
{
assert( holder != NULL && holder->i_referenceCount > 0);
bool delete_object = false;
{
// The guard is within the scope due to the guard
// must release earlier than expected.
Lock guard(*holder);
Guard(&guard);
--holder->i_referenceCount;
if( holder->i_referenceCount == 0 )
delete_object = true;
}
if( delete_object )
{
delete holder->i_referencee;
delete holder;
}
}
template
<
typename T,
class THREADING_MODEL
>
void
Referencer<T, THREADING_MODEL>::addReference(ReferenceHolder<T, THREADING_MODEL> *holder)
{
assert( i_holder != NULL );
Lock guard(*holder);
Guard(&guard);
++holder->i_referenceCount;
}
#endif

View file

@ -49,7 +49,7 @@ namespace MaNGOS
: i_player(pl), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) {}
void operator()(WorldPacket& data, int32 loc_idx)
{
char const* text = objmgr.GetMangosString(i_textId,loc_idx);
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
data << uint8(i_msgtype);
data << uint32(LANG_UNIVERSAL);
@ -104,7 +104,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
case ACHIEVEMENT_CRITERIA_REQUIRE_DISABLED:
return true;
case ACHIEVEMENT_CRITERIA_REQUIRE_T_CREATURE:
if (!creature.id || !objmgr.GetCreatureTemplate(creature.id))
if (!creature.id || !ObjectMgr::GetCreatureTemplate(creature.id))
{
sLog.outErrorDb( "Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_CREATURE (%u) have not existed creature id in value1 (%u), ignore.",
criteria->ID, criteria->requiredType,requirementType,creature.id);
@ -366,7 +366,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
return;
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type);
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
{
AchievementCriteriaEntry const *achievementCriteria = (*i);
@ -522,7 +522,7 @@ void AchievementMgr::LoadFromDB(QueryResult *achievementResult, QueryResult *cri
uint32 achievement_id = fields[0].GetUInt32();
// don't must happen: cleanup at server startup in achievementmgr.LoadCompletedAchievements()
// don't must happen: cleanup at server startup in sAchievementMgr.LoadCompletedAchievements()
if(!sAchievementStore.LookupEntry(achievement_id))
continue;
@ -575,7 +575,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
sLog.outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID);
#endif
if(Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()))
if(Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId()))
{
MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> say_do(say_builder);
@ -665,7 +665,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
return;
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type);
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
{
AchievementCriteriaEntry const *achievementCriteria = (*i);
@ -741,7 +741,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (achievementCriteria->win_bg.additionalRequirement1_type)
{
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria);
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if (!data || !data->Meets(GetPlayer(),unit))
continue;
}
@ -787,7 +787,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
continue;
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria);
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit))
continue;
@ -833,7 +833,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
uint32 counter =0;
for(QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); ++itr)
{
Quest const* quest = objmgr.GetQuestTemplate(itr->first);
Quest const* quest = sObjectMgr.GetQuestTemplate(itr->first);
if(itr->second.m_rewarded && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID)
counter++;
}
@ -886,7 +886,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(!miscvalue1)
continue;
Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : MapManager::Instance().FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId());
Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : sMapMgr.FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId());
if(!map || !map->IsDungeon())
continue;
@ -955,7 +955,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
continue;
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria);
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit))
continue;
@ -997,7 +997,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
case 1789:
{
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria);
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit))
continue;
break;
@ -1023,7 +1023,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
continue;
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria);
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data)
continue;
@ -1053,7 +1053,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(achievementCriteria->loot_type.lootTypeCount==1)
{
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria);
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit))
continue;
}
@ -1076,7 +1076,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(achievementCriteria->win_rated_arena.flag==ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE)
{
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria);
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit,miscvalue1))
{
// reset the progress as we have a win without the requirement.
@ -1170,7 +1170,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
continue;
if(miscvalue2 != achievementCriteria->roll_greed_on_loot.rollValue)
continue;
ItemPrototype const *pProto = objmgr.GetItemPrototype( miscvalue1 );
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( miscvalue1 );
uint32 requiredItemLevel = 0;
if (achievementCriteria->ID == 2412 || achievementCriteria->ID == 2358)
@ -1191,7 +1191,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(achievementCriteria->do_emote.count)
{
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria);
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data || !data->Meets(GetPlayer(),unit))
continue;
}
@ -1254,7 +1254,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
spellIter != GetPlayer()->GetSpellMap().end();
++spellIter)
{
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellIter->first);
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellIter->first);
for(SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
{
if(skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine)
@ -1272,7 +1272,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (achievementCriteria->win_duel.duelCount)
{
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = achievementmgr.GetCriteriaRequirementSet(achievementCriteria);
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if (!data)
continue;
@ -1301,7 +1301,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
spellIter != GetPlayer()->GetSpellMap().end();
++spellIter)
{
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellIter->first);
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellIter->first);
for(SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine)
spellCount++;
@ -1371,7 +1371,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
CompletedAchievement(achievement);
}
if(AchievementEntryList const* achRefList = achievementmgr.GetAchievementByReferencedId(achievement->ID))
if(AchievementEntryList const* achRefList = sAchievementMgr.GetAchievementByReferencedId(achievement->ID))
{
for(AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr)
if(IsCompletedAchievement(*itr))
@ -1392,7 +1392,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve
if(achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
{
// someone on this realm has already completed that achievement
if(achievementmgr.IsRealmCompleted(achievement))
if(sAchievementMgr.IsRealmCompleted(achievement))
return false;
}
@ -1554,7 +1554,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry)
uint32 achievmentForTestId = entry->refAchievement ? entry->refAchievement : entry->ID;
uint32 achievmentForTestCount = entry->count;
AchievementCriteriaEntryList const* cList = achievementmgr.GetAchievementCriteriaByAchievement(achievmentForTestId);
AchievementCriteriaEntryList const* cList = sAchievementMgr.GetAchievementCriteriaByAchievement(achievmentForTestId);
if(!cList)
return false;
uint32 count = 0;
@ -1683,12 +1683,12 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
// don't insert for ACHIEVEMENT_FLAG_REALM_FIRST_KILL since otherwise only the first group member would reach that achievement
// TODO: where do set this instead?
if(!(achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
achievementmgr.SetRealmCompleted(achievement);
sAchievementMgr.SetRealmCompleted(achievement);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT);
// reward items and titles if any
AchievementReward const* reward = achievementmgr.GetAchievementReward(achievement);
AchievementReward const* reward = sAchievementMgr.GetAchievementReward(achievement);
// no rewards
if(!reward)
@ -1713,7 +1713,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
std::string text = reward->text;
if ( loc_idx >= 0 )
{
if(AchievementRewardLocale const* loc = achievementmgr.GetAchievementRewardLocale(achievement))
if(AchievementRewardLocale const* loc = sAchievementMgr.GetAchievementRewardLocale(achievement))
{
if (loc->subject.size() > size_t(loc_idx) && !loc->subject[loc_idx].empty())
subject = loc->subject[loc_idx];
@ -1722,7 +1722,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
}
}
uint32 itemTextId = objmgr.CreateItemText( text );
uint32 itemTextId = sObjectMgr.CreateItemText( text );
MailDraft draft(subject, itemTextId);
@ -2087,7 +2087,7 @@ void AchievementGlobalMgr::LoadRewards()
//check mail data before item for report including wrong item case
if (reward.sender)
{
if (!objmgr.GetCreatureTemplate(reward.sender))
if (!ObjectMgr::GetCreatureTemplate(reward.sender))
{
sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender);
reward.sender = 0;
@ -2107,7 +2107,7 @@ void AchievementGlobalMgr::LoadRewards()
if (reward.itemId)
{
if (!objmgr.GetItemPrototype(reward.itemId))
if (!ObjectMgr::GetItemPrototype(reward.itemId))
{
sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will be without item.", entry, reward.itemId);
reward.itemId = 0;
@ -2164,7 +2164,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
std::string str = fields[1+2*(i-1)].GetCppString();
if(!str.empty())
{
int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i));
int idx = sObjectMgr.GetOrNewIndexForLocale(LocaleConstant(i));
if(idx >= 0)
{
if(data.subject.size() <= size_t(idx))
@ -2176,7 +2176,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
str = fields[1+2*(i-1)+1].GetCppString();
if(!str.empty())
{
int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i));
int idx = sObjectMgr.GetOrNewIndexForLocale(LocaleConstant(i));
if(idx >= 0)
{
if(data.text.size() <= size_t(idx))

View file

@ -323,6 +323,6 @@ class AchievementGlobalMgr
AchievementRewardLocales m_achievementRewardLocales;
};
#define achievementmgr MaNGOS::Singleton<AchievementGlobalMgr>::Instance()
#define sAchievementMgr MaNGOS::Singleton<AchievementGlobalMgr>::Instance()
#endif

View file

@ -50,9 +50,9 @@ ArenaTeam::~ArenaTeam()
bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamName)
{
if(!objmgr.GetPlayer(captainGuid)) // player not exist
if(!sObjectMgr.GetPlayer(captainGuid)) // player not exist
return false;
if(objmgr.GetArenaTeamByName(ArenaTeamName)) // arena team with this name already exist
if(sObjectMgr.GetArenaTeamByName(ArenaTeamName)) // arena team with this name already exist
return false;
sLog.outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), GUID_LOPART(captainGuid));
@ -61,7 +61,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam
m_Name = ArenaTeamName;
m_Type = type;
m_TeamId = objmgr.GenerateArenaTeamId();
m_TeamId = sObjectMgr.GenerateArenaTeamId();
// ArenaTeamName already assigned to ArenaTeam::name, use it to encode string for DB
CharacterDatabase.escape_string(ArenaTeamName);
@ -90,7 +90,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
if(GetMembersSize() >= GetType() * 2)
return false;
Player *pl = objmgr.GetPlayer(PlayerGuid);
Player *pl = sObjectMgr.GetPlayer(PlayerGuid);
if(pl)
{
if(pl->GetArenaTeamId(GetSlot()))
@ -250,7 +250,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult *arenaTeamMembersResult)
void ArenaTeam::SetCaptain(const uint64& guid)
{
// disable remove/promote buttons
Player *oldcaptain = objmgr.GetPlayer(GetCaptain());
Player *oldcaptain = sObjectMgr.GetPlayer(GetCaptain());
if(oldcaptain)
oldcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + ARENA_TEAM_MEMBER, 1);
@ -261,7 +261,7 @@ void ArenaTeam::SetCaptain(const uint64& guid)
CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), m_TeamId);
// enable remove/promote buttons
Player *newcaptain = objmgr.GetPlayer(guid);
Player *newcaptain = sObjectMgr.GetPlayer(guid);
if(newcaptain)
newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + ARENA_TEAM_MEMBER, 0);
}
@ -277,7 +277,7 @@ void ArenaTeam::DelMember(uint64 guid)
}
}
if(Player *player = objmgr.GetPlayer(guid))
if(Player *player = sObjectMgr.GetPlayer(guid))
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
@ -309,7 +309,7 @@ void ArenaTeam::Disband(WorldSession *session)
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", m_TeamId); //< this should be alredy done by calling DelMember(memberGuids[j]); for each member
CharacterDatabase.PExecute("DELETE FROM arena_team_stats WHERE arenateamid = '%u'", m_TeamId);
CharacterDatabase.CommitTransaction();
objmgr.RemoveArenaTeam(m_TeamId);
sObjectMgr.RemoveArenaTeam(m_TeamId);
}
void ArenaTeam::Roster(WorldSession *session)
@ -326,7 +326,7 @@ void ArenaTeam::Roster(WorldSession *session)
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
pl = objmgr.GetPlayer(itr->guid);
pl = sObjectMgr.GetPlayer(itr->guid);
data << uint64(itr->guid); // guid
data << uint8((pl ? 1 : 0)); // online flag
@ -384,7 +384,7 @@ void ArenaTeam::NotifyStatsChanged()
// updates arena team stats for every member of the team (not only the ones who participated!)
for(MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
Player * plr = objmgr.GetPlayer(itr->guid);
Player * plr = sObjectMgr.GetPlayer(itr->guid);
if(plr)
Stats(plr->GetSession());
}
@ -457,7 +457,7 @@ void ArenaTeam::BroadcastPacket(WorldPacket *packet)
{
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
Player *player = objmgr.GetPlayer(itr->guid);
Player *player = sObjectMgr.GetPlayer(itr->guid);
if(player)
player->GetSession()->SendPacket(packet);
}
@ -529,8 +529,8 @@ void ArenaTeam::FinishGame(int32 mod)
m_stats.games_season += 1;
// update team's rank
m_stats.rank = 1;
ObjectMgr::ArenaTeamMap::const_iterator i = objmgr.GetArenaTeamMapBegin();
for ( ; i != objmgr.GetArenaTeamMapEnd(); ++i)
ObjectMgr::ArenaTeamMap::const_iterator i = sObjectMgr.GetArenaTeamMapBegin();
for ( ; i != sObjectMgr.GetArenaTeamMapEnd(); ++i)
{
if (i->second->GetType() == this->m_Type && i->second->GetStats().rating > m_stats.rating)
++m_stats.rank;
@ -561,7 +561,7 @@ int32 ArenaTeam::LostAgainst(uint32 againstRating)
float chance = GetChanceAgainst(m_stats.rating, againstRating);
float K = (m_stats.rating < 1000) ? 48.0f : 32.0f;
// calculate the rating modification (ELO system with k=32 or k=48 if rating<1000)
int32 mod = (int32)floor(K* (1.0f - chance));
int32 mod = (int32)ceil(K * (0.0f - chance));
// modify the team stats accordingly
FinishGame(mod);
@ -578,9 +578,9 @@ void ArenaTeam::MemberLost(Player * plr, uint32 againstRating)
{
// update personal rating
float chance = GetChanceAgainst(itr->personal_rating, againstRating);
float K = (m_stats.rating < 1000) ? 48.0f : 32.0f;
float K = (itr->personal_rating < 1000) ? 48.0f : 32.0f;
// calculate the rating modification (ELO system with k=32 or k=48 if rating<1000)
int32 mod = (int32)floor(K* (1.0f - chance));
int32 mod = (int32)ceil(K * (0.0f - chance));
itr->ModifyPersonalRating(plr, mod, GetSlot());
// update personal played stats
itr->games_week += 1;
@ -602,9 +602,9 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstRating)
{
// update personal rating
float chance = GetChanceAgainst(itr->personal_rating, againstRating);
float K = (m_stats.rating < 1000) ? 48.0f : 32.0f;
float K = (itr->personal_rating < 1000) ? 48.0f : 32.0f;
// calculate the rating modification (ELO system with k=32 or k=48 if rating<1000)
int32 mod = (int32)floor(K* (1.0f - chance));
int32 mod = (int32)ceil(K * (0.0f - chance));
if (int32(itr->personal_rating) + mod < 0)
itr->personal_rating = 0;
else
@ -626,7 +626,7 @@ void ArenaTeam::MemberWon(Player * plr, uint32 againstRating)
{
// update personal rating
float chance = GetChanceAgainst(itr->personal_rating, againstRating);
float K = (m_stats.rating < 1000) ? 48.0f : 32.0f;
float K = (itr->personal_rating < 1000) ? 48.0f : 32.0f;
// calculate the rating modification (ELO system with k=32 or k=48 if rating<1000)
int32 mod = (int32)floor(K* (1.0f - chance));
itr->ModifyPersonalRating(plr, mod, GetSlot());
@ -700,7 +700,7 @@ bool ArenaTeam::IsFighting() const
{
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
if (Player *p = objmgr.GetPlayer(itr->guid))
if (Player *p = sObjectMgr.GetPlayer(itr->guid))
{
if (p->GetMap()->IsBattleArena())
return true;

View file

@ -34,13 +34,13 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data)
recv_data >> guid;
sLog.outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)));
if(Player *plr = objmgr.GetPlayer(guid))
if(Player *plr = sObjectMgr.GetPlayer(guid))
{
for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i)
{
if(uint32 a_id = plr->GetArenaTeamId(i))
{
if(ArenaTeam *at = objmgr.GetArenaTeamById(a_id))
if(ArenaTeam *at = sObjectMgr.GetArenaTeamById(a_id))
at->InspectStats(this, plr->GetGUID());
}
}
@ -54,7 +54,7 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recv_data)
uint32 ArenaTeamId;
recv_data >> ArenaTeamId;
if(ArenaTeam *arenateam = objmgr.GetArenaTeamById(ArenaTeamId))
if(ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId))
{
arenateam->Query(this);
arenateam->Stats(this);
@ -68,7 +68,7 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recv_data)
uint32 ArenaTeamId; // arena team id
recv_data >> ArenaTeamId;
if(ArenaTeam *arenateam = objmgr.GetArenaTeamById(ArenaTeamId))
if(ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId))
arenateam->Roster(this);
}
@ -88,7 +88,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data)
if(!normalizePlayerName(Invitedname))
return;
player = ObjectAccessor::Instance().FindPlayerByName(Invitedname.c_str());
player = ObjectAccessor::FindPlayerByName(Invitedname.c_str());
}
if(!player)
@ -103,7 +103,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data)
return;
}
ArenaTeam *arenateam = objmgr.GetArenaTeamById(ArenaTeamId);
ArenaTeam *arenateam = sObjectMgr.GetArenaTeamById(ArenaTeamId);
if(!arenateam)
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_PLAYER_NOT_IN_TEAM);
@ -154,7 +154,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/)
{
sLog.outDebug("CMSG_ARENA_TEAM_ACCEPT"); // empty opcode
ArenaTeam *at = objmgr.GetArenaTeamById(_player->GetArenaTeamIdInvited());
ArenaTeam *at = sObjectMgr.GetArenaTeamById(_player->GetArenaTeamIdInvited());
if(!at)
return;
@ -164,7 +164,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/)
return;
}
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != objmgr.GetPlayerTeamByGUID(at->GetCaptain()))
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(at->GetCaptain()))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S,"","",ERR_ARENA_TEAM_NOT_ALLIED);// not let enemies sign petition
return;
@ -196,7 +196,7 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data)
uint32 ArenaTeamId; // arena team id
recv_data >> ArenaTeamId;
ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId);
ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId);
if(!at)
return;
@ -233,7 +233,7 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data)
uint32 ArenaTeamId; // arena team id
recv_data >> ArenaTeamId;
if(ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId))
if(ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId))
{
if(at->GetCaptain() != _player->GetGUID())
return;
@ -256,7 +256,7 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recv_data)
recv_data >> ArenaTeamId;
recv_data >> name;
ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId);
ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId);
if(!at) // arena team not found
return;
@ -300,7 +300,7 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recv_data)
recv_data >> ArenaTeamId;
recv_data >> name;
ArenaTeam *at = objmgr.GetArenaTeamById(ArenaTeamId);
ArenaTeam *at = sObjectMgr.GetArenaTeamById(ArenaTeamId);
if(!at) // arena team not found
return;

View file

@ -107,11 +107,11 @@ void WorldSession::SendAuctionOwnerNotification( AuctionEntry* auction)
void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPrice)
{
uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder,0, HIGHGUID_PLAYER);
Player *oldBidder = objmgr.GetPlayer(oldBidder_guid);
Player *oldBidder = sObjectMgr.GetPlayer(oldBidder_guid);
uint32 oldBidder_accId = 0;
if(!oldBidder)
oldBidder_accId = objmgr.GetPlayerAccountIdByGUID(oldBidder_guid);
oldBidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(oldBidder_guid);
// old bidder exist
if(oldBidder || oldBidder_accId)
@ -132,11 +132,11 @@ void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPri
void WorldSession::SendAuctionCancelledToBidderMail( AuctionEntry* auction )
{
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
Player *bidder = objmgr.GetPlayer(bidder_guid);
Player *bidder = sObjectMgr.GetPlayer(bidder_guid);
uint32 bidder_accId = 0;
if(!bidder)
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid);
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
// bidder exist
if(bidder || bidder_accId)
@ -202,7 +202,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
Item *it = pl->GetItemByGuid( item );
//do not allow to sell already auctioned items
if(auctionmgr.GetAItem(GUID_LOPART(item)))
if(sAuctionMgr.GetAItem(GUID_LOPART(item)))
{
sLog.outError("AuctionError, player %s is sending item id: %u, but item is already in another auction", pl->GetName(), GUID_LOPART(item));
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR);
@ -227,10 +227,10 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
return;
}
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
//we have to take deposit :
uint32 deposit = auctionmgr.GetAuctionDeposit( auctionHouseEntry, etime, it );
uint32 deposit = AuctionHouseMgr::GetAuctionDeposit( auctionHouseEntry, etime, it );
if ( pl->GetMoney() < deposit )
{
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_NOT_ENOUGHT_MONEY);
@ -248,7 +248,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
uint32 auction_time = uint32(etime * sWorld.getRate(RATE_AUCTION_TIME));
AuctionEntry *AH = new AuctionEntry;
AH->Id = objmgr.GenerateAuctionID();
AH->Id = sObjectMgr.GenerateAuctionID();
AH->auctioneer = GUID_LOPART(auctioneer);
AH->item_guidlow = GUID_LOPART(item);
AH->item_template = it->GetEntry();
@ -264,7 +264,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
sLog.outDetail("selling item %u to auctioneer %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", GUID_LOPART(item), GUID_LOPART(auctioneer), bid, buyout, auction_time, AH->GetHouseId());
auctionHouse->AddAuction(AH);
auctionmgr.AddAItem(it);
sAuctionMgr.AddAItem(it);
pl->MoveItemFromInventory( it->GetBagSlot(), it->GetSlot(), true);
CharacterDatabase.BeginTransaction();
@ -300,7 +300,7 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
AuctionEntry *auction = auctionHouse->GetAuction(auctionId);
Player *pl = GetPlayer();
@ -313,8 +313,8 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
}
// impossible have online own another character (use this for speedup check in case online owner)
Player* auction_owner = objmgr.GetPlayer(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER));
if( !auction_owner && objmgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)) == pl->GetSession()->GetAccountId())
Player* auction_owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER));
if( !auction_owner && sObjectMgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)) == pl->GetSession()->GetAccountId())
{
//you cannot bid your another character auction:
SendAuctionCommandResult( 0, AUCTION_PLACE_BID, CANNOT_BID_YOUR_AUCTION_ERROR );
@ -387,13 +387,13 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
auction->bid = auction->buyout;
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout);
auctionmgr.SendAuctionSalePendingMail( auction );
auctionmgr.SendAuctionSuccessfulMail( auction );
auctionmgr.SendAuctionWonMail( auction );
sAuctionMgr.SendAuctionSalePendingMail( auction );
sAuctionMgr.SendAuctionSuccessfulMail( auction );
sAuctionMgr.SendAuctionWonMail( auction );
SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK);
auctionmgr.RemoveAItem(auction->item_guidlow);
sAuctionMgr.RemoveAItem(auction->item_guidlow);
auctionHouse->RemoveAuction(auction->Id);
auction->DeleteFromDB();
@ -424,14 +424,14 @@ void WorldSession::HandleAuctionRemoveItem( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
AuctionEntry *auction = auctionHouse->GetAuction(auctionId);
Player *pl = GetPlayer();
if (auction && auction->owner == pl->GetGUIDLow())
{
Item *pItem = auctionmgr.GetAItem(auction->item_guidlow);
Item *pItem = sAuctionMgr.GetAItem(auction->item_guidlow);
if (pItem)
{
if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid
@ -474,7 +474,7 @@ void WorldSession::HandleAuctionRemoveItem( WorldPacket & recv_data )
auction->DeleteFromDB();
pl->SaveInventoryAndGoldToDB();
CharacterDatabase.CommitTransaction();
auctionmgr.RemoveAItem( auction->item_guidlow );
sAuctionMgr.RemoveAItem( auction->item_guidlow );
auctionHouse->RemoveAuction( auction->Id );
delete auction;
}
@ -506,7 +506,7 @@ void WorldSession::HandleAuctionListBidderItems( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
WorldPacket data( SMSG_AUCTION_BIDDER_LIST_RESULT, (4+4+4) );
Player *pl = GetPlayer();
@ -553,7 +553,7 @@ void WorldSession::HandleAuctionListOwnerItems( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
WorldPacket data( SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4) );
data << (uint32) 0; // amount place holder
@ -597,7 +597,7 @@ void WorldSession::HandleAuctionListItems( WorldPacket & recv_data )
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap( pCreature->getFaction() );
//sLog.outDebug("Auctionhouse search (GUID: %u TypeId: %u)", , list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
// GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);

View file

@ -79,7 +79,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
return;
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
Player *bidder = objmgr.GetPlayer(bidder_guid);
Player *bidder = sObjectMgr.GetPlayer(bidder_guid);
uint32 bidder_accId = 0;
@ -96,30 +96,30 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
}
else
{
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid);
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
bidder_security = accmgr.GetSecurity(bidder_accId);
if(bidder_security > SEC_PLAYER ) // not do redundant DB requests
{
if(!objmgr.GetPlayerNameByGUID(bidder_guid,bidder_name))
bidder_name = objmgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
if(!sObjectMgr.GetPlayerNameByGUID(bidder_guid,bidder_name))
bidder_name = sObjectMgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
}
}
if( bidder_security > SEC_PLAYER )
{
std::string owner_name;
if(!objmgr.GetPlayerNameByGUID(auction->owner,owner_name))
owner_name = objmgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
if(!sObjectMgr.GetPlayerNameByGUID(auction->owner,owner_name))
owner_name = sObjectMgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
uint32 owner_accid = objmgr.GetPlayerAccountIdByGUID(auction->owner);
uint32 owner_accid = sObjectMgr.GetPlayerAccountIdByGUID(auction->owner);
sLog.outCommand(bidder_accId,"GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)",
bidder_name.c_str(),bidder_accId,pItem->GetProto()->Name1,pItem->GetEntry(),pItem->GetCount(),auction->bid,owner_name.c_str(),owner_accid);
}
}
else if(!bidder)
bidder_accId = objmgr.GetPlayerAccountIdByGUID(bidder_guid);
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
// receiver exist
if(bidder || bidder_accId)
@ -134,7 +134,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
sLog.outDebug( "AuctionWon body string : %s", msgAuctionWonBody.str().c_str() );
//prepare mail data... :
uint32 itemTextId = objmgr.CreateItemText( msgAuctionWonBody.str() );
uint32 itemTextId = sObjectMgr.CreateItemText( msgAuctionWonBody.str() );
// set owner to bidder (to prevent delete item with sender char deleting)
// owner in `data` will set at mail receive and item extracting
@ -163,10 +163,10 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
{
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
Player *owner = objmgr.GetPlayer(owner_guid);
Player *owner = sObjectMgr.GetPlayer(owner_guid);
// owner exist (online or offline)
if(owner || objmgr.GetPlayerAccountIdByGUID(owner_guid))
if(owner || sObjectMgr.GetPlayerAccountIdByGUID(owner_guid))
{
std::ostringstream msgAuctionSalePendingSubject;
msgAuctionSalePendingSubject << auction->item_template << ":0:" << AUCTION_SALE_PENDING;
@ -184,7 +184,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
sLog.outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str());
uint32 itemTextId = objmgr.CreateItemText( msgAuctionSalePendingBody.str() );
uint32 itemTextId = sObjectMgr.CreateItemText( msgAuctionSalePendingBody.str() );
MailDraft(msgAuctionSalePendingSubject.str(), itemTextId)
.SendMailTo(MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_AUCTION);
@ -195,11 +195,11 @@ void AuctionHouseMgr::SendAuctionSalePendingMail( AuctionEntry * auction )
void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction )
{
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
Player *owner = objmgr.GetPlayer(owner_guid);
Player *owner = sObjectMgr.GetPlayer(owner_guid);
uint32 owner_accId = 0;
if(!owner)
owner_accId = objmgr.GetPlayerAccountIdByGUID(owner_guid);
owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
// owner exist
if(owner || owner_accId)
@ -217,7 +217,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction )
sLog.outDebug("AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str());
uint32 itemTextId = objmgr.CreateItemText( auctionSuccessfulBody.str() );
uint32 itemTextId = sObjectMgr.CreateItemText( auctionSuccessfulBody.str() );
uint32 profit = auction->bid + auction->deposit - auctionCut;
@ -246,11 +246,11 @@ void AuctionHouseMgr::SendAuctionExpiredMail( AuctionEntry * auction )
}
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
Player *owner = objmgr.GetPlayer(owner_guid);
Player *owner = sObjectMgr.GetPlayer(owner_guid);
uint32 owner_accId = 0;
if(!owner)
owner_accId = objmgr.GetPlayerAccountIdByGUID(owner_guid);
owner_accId = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid);
// owner exist
if(owner || owner_accId)
@ -304,7 +304,7 @@ void AuctionHouseMgr::LoadAuctionItems()
uint32 item_guid = fields[1].GetUInt32();
uint32 item_template = fields[2].GetUInt32();
ItemPrototype const *proto = objmgr.GetItemPrototype(item_template);
ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template);
if(!proto)
{
@ -388,7 +388,7 @@ void AuctionHouseMgr::LoadAuctions()
aItem->startbid = fields[9].GetUInt32();
aItem->deposit = fields[10].GetUInt32();
CreatureData const* auctioneerData = objmgr.GetCreatureData(aItem->auctioneer);
CreatureData const* auctioneerData = sObjectMgr.GetCreatureData(aItem->auctioneer);
if(!auctioneerData)
{
aItem->DeleteFromDB();
@ -397,7 +397,7 @@ void AuctionHouseMgr::LoadAuctions()
continue;
}
CreatureInfo const* auctioneerInfo = objmgr.GetCreatureTemplate(auctioneerData->id);
CreatureInfo const* auctioneerInfo = ObjectMgr::GetCreatureTemplate(auctioneerData->id);
if(!auctioneerInfo)
{
aItem->DeleteFromDB();
@ -514,7 +514,7 @@ void AuctionHouseObject::Update()
///- Either cancel the auction if there was no bidder
if (itr->second->bidder == 0)
{
auctionmgr.SendAuctionExpiredMail( itr->second );
sAuctionMgr.SendAuctionExpiredMail( itr->second );
}
///- Or perform the transaction
else
@ -522,13 +522,13 @@ void AuctionHouseObject::Update()
//we should send an "item sold" message if the seller is online
//we send the item to the winner
//we send the money to the seller
auctionmgr.SendAuctionSuccessfulMail( itr->second );
auctionmgr.SendAuctionWonMail( itr->second );
sAuctionMgr.SendAuctionSuccessfulMail( itr->second );
sAuctionMgr.SendAuctionWonMail( itr->second );
}
///- In any case clear the auction
itr->second->DeleteFromDB();
auctionmgr.RemoveAItem(itr->second->item_guidlow);
sAuctionMgr.RemoveAItem(itr->second->item_guidlow);
delete itr->second;
RemoveAuction(itr->first);
}
@ -573,7 +573,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin();itr != AuctionsMap.end();++itr)
{
AuctionEntry *Aentry = itr->second;
Item *item = auctionmgr.GetAItem(Aentry->item_guidlow);
Item *item = sAuctionMgr.GetAItem(Aentry->item_guidlow);
if (!item)
continue;
@ -604,7 +604,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
// local name
if ( loc_idx >= 0 )
{
ItemLocale const *il = objmgr.GetItemLocale(proto->ItemId);
ItemLocale const *il = sObjectMgr.GetItemLocale(proto->ItemId);
if (il)
{
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
@ -627,7 +627,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
//this function inserts to WorldPacket auction's data
bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
{
Item *pItem = auctionmgr.GetAItem(item_guidlow);
Item *pItem = sAuctionMgr.GetAItem(item_guidlow);
if (!pItem)
{
sLog.outError("auction to item, that doesn't exist !!!!");

View file

@ -160,6 +160,6 @@ class AuctionHouseMgr
ItemMap mAitems;
};
#define auctionmgr MaNGOS::Singleton<AuctionHouseMgr>::Instance()
#define sAuctionMgr MaNGOS::Singleton<AuctionHouseMgr>::Instance()
#endif

View file

@ -60,7 +60,7 @@ void Bag::RemoveFromWorld()
bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner)
{
ItemPrototype const * itemProto = objmgr.GetItemPrototype(itemid);
ItemPrototype const * itemProto = ObjectMgr::GetItemPrototype(itemid);
if(!itemProto || itemProto->ContainerSlots > MAX_BAG_SIZE)
return false;

View file

@ -42,7 +42,7 @@ namespace MaNGOS
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_args(args) {}
void operator()(WorldPacket& data, int32 loc_idx)
{
char const* text = objmgr.GetMangosString(i_textId,loc_idx);
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
if (i_args)
{
@ -87,7 +87,7 @@ namespace MaNGOS
: i_language(language), i_textId(textId), i_source(source), i_args(args) {}
void operator()(WorldPacket& data, int32 loc_idx)
{
char const* text = objmgr.GetMangosString(i_textId,loc_idx);
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
if(i_args)
{
@ -134,9 +134,9 @@ namespace MaNGOS
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {}
void operator()(WorldPacket& data, int32 loc_idx)
{
char const* text = objmgr.GetMangosString(i_textId,loc_idx);
char const* arg1str = i_arg1 ? objmgr.GetMangosString(i_arg1,loc_idx) : "";
char const* arg2str = i_arg2 ? objmgr.GetMangosString(i_arg2,loc_idx) : "";
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
char const* arg1str = i_arg1 ? sObjectMgr.GetMangosString(i_arg1,loc_idx) : "";
char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2,loc_idx) : "";
char str [2048];
snprintf(str,2048,text, arg1str, arg2str );
@ -168,9 +168,9 @@ namespace MaNGOS
: i_language(language), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {}
void operator()(WorldPacket& data, int32 loc_idx)
{
char const* text = objmgr.GetMangosString(i_textId,loc_idx);
char const* arg1str = i_arg1 ? objmgr.GetMangosString(i_arg1,loc_idx) : "";
char const* arg2str = i_arg2 ? objmgr.GetMangosString(i_arg2,loc_idx) : "";
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
char const* arg1str = i_arg1 ? sObjectMgr.GetMangosString(i_arg1,loc_idx) : "";
char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2,loc_idx) : "";
char str [2048];
snprintf(str,2048,text, arg1str, arg2str );
@ -455,7 +455,7 @@ void BattleGround::Update(uint32 diff)
//TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player *plr = objmgr.GetPlayer(itr->first))
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
CheckArenaWinConditions();
@ -466,7 +466,7 @@ void BattleGround::Update(uint32 diff)
PlaySoundToAll(SOUND_BG_START);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player* plr = objmgr.GetPlayer(itr->first))
if (Player* plr = sObjectMgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
//Announce BG starting
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
@ -517,7 +517,7 @@ void BattleGround::SendPacketToAll(WorldPacket *packet)
{
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (plr)
plr->GetSession()->SendPacket(packet);
else
@ -529,7 +529,7 @@ void BattleGround::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *
{
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
@ -561,7 +561,7 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
@ -584,7 +584,7 @@ void BattleGround::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
{
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
@ -604,7 +604,7 @@ void BattleGround::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
{
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
@ -629,7 +629,7 @@ void BattleGround::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
@ -698,8 +698,8 @@ void BattleGround::EndBattleGround(uint32 winner)
// arena rating calculation
if (isArena() && isRated())
{
winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner));
loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner));
loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
if (winner_arena_team && loser_arena_team)
{
loser_rating = loser_arena_team->GetStats().rating;
@ -719,7 +719,7 @@ void BattleGround::EndBattleGround(uint32 winner)
for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
uint32 team = itr->second.Team;
if (!plr)
@ -924,7 +924,7 @@ void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count)
if (!bmEntry)
return;
ItemPrototype const* markProto = objmgr.GetItemPrototype(mark);
ItemPrototype const* markProto = ObjectMgr::GetItemPrototype(mark);
if (!markProto)
return;
@ -937,7 +937,7 @@ void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count)
std::string subject = markProto->Name1;
int loc_idx = plr->GetSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0 )
if (ItemLocale const *il = objmgr.GetItemLocale(markProto->ItemId))
if (ItemLocale const *il = sObjectMgr.GetItemLocale(markProto->ItemId))
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
subject = il->Name[loc_idx];
@ -945,7 +945,7 @@ void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count)
std::string textFormat = plr->GetSession()->GetMangosString(LANG_BG_MARK_BY_MAIL);
char textBuf[300];
snprintf(textBuf,300,textFormat.c_str(),GetName(),GetName());
uint32 itemTextId = objmgr.CreateItemText( textBuf );
uint32 itemTextId = sObjectMgr.CreateItemText( textBuf );
MailDraft(subject, itemTextId)
.AddItem(markItem)
@ -1003,7 +1003,7 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
m_PlayerScores.erase(itr2);
}
Player *plr = objmgr.GetPlayer(guid);
Player *plr = sObjectMgr.GetPlayer(guid);
// should remove spirit of redemption
if (plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
@ -1040,8 +1040,8 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{
//left a rated match while the encounter was in progress, consider as loser
ArenaTeam * winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam * loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
ArenaTeam * winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam * loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
if (winner_arena_team && loser_arena_team)
loser_arena_team->MemberLost(plr,winner_arena_team->GetRating());
}
@ -1062,8 +1062,8 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{
//left a rated match while the encounter was in progress, consider as loser
ArenaTeam * others_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam * players_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
ArenaTeam * others_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam * players_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
if (others_arena_team && players_arena_team)
players_arena_team->OfflineMemberLost(guid, others_arena_team->GetRating());
}
@ -1084,7 +1084,7 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
{
// a player has left the battleground, so there are free slots -> add to queue
AddToBGFreeSlotQueue();
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, GetQueueId());
sBattleGroundMgr.ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, GetQueueId());
}
// Let others know
@ -1384,7 +1384,7 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float
// and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created
// so we must create it specific for this instance
GameObject * go = new GameObject;
if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(),
if(!go->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(),
PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY))
{
sLog.outErrorDb("Gameobject template %u not found in database! BattleGround not created!", entry);
@ -1397,7 +1397,7 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float
// without this, UseButtonOrDoor caused the crash, since it tried to get go info from godata
// iirc that was changed, so adding to go data map is no longer required if that was the only function using godata from GameObject without checking if it existed
GameObjectData& data = objmgr.NewGOData(guid);
GameObjectData& data = sObjectMgr.NewGOData(guid);
data.id = entry;
data.mapid = GetMapId();
@ -1727,7 +1727,7 @@ void BattleGround::HandleKillPlayer( Player *player, Player *killer )
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr || plr == killer)
continue;
@ -1784,7 +1784,7 @@ uint32 BattleGround::GetAlivePlayersCountByTeam(uint32 Team) const
{
if (itr->second.Team == Team)
{
Player * pl = objmgr.GetPlayer(itr->first);
Player * pl = sObjectMgr.GetPlayer(itr->first);
if (pl && pl->isAlive())
++count;
}
@ -1810,7 +1810,7 @@ void BattleGround::SetBgRaid( uint32 TeamID, Group *bg_raid )
WorldSafeLocsEntry const* BattleGround::GetClosestGraveYard( Player* player )
{
return objmgr.GetClosestGraveYard( player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetTeam() );
return sObjectMgr.GetClosestGraveYard( player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetTeam() );
}
bool BattleGround::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const

View file

@ -131,7 +131,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
uint8 j = 0;
while (j < m_PlayersNearPoint[BG_EY_NODES_MAX].size())
{
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[BG_EY_NODES_MAX][j]);
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[BG_EY_NODES_MAX][j]);
if (!plr)
{
sLog.outError("BattleGroundEY: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[BG_EY_NODES_MAX][j]));
@ -167,7 +167,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
uint8 j = 0;
while (j < m_PlayersNearPoint[i].size())
{
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[i][j]);
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[i][j]);
if (!plr)
{
sLog.outError("BattleGroundEY: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
@ -222,7 +222,7 @@ void BattleGroundEY::UpdatePointStatuses()
for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i)
{
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[point][i]);
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i]);
if (plr)
{
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr);

View file

@ -148,8 +148,9 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
// if we're here, then the conditions to join a bg are met. We can proceed in joining.
// _player->GetGroup() was already checked, grp is already initialized
GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, 0, false, isPremade, 0);
uint32 avgTime = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundQueueIdFromLevel());
BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId];
GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, bgTypeId, 0, false, isPremade, 0);
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundQueueIdFromLevel());
if (joinAsGroup /* && _player->GetGroup()*/)
{
sLog.outDebug("Battleground: the following players are joining as group:");
@ -166,7 +167,7 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
member->GetSession()->SendPacket(&data);
sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, bgTypeId);
member->GetSession()->SendPacket(&data);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddPlayer(member, ginfo);
bgQueue.AddPlayer(member, ginfo);
sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName());
}
sLog.outDebug("Battleground: group end");
@ -181,12 +182,11 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType);
SendPacket(&data);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddPlayer(_player, ginfo);
bgQueue.AddPlayer(_player, ginfo);
sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName());
}
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel());
if (!ginfo->IsInvitedToBGInstanceGUID)
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AnnounceWorld(ginfo, _player->GetGUID(), true);
sBattleGroundMgr.ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, _player->GetBattleGroundQueueIdFromLevel());
//we should announce queue status here, if we want
}
void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv_data*/ )
@ -205,11 +205,11 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv
uint32 count1 = 0; //always constant zero?
uint32 count2 = 0; //count of next fields
Player *ali_plr = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID());
Player *ali_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID());
if (ali_plr)
++count2;
Player *horde_plr = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID());
Player *horde_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID());
if (horde_plr)
++count2;
@ -303,7 +303,6 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
uint8 type; // arenatype if arena
uint8 unk2; // unk, can be 0x0 (may be if was invited?) and 0x1
uint32 instanceId;
uint32 bgTypeId_; // type id from dbc
uint16 unk; // 0x1F90 constant?
uint8 action; // enter battle 0x1, leave queue 0x0
@ -312,183 +311,131 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
{
sLog.outError("Battleground: invalid bgtype (%u) received.", bgTypeId_);
// update battleground slots for the player to fix his UI and sent data.
// this is a HACK, I don't know why the client starts sending invalid packets in the first place.
// it usually happens with extremely high latency (if debugging / stepping in the code for example)
if (_player->InBattleGroundQueue())
{
// update all queues, send invitation info if player is invited, queue info if queued
for (uint32 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
{
BattleGroundQueueTypeId bgQueueTypeId = _player->GetBattleGroundQueueTypeId(i);
if (!bgQueueTypeId)
continue;
BattleGroundTypeId bgTypeId = BattleGroundMgr::BGTemplateId(bgQueueTypeId);
BattleGroundQueue::QueuedPlayersMap& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers;
BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = qpMap.find(_player->GetGUID());
// if the player is not in queue, continue or no group information - this should never happen
if (itrPlayerStatus == qpMap.end() || !itrPlayerStatus->second.GroupInfo)
continue;
BattleGround * bg = NULL;
// get possibly needed data from groupinfo
uint8 arenatype = itrPlayerStatus->second.GroupInfo->ArenaType;
uint8 status = 0;
if (!itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID)
{
// not invited to bg, get template
bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
status = STATUS_WAIT_QUEUE;
}
else
{
// get the bg we're invited to
bg = sBattleGroundMgr.GetBattleGround(itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID, bgTypeId);
status = STATUS_WAIT_JOIN;
}
// if bg not found, then continue, don't invite if already in the instance
if (!bg || (_player->InBattleGround() && _player->GetBattleGround() && _player->GetBattleGround()->GetInstanceID() == bg->GetInstanceID()))
continue;
// re - invite player with proper data
WorldPacket data;
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, i, status, INVITE_ACCEPT_WAIT_TIME, 0, arenatype);
SendPacket(&data);
}
}
sLog.outError("BattlegroundHandler: invalid bgtype (%u) received.", bgTypeId_);
return;
}
if (!_player->InBattleGroundQueue())
{
sLog.outError("BattlegroundHandler: Invalid CMSG_BATTLEFIELD_PORT received from player (%u), he is not in bg_queue.", _player->GetGUIDLow());
return;
}
//get GroupQueueInfo from BattleGroundQueue
BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_);
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, type);
BattleGroundQueue::QueuedPlayersMap& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers;
BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = qpMap.find(_player->GetGUID());
if (itrPlayerStatus == qpMap.end())
BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId];
//we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattleGroundQueue::RemovePlayer() function
GroupQueueInfo ginfo;
if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo))
{
sLog.outError("Battleground: itrplayerstatus not found.");
sLog.outError("BattlegroundHandler: itrplayerstatus not found.");
return;
}
instanceId = itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID;
// if action == 1, then instanceId is required
if (!instanceId && action == 1)
if (!ginfo.IsInvitedToBGInstanceGUID && action == 1)
{
sLog.outError("Battleground: instance not found.");
sLog.outError("BattlegroundHandler: instance not found.");
return;
}
BattleGround *bg = sBattleGroundMgr.GetBattleGround(instanceId, bgTypeId);
BattleGround *bg = sBattleGroundMgr.GetBattleGround(ginfo.IsInvitedToBGInstanceGUID, bgTypeId);
// bg template might and must be used in case of leaving queue, when instance is not created yet
if (!bg && action == 0)
bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
if (!bg)
{
sLog.outError("Battleground: bg_template not found for type id %u.", bgTypeId);
sLog.outError("BattlegroundHandler: bg_template not found for type id %u.", bgTypeId);
return;
}
if (_player->InBattleGroundQueue())
//some checks if player isn't cheating - it is not exactly cheating, but we cannot allow it
if (action == 1 && ginfo.ArenaType == 0)
{
//we must use temporary variables, because GroupQueueInfo pointer can be deleted in BattleGroundQueue::RemovePlayer() function!
uint32 team = itrPlayerStatus->second.GroupInfo->Team;
uint32 arenaType = itrPlayerStatus->second.GroupInfo->ArenaType;
uint32 isRated = itrPlayerStatus->second.GroupInfo->IsRated;
uint32 rating = itrPlayerStatus->second.GroupInfo->ArenaTeamRating;
uint32 opponentsRating = itrPlayerStatus->second.GroupInfo->OpponentsTeamRating;
//some checks if player isn't cheating - it is not exactly cheating, but we cannot allow it
if (action == 1 && arenaType == 0)
//if player is trying to enter battleground (not arena!) and he has deserter debuff, we must just remove him from queue
if (!_player->CanJoinToBattleground())
{
//if player is trying to enter battleground (not arena!) and he has deserter debuff, we must just remove him from queue
if (!_player->CanJoinToBattleground())
{
//send bg command result to show nice message
WorldPacket data2(SMSG_GROUP_JOINED_BATTLEGROUND, 4);
data2 << uint32(0xFFFFFFFE);
_player->GetSession()->SendPacket(&data2);
action = 0;
sLog.outDebug("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow());
}
//if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue
if (_player->getLevel() > bg->GetMaxLevel())
{
sLog.outError("Battleground: Player %s (%u) has level higher than maxlevel of battleground! Do not port him to battleground!", _player->GetName(), _player->GetGUIDLow());
action = 0;
}
//send bg command result to show nice message
WorldPacket data2(SMSG_GROUP_JOINED_BATTLEGROUND, 4);
data2 << uint32(0xFFFFFFFE);
_player->GetSession()->SendPacket(&data2);
action = 0;
sLog.outDebug("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow());
}
uint32 queueSlot = _player->GetBattleGroundQueueIndex(bgQueueTypeId);
WorldPacket data;
switch( action )
//if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue
if (_player->getLevel() > bg->GetMaxLevel())
{
case 1: // port to battleground
if (!_player->IsInvitedForBattleGroundQueueType(bgQueueTypeId))
return; // cheating?
_player->SetBattleGroundEntryPoint();
// resurrect the player
if (!_player->isAlive())
{
_player->ResurrectPlayer(1.0f);
_player->SpawnCorpseBones();
}
// stop taxi flight at port
if (_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
_player->m_taxi.ClearTaxiDestinations();
}
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType());
_player->GetSession()->SendPacket(&data);
// remove battleground queue status from BGmgr
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].RemovePlayer(_player->GetGUID(), false);
// this is still needed here if battleground "jumping" shouldn't add deserter debuff
// also this is required to prevent stuck at old battleground after SetBattleGroundId set to new
if (BattleGround *currentBg = _player->GetBattleGround())
currentBg->RemovePlayerAtLeave(_player->GetGUID(), false, true);
// set the destination instance id
_player->SetBattleGroundId(bg->GetInstanceID(), bgTypeId);
// set the destination team
_player->SetBGTeam(team);
// bg->HandleBeforeTeleportToBattleGround(_player);
sBattleGroundMgr.SendToBattleGround(_player, instanceId, bgTypeId);
// add only in HandleMoveWorldPortAck()
// bg->AddPlayer(_player,team);
sLog.outDebug("Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId);
break;
case 0: // leave queue
// if player leaves rated arena match before match start, it is counted as he played but he lost
if (isRated)
{
ArenaTeam * at = objmgr.GetArenaTeamById(team);
if (at)
{
sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), opponentsRating);
at->MemberLost(_player, opponentsRating);
at->SaveToDB();
}
}
_player->RemoveBattleGroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].RemovePlayer(_player->GetGUID(), true);
// player left queue, we should update it - do not update Arena Queue
if (!arenaType)
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel(), arenaType, isRated, rating);
SendPacket(&data);
sLog.outDebug("Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId);
break;
default:
sLog.outError("Battleground port: unknown action %u", action);
break;
sLog.outError("Battleground: Player %s (%u) has level higher than maxlevel of battleground! Do not port him to battleground!", _player->GetName(), _player->GetGUIDLow());
action = 0;
}
}
uint32 queueSlot = _player->GetBattleGroundQueueIndex(bgQueueTypeId);
WorldPacket data;
switch( action )
{
case 1: // port to battleground
if (!_player->IsInvitedForBattleGroundQueueType(bgQueueTypeId))
return; // cheating?
_player->SetBattleGroundEntryPoint();
// resurrect the player
if (!_player->isAlive())
{
_player->ResurrectPlayer(1.0f);
_player->SpawnCorpseBones();
}
// stop taxi flight at port
if (_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
_player->m_taxi.ClearTaxiDestinations();
}
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType());
_player->GetSession()->SendPacket(&data);
// remove battleground queue status from BGmgr
bgQueue.RemovePlayer(_player->GetGUID(), false);
// this is still needed here if battleground "jumping" shouldn't add deserter debuff
// also this is required to prevent stuck at old battleground after SetBattleGroundId set to new
if (BattleGround *currentBg = _player->GetBattleGround())
currentBg->RemovePlayerAtLeave(_player->GetGUID(), false, true);
// set the destination instance id
_player->SetBattleGroundId(bg->GetInstanceID(), bgTypeId);
// set the destination team
_player->SetBGTeam(ginfo.Team);
// bg->HandleBeforeTeleportToBattleGround(_player);
sBattleGroundMgr.SendToBattleGround(_player, ginfo.IsInvitedToBGInstanceGUID, bgTypeId);
// add only in HandleMoveWorldPortAck()
// bg->AddPlayer(_player,team);
sLog.outDebug("Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId);
break;
case 0: // leave queue
// if player leaves rated arena match before match start, it is counted as he played but he lost
if (ginfo.IsRated)
{
ArenaTeam * at = sObjectMgr.GetArenaTeamById(ginfo.Team);
if (at)
{
sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), ginfo.OpponentsTeamRating);
at->MemberLost(_player, ginfo.OpponentsTeamRating);
at->SaveToDB();
}
}
_player->RemoveBattleGroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0);
bgQueue.RemovePlayer(_player->GetGUID(), true);
// player left queue, we should update it - do not update Arena Queue
if (!ginfo.ArenaType)
sBattleGroundMgr.ScheduleQueueUpdate(ginfo.ArenaTeamRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, _player->GetBattleGroundQueueIdFromLevel());
SendPacket(&data);
sLog.outDebug("Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId);
break;
default:
sLog.outError("Battleground port: unknown action %u", action);
break;
}
}
void WorldSession::HandleLeaveBattlefieldOpcode( WorldPacket & /*recv_data*/ )
@ -544,16 +491,16 @@ void WorldSession::HandleBattlefieldStatusOpcode( WorldPacket & /*recv_data*/ )
}
//we are sending update to player about queue - he can be invited there!
//get GroupQueueInfo for queue status
BattleGroundQueue::QueuedPlayersMap& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers;
BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = qpMap.find(_player->GetGUID());
if (itrPlayerStatus == qpMap.end())
BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId];
GroupQueueInfo ginfo;
if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo))
continue;
if (itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID)
if (ginfo.IsInvitedToBGInstanceGUID)
{
bg = sBattleGroundMgr.GetBattleGround(itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID, bgTypeId);
bg = sBattleGroundMgr.GetBattleGround(ginfo.IsInvitedToBGInstanceGUID, bgTypeId);
if (!bg)
continue;
uint32 remainingTime = getMSTimeDiff(getMSTime(), itrPlayerStatus->second.GroupInfo->RemoveInviteTime);
uint32 remainingTime = getMSTimeDiff(getMSTime(), ginfo.RemoveInviteTime);
// send status invited to BattleGround
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, i, STATUS_WAIT_JOIN, remainingTime, 0, arenaType);
SendPacket(&data);
@ -563,9 +510,9 @@ void WorldSession::HandleBattlefieldStatusOpcode( WorldPacket & /*recv_data*/ )
bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
if (!bg)
continue;
uint32 avgTime = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].GetAverageQueueWaitTime(itrPlayerStatus->second.GroupInfo, _player->GetBattleGroundQueueIdFromLevel());
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(&ginfo, _player->GetBattleGroundQueueIdFromLevel());
// send status in BattleGround Queue
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(itrPlayerStatus->second.GroupInfo->JoinTime, getMSTime()), arenaType);
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(ginfo.JoinTime, getMSTime()), arenaType);
SendPacket(&data);
}
}
@ -698,7 +645,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
{
ateamId = _player->GetArenaTeamId(arenaslot);
// check real arenateam existence only here (if it was moved to group->CanJoin .. () then we would ahve to get it twice)
ArenaTeam * at = objmgr.GetArenaTeamById(ateamId);
ArenaTeam * at = sObjectMgr.GetArenaTeamById(ateamId);
if (!at)
{
_player->GetSession()->SendNotInArenaTeamPacket(arenatype);
@ -725,8 +672,9 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
arenaRating = avg_pers_rating;
}
GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, arenatype, isRated, false, arenaRating, ateamId);
uint32 avgTime = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundQueueIdFromLevel());
BattleGroundQueue &bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId];
GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, bgTypeId, arenatype, isRated, false, arenaRating, ateamId);
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundQueueIdFromLevel());
if (asGroup)
{
sLog.outDebug("Battleground: arena join as group start");
@ -745,12 +693,11 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
member->GetSession()->SendPacket(&data);
sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, bgTypeId);
member->GetSession()->SendPacket(&data);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddPlayer(member, ginfo);
bgQueue.AddPlayer(member, ginfo);
sLog.outDebug("Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName());
}
sLog.outDebug("Battleground: arena join as group end");
if (isRated)
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AnnounceWorld(ginfo, _player->GetGUID(), true);
//announce to world ... removed
}
else
{
@ -760,17 +707,17 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
// send status packet (in queue)
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype);
SendPacket(&data);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddPlayer(_player, ginfo);
bgQueue.AddPlayer(_player, ginfo);
sLog.outDebug("Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName());
}
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel(), arenatype, isRated, arenaRating);
sBattleGroundMgr.ScheduleQueueUpdate(arenaRating, arenatype, bgQueueTypeId, bgTypeId, _player->GetBattleGroundQueueIdFromLevel());
}
void WorldSession::HandleReportPvPAFK( WorldPacket & recv_data )
{
uint64 playerGuid;
recv_data >> playerGuid;
Player *reportedPlayer = objmgr.GetPlayer(playerGuid);
Player *reportedPlayer = sObjectMgr.GetPlayer(playerGuid);
if (!reportedPlayer)
{

View file

@ -177,6 +177,7 @@ GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, BattleGroundTypeId
index++;
sLog.outDebug("Adding Group to BattleGroundQueue bgTypeId : %u, queue_id : %u, index : %u", BgTypeId, queue_id, index);
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
m_QueuedGroups[queue_id][index].push_back(ginfo);
// return ginfo, because it is needed to add players to this group info
@ -186,6 +187,8 @@ GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, BattleGroundTypeId
//add player to playermap
void BattleGroundQueue::AddPlayer(Player *plr, GroupQueueInfo *ginfo)
{
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
//if player isn't in queue, he is added, if already is, then values are overwritten, no memory leak
PlayerQueueInfo& info = m_QueuedPlayers[plr->GetGUID()];
info.LastOnlineTime = getMSTime();
@ -247,7 +250,8 @@ uint32 BattleGroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BGQueue
//remove player from queue and from group info, if group info is empty then remove it too
void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCount)
{
//Player *plr = objmgr.GetPlayer(guid);
//Player *plr = sObjectMgr.GetPlayer(guid);
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
int32 queue_id = -1; // signed for proper for-loop finish
QueuedPlayersMap::iterator itr;
@ -322,11 +326,11 @@ void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
//if player leaves queue and he is invited to rated arena match, then he have to loose
if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount)
{
ArenaTeam * at = objmgr.GetArenaTeamById(group->ArenaTeamId);
ArenaTeam * at = sObjectMgr.GetArenaTeamById(group->ArenaTeamId);
if (at)
{
sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
Player *plr = objmgr.GetPlayer(guid);
Player *plr = sObjectMgr.GetPlayer(guid);
if (plr)
at->MemberLost(plr, group->OpponentsTeamRating);
else
@ -348,7 +352,7 @@ void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
{
// remove next player, this is recursive
// first send removal information
if (Player *plr2 = objmgr.GetPlayer(group->Players.begin()->first))
if (Player *plr2 = sObjectMgr.GetPlayer(group->Players.begin()->first))
{
BattleGround * bg = sBattleGroundMgr.GetBattleGroundTemplate(group->BgTypeId);
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(group->BgTypeId, group->ArenaType);
@ -364,6 +368,26 @@ void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
}
}
//returns true when player pl_guid is in queue and is invited to bgInstanceGuid
bool BattleGroundQueue::IsPlayerInvited(const uint64& pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime)
{
ACE_Guard<ACE_Recursive_Thread_Mutex> g(m_Lock);
QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(pl_guid);
return ( qItr != m_QueuedPlayers.end()
&& qItr->second.GroupInfo->IsInvitedToBGInstanceGUID == bgInstanceGuid
&& qItr->second.GroupInfo->RemoveInviteTime == removeTime );
}
bool BattleGroundQueue::GetPlayerGroupInfoData(const uint64& guid, GroupQueueInfo* ginfo)
{
ACE_Guard<ACE_Recursive_Thread_Mutex> g(m_Lock);
QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(guid);
if (qItr == m_QueuedPlayers.end())
return false;
*ginfo = *(qItr->second.GroupInfo);
return true;
}
//Announce world message
void BattleGroundQueue::AnnounceWorld(GroupQueueInfo *ginfo, const uint64& playerGUID, bool isAddedToQueue)
{
@ -386,7 +410,7 @@ void BattleGroundQueue::AnnounceWorld(GroupQueueInfo *ginfo, const uint64& playe
{
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
{
Player *plr = objmgr.GetPlayer(playerGUID);
Player *plr = sObjectMgr.GetPlayer(playerGUID);
BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId);
if (!bg || !plr)
return;
@ -446,7 +470,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * b
for(std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
{
// get the player
Player* plr = objmgr.GetPlayer(itr->first);
Player* plr = sObjectMgr.GetPlayer(itr->first);
// if offline, skip him, this should not happen - player is removed from queue when he logs out
if (!plr)
continue;
@ -461,7 +485,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * b
plr->SetInviteForBattleGroundQueueType(bgQueueTypeId, ginfo->IsInvitedToBGInstanceGUID);
// create remind invite events
BGQueueInviteEvent* inviteEvent = new BGQueueInviteEvent(plr->GetGUID(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, ginfo->RemoveInviteTime);
BGQueueInviteEvent* inviteEvent = new BGQueueInviteEvent(plr->GetGUID(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, ginfo->ArenaType, ginfo->RemoveInviteTime);
plr->m_Events.AddEvent(inviteEvent, plr->m_Events.CalculateTime(INVITATION_REMIND_TIME));
// create automatic remove events
BGQueueRemoveEvent* removeEvent = new BGQueueRemoveEvent(plr->GetGUID(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, bgQueueTypeId, ginfo->RemoveInviteTime);
@ -732,6 +756,7 @@ should be called from BattleGround::RemovePlayer function in some cases
*/
void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id, uint8 arenaType, bool isRated, uint32 arenaRating)
{
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
//if no players in queue - do nothing
if( m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].empty() &&
m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].empty() &&
@ -1009,7 +1034,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
{
Player* plr = objmgr.GetPlayer( m_PlayerGuid );
Player* plr = sObjectMgr.GetPlayer( m_PlayerGuid );
// player logged off (we should do nothing, he is correctly removed from queue in another procedure)
if (!plr)
return true;
@ -1021,17 +1046,15 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bg->GetTypeID(), bg->GetArenaType());
uint32 queueSlot = plr->GetBattleGroundQueueIndex(bgQueueTypeId);
if( queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES ) // player is in queue or in battleground
if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue or in battleground
{
// check if player is invited to this bg
BattleGroundQueue::QueuedPlayersMap const& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers;
BattleGroundQueue::QueuedPlayersMap::const_iterator qItr = qpMap.find(m_PlayerGuid);
if( qItr != qpMap.end() && qItr->second.GroupInfo->IsInvitedToBGInstanceGUID == m_BgInstanceGUID
&& qItr->second.GroupInfo->RemoveInviteTime == m_RemoveTime )
BattleGroundQueue &bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId];
if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime))
{
WorldPacket data;
//we must send remaining time in queue
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, qItr->second.GroupInfo->ArenaType);
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType);
plr->GetSession()->SendPacket(&data);
}
}
@ -1054,7 +1077,7 @@ void BGQueueInviteEvent::Abort(uint64 /*e_time*/)
*/
bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
{
Player* plr = objmgr.GetPlayer( m_PlayerGuid );
Player* plr = sObjectMgr.GetPlayer( m_PlayerGuid );
if (!plr)
// player logged off (we should do nothing, he is correctly removed from queue in another procedure)
return true;
@ -1064,22 +1087,19 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
//bg pointer can be NULL! so use it carefully!
uint32 queueSlot = plr->GetBattleGroundQueueIndex(m_BgQueueTypeId);
if( queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES ) // player is in queue, or in Battleground
if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue, or in Battleground
{
// check if player is in queue for this BG and if we are removing his invite event
BattleGroundQueue::QueuedPlayersMap& qpMap = sBattleGroundMgr.m_BattleGroundQueues[m_BgQueueTypeId].m_QueuedPlayers;
BattleGroundQueue::QueuedPlayersMap::iterator qMapItr = qpMap.find(m_PlayerGuid);
if( qMapItr != qpMap.end() && qMapItr->second.GroupInfo
&& qMapItr->second.GroupInfo->IsInvitedToBGInstanceGUID == m_BgInstanceGUID
&& qMapItr->second.GroupInfo->RemoveInviteTime == m_RemoveTime )
BattleGroundQueue &bgQueue = sBattleGroundMgr.m_BattleGroundQueues[m_BgQueueTypeId];
if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime))
{
sLog.outDebug("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID);
plr->RemoveBattleGroundQueueId(m_BgQueueTypeId);
sBattleGroundMgr.m_BattleGroundQueues[m_BgQueueTypeId].RemovePlayer(m_PlayerGuid, true);
bgQueue.RemovePlayer(m_PlayerGuid, true);
//update queues if battleground isn't ended
if (bg)
sBattleGroundMgr.ScheduleQueueUpdate(m_BgQueueTypeId, m_BgTypeId, bg->GetQueueId());
if (bg && bg->isBattleGround() && bg->GetStatus() != STATUS_WAIT_LEAVE)
sBattleGroundMgr.ScheduleQueueUpdate(0, 0, m_BgQueueTypeId, m_BgTypeId, bg->GetQueueId());
WorldPacket data;
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0);
@ -1167,18 +1187,24 @@ void BattleGroundMgr::Update(uint32 diff)
// update scheduled queues
if (!m_QueueUpdateScheduler.empty())
{
//copy vector and clear the other
// TODO add lock
// TODO maybe std::list would be better and then unlock after end of cycle
std::vector<uint32> scheduled(m_QueueUpdateScheduler);
m_QueueUpdateScheduler.clear();
// TODO drop lock
std::vector<uint64> scheduled;
{
//create mutex
ACE_Guard<ACE_Thread_Mutex> guard(SchedulerLock);
//copy vector and clear the other
scheduled = std::vector<uint64>(m_QueueUpdateScheduler);
m_QueueUpdateScheduler.clear();
//release lock
}
for (uint8 i = 0; i < scheduled.size(); i++)
{
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundQueueTypeId(scheduled[i] >> 16);
uint32 arenaRating = scheduled[i] >> 32;
uint8 arenaType = scheduled[i] >> 24 & 255;
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundQueueTypeId(scheduled[i] >> 16 & 255);
BattleGroundTypeId bgTypeId = BattleGroundTypeId((scheduled[i] >> 8) & 255);
BGQueueIdBasedOnLevel queue_id = BGQueueIdBasedOnLevel(scheduled[i] & 255);
m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, queue_id);
m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, queue_id, arenaType, arenaRating > 0, arenaRating);
}
}
@ -1332,7 +1358,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
for(int i = 1; i >= 0; --i)
{
uint32 at_id = bg->m_ArenaTeamIds[i];
ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
ArenaTeam * at = sObjectMgr.GetArenaTeamById(at_id);
if (at)
*data << at->GetName();
else
@ -1364,7 +1390,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
}
else
{
Player *plr = objmgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
uint32 team = bg->GetPlayerTeam(itr->first);
if (!team && plr)
team = plr->GetTeam();
@ -1597,7 +1623,7 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
}
// generate a new instance id
bg->SetInstanceID(MapManager::Instance().GenerateInstanceId()); // set instance id
bg->SetInstanceID(sMapMgr.GenerateInstanceId()); // set instance id
bg->SetClientInstanceID(CreateClientVisibleInstanceId(bgTypeId, queue_id));
// reset the new bg (set status to status_wait_queue from status_none)
@ -1808,7 +1834,7 @@ void BattleGroundMgr::DistributeArenaPoints()
std::map<uint32, uint32> PlayerPoints;
//at first update all points for all team members
for(ObjectMgr::ArenaTeamMap::iterator team_itr = objmgr.GetArenaTeamMapBegin(); team_itr != objmgr.GetArenaTeamMapEnd(); ++team_itr)
for(ObjectMgr::ArenaTeamMap::iterator team_itr = sObjectMgr.GetArenaTeamMapBegin(); team_itr != sObjectMgr.GetArenaTeamMapEnd(); ++team_itr)
{
if (ArenaTeam * at = team_itr->second)
{
@ -1822,7 +1848,7 @@ void BattleGroundMgr::DistributeArenaPoints()
//update to database
CharacterDatabase.PExecute("UPDATE characters SET arena_pending_points = '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first);
//add points if player is online
Player* pl = objmgr.GetPlayer(plr_itr->first);
Player* pl = sObjectMgr.GetPlayer(plr_itr->first);
if (pl)
pl->ModifyArenaPoints(plr_itr->second);
}
@ -1832,7 +1858,7 @@ void BattleGroundMgr::DistributeArenaPoints()
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END);
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
for(ObjectMgr::ArenaTeamMap::iterator titr = objmgr.GetArenaTeamMapBegin(); titr != objmgr.GetArenaTeamMapEnd(); ++titr)
for(ObjectMgr::ArenaTeamMap::iterator titr = sObjectMgr.GetArenaTeamMapBegin(); titr != sObjectMgr.GetArenaTeamMapEnd(); ++titr)
{
if (ArenaTeam * at = titr->second)
{
@ -2009,11 +2035,11 @@ void BattleGroundMgr::ToggleArenaTesting()
sWorld.SendWorldText(LANG_DEBUG_ARENA_OFF);
}
void BattleGroundMgr::ScheduleQueueUpdate(BattleGroundQueueTypeId bgQueueTypeId, BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id)
void BattleGroundMgr::ScheduleQueueUpdate(uint32 arenaRating, uint8 arenaType, BattleGroundQueueTypeId bgQueueTypeId, BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id)
{
//This method must be atomic, TODO add mutex
ACE_Guard<ACE_Thread_Mutex> guard(SchedulerLock);
//we will use only 1 number created of bgTypeId and queue_id
uint32 schedule_id = (bgQueueTypeId << 16) | (bgTypeId << 8) | queue_id;
uint64 schedule_id = ((uint64)arenaRating << 32) | (arenaType << 24) | (bgQueueTypeId << 16) | (bgTypeId << 8) | queue_id;
bool found = false;
for (uint8 i = 0; i < m_QueueUpdateScheduler.size(); i++)
{

View file

@ -23,6 +23,7 @@
#include "Policies/Singleton.h"
#include "Utilities/EventProcessor.h"
#include "BattleGround.h"
#include "ace/Recursive_Thread_Mutex.h"
typedef std::map<uint32, BattleGround*> BattleGroundSet;
@ -83,12 +84,19 @@ class BattleGroundQueue
GroupQueueInfo * AddGroup(Player * leader, BattleGroundTypeId bgTypeId, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 ArenaTeamId = 0);
void AddPlayer(Player *plr, GroupQueueInfo *ginfo);
void RemovePlayer(const uint64& guid, bool decreaseInvitedCount);
bool IsPlayerInvited(const uint64& pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime);
bool GetPlayerGroupInfoData(const uint64& guid, GroupQueueInfo* ginfo);
void PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* ginfo, BGQueueIdBasedOnLevel queue_id);
uint32 GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BGQueueIdBasedOnLevel queue_id);
void DecreaseGroupLength(uint32 queueId, uint32 AsGroup);
void AnnounceWorld(GroupQueueInfo *ginfo, const uint64& playerGUID, bool isAddedToQueue);
private:
//mutex that should not allow changing private data, nor allowing to update Queue during private data change.
ACE_Recursive_Thread_Mutex m_Lock;
typedef std::map<uint64, PlayerQueueInfo> QueuedPlayersMap;
QueuedPlayersMap m_QueuedPlayers;
@ -123,8 +131,6 @@ class BattleGroundQueue
//one selection pool for horde, other one for alliance
SelectionPool m_SelectionPools[BG_TEAMS_COUNT];
private:
bool InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * bg, uint32 side);
uint32 m_WaitTimes[BG_TEAMS_COUNT][MAX_BATTLEGROUND_QUEUES][COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME];
uint32 m_WaitTimeLastPlayer[BG_TEAMS_COUNT][MAX_BATTLEGROUND_QUEUES];
@ -138,8 +144,8 @@ class BattleGroundQueue
class BGQueueInviteEvent : public BasicEvent
{
public:
BGQueueInviteEvent(const uint64& pl_guid, uint32 BgInstanceGUID, BattleGroundTypeId BgTypeId, uint32 removeTime) :
m_PlayerGuid(pl_guid), m_BgInstanceGUID(BgInstanceGUID), m_BgTypeId(BgTypeId), m_RemoveTime(removeTime)
BGQueueInviteEvent(const uint64& pl_guid, uint32 BgInstanceGUID, BattleGroundTypeId BgTypeId, uint8 arenaType, uint32 removeTime) :
m_PlayerGuid(pl_guid), m_BgInstanceGUID(BgInstanceGUID), m_BgTypeId(BgTypeId), m_ArenaType(arenaType), m_RemoveTime(removeTime)
{
};
virtual ~BGQueueInviteEvent() {};
@ -150,6 +156,7 @@ class BGQueueInviteEvent : public BasicEvent
uint64 m_PlayerGuid;
uint32 m_BgInstanceGUID;
BattleGroundTypeId m_BgTypeId;
uint8 m_ArenaType;
uint32 m_RemoveTime;
};
@ -219,7 +226,7 @@ class BattleGroundMgr
BGFreeSlotQueueType BGFreeSlotQueue[MAX_BATTLEGROUND_TYPE_ID];
void ScheduleQueueUpdate(BattleGroundQueueTypeId bgQueueTypeId, BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id);
void ScheduleQueueUpdate(uint32 arenaRating, uint8 arenaType, BattleGroundQueueTypeId bgQueueTypeId, BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id);
uint32 GetMaxRatingDifference() const;
uint32 GetRatingDiscardTimer() const;
uint32 GetPrematureFinishTime() const;
@ -265,13 +272,14 @@ class BattleGroundMgr
static bool IsBGWeekend(BattleGroundTypeId bgTypeId);
private:
ACE_Thread_Mutex SchedulerLock;
BattleMastersMap mBattleMastersMap;
CreatureBattleEventIndexesMap m_CreatureBattleEventIndexMap;
GameObjectBattleEventIndexesMap m_GameObjectBattleEventIndexMap;
/* Battlegrounds */
BattleGroundSet m_BattleGrounds[MAX_BATTLEGROUND_TYPE_ID];
std::vector<uint32>m_QueueUpdateScheduler;
std::vector<uint64> m_QueueUpdateScheduler;
std::set<uint32> m_ClientBattleGroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_QUEUES]; //the instanceids just visible for the client
uint32 m_NextRatingDiscardUpdate;
time_t m_NextAutoDistributionTime;

View file

@ -77,7 +77,7 @@ void Channel::Join(uint64 p, const char *pass)
return;
}
Player *plr = objmgr.GetPlayer(p);
Player *plr = sObjectMgr.GetPlayer(p);
if(plr)
{
@ -135,7 +135,7 @@ void Channel::Leave(uint64 p, bool send)
}
else
{
Player *plr = objmgr.GetPlayer(p);
Player *plr = sObjectMgr.GetPlayer(p);
if(send)
{
@ -170,7 +170,7 @@ void Channel::Leave(uint64 p, bool send)
void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
{
AccountTypes sec = SEC_PLAYER;
Player *gplr = objmgr.GetPlayer(good);
Player *gplr = sObjectMgr.GetPlayer(good);
if(gplr)
sec = gplr->GetSession()->GetSecurity();
@ -188,7 +188,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
}
else
{
Player *bad = objmgr.GetPlayer(badname);
Player *bad = sObjectMgr.GetPlayer(badname);
if(bad == NULL || !IsOn(bad->GetGUID()))
{
WorldPacket data;
@ -231,7 +231,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
void Channel::UnBan(uint64 good, const char *badname)
{
uint32 sec = 0;
Player *gplr = objmgr.GetPlayer(good);
Player *gplr = sObjectMgr.GetPlayer(good);
if(gplr)
sec = gplr->GetSession()->GetSecurity();
@ -249,7 +249,7 @@ void Channel::UnBan(uint64 good, const char *badname)
}
else
{
Player *bad = objmgr.GetPlayer(badname);
Player *bad = sObjectMgr.GetPlayer(badname);
if(bad == NULL || !IsBanned(bad->GetGUID()))
{
WorldPacket data;
@ -270,7 +270,7 @@ void Channel::UnBan(uint64 good, const char *badname)
void Channel::Password(uint64 p, const char *pass)
{
uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
Player *plr = sObjectMgr.GetPlayer(p);
if(plr)
sec = plr->GetSession()->GetSecurity();
@ -298,7 +298,7 @@ void Channel::Password(uint64 p, const char *pass)
void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
{
Player *plr = objmgr.GetPlayer(p);
Player *plr = sObjectMgr.GetPlayer(p);
if (!plr)
return;
@ -318,7 +318,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
}
else
{
Player *newp = objmgr.GetPlayer(p2n);
Player *newp = sObjectMgr.GetPlayer(p2n);
if(!newp)
{
WorldPacket data;
@ -367,7 +367,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
void Channel::SetOwner(uint64 p, const char *newname)
{
Player *plr = objmgr.GetPlayer(p);
Player *plr = sObjectMgr.GetPlayer(p);
if (!plr)
return;
@ -389,7 +389,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
return;
}
Player *newp = objmgr.GetPlayer(newname);
Player *newp = sObjectMgr.GetPlayer(newname);
if(newp == NULL || !IsOn(newp->GetGUID()))
{
WorldPacket data;
@ -451,7 +451,7 @@ void Channel::List(Player* player)
uint32 count = 0;
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player *plr = objmgr.GetPlayer(i->first);
Player *plr = sObjectMgr.GetPlayer(i->first);
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
@ -473,7 +473,7 @@ void Channel::List(Player* player)
void Channel::Announce(uint64 p)
{
uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
Player *plr = sObjectMgr.GetPlayer(p);
if(plr)
sec = plr->GetSession()->GetSecurity();
@ -505,7 +505,7 @@ void Channel::Announce(uint64 p)
void Channel::Moderate(uint64 p)
{
uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
Player *plr = sObjectMgr.GetPlayer(p);
if(plr)
sec = plr->GetSession()->GetSecurity();
@ -542,7 +542,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
lang = LANG_UNIVERSAL;
uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
Player *plr = sObjectMgr.GetPlayer(p);
if(plr)
sec = plr->GetSession()->GetSecurity();
@ -593,7 +593,7 @@ void Channel::Invite(uint64 p, const char *newname)
return;
}
Player *newp = objmgr.GetPlayer(newname);
Player *newp = sObjectMgr.GetPlayer(newname);
if(!newp)
{
WorldPacket data;
@ -602,7 +602,7 @@ void Channel::Invite(uint64 p, const char *newname)
return;
}
Player *plr = objmgr.GetPlayer(p);
Player *plr = sObjectMgr.GetPlayer(p);
if (!plr)
return;
@ -665,7 +665,7 @@ void Channel::SendToAll(WorldPacket *data, uint64 p)
{
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player *plr = objmgr.GetPlayer(i->first);
Player *plr = sObjectMgr.GetPlayer(i->first);
if(plr)
{
if(!p || !plr->GetSocial()->HasIgnore(GUID_LOPART(p)))
@ -680,7 +680,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
{
if(i->first != who)
{
Player *plr = objmgr.GetPlayer(i->first);
Player *plr = sObjectMgr.GetPlayer(i->first);
if(plr)
plr->GetSession()->SendPacket(data);
}
@ -689,7 +689,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
void Channel::SendToOne(WorldPacket *data, uint64 who)
{
Player *plr = objmgr.GetPlayer(who);
Player *plr = sObjectMgr.GetPlayer(who);
if(plr)
plr->GetSession()->SendPacket(data);
}
@ -793,7 +793,7 @@ void Channel::MakeChannelOwner(WorldPacket *data)
{
std::string name = "";
if(!objmgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty())
if(!sObjectMgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty())
name = "PLAYER_NOT_FOUND";
MakeNotifyPacket(data, CHAT_CHANNEL_OWNER_NOTICE);

View file

@ -255,14 +255,14 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
return;
}
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(name))
if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(name))
{
data << (uint8)CHAR_NAME_RESERVED;
SendPacket( &data );
return;
}
if (objmgr.GetPlayerGUIDByName(name))
if (sObjectMgr.GetPlayerGUIDByName(name))
{
data << (uint8)CHAR_CREATE_NAME_IN_USE;
SendPacket( &data );
@ -432,7 +432,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
recv_data >> hairStyle >> hairColor >> facialHair >> outfitId;
Player *pNewChar = new Player(this);
if(!pNewChar->Create( objmgr.GenerateLowGuid(HIGHGUID_PLAYER), name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId ))
if(!pNewChar->Create( sObjectMgr.GenerateLowGuid(HIGHGUID_PLAYER), name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId ))
{
// Player not create (race/class problem?)
delete pNewChar;
@ -469,14 +469,14 @@ void WorldSession::HandleCharDeleteOpcode( WorldPacket & recv_data )
recv_data >> guid;
// can't delete loaded character
if(objmgr.GetPlayer(guid))
if(sObjectMgr.GetPlayer(guid))
return;
uint32 accountId = 0;
std::string name;
// is guild leader
if(objmgr.GetGuildByLeader(guid))
if(sObjectMgr.GetGuildByLeader(guid))
{
WorldPacket data(SMSG_CHAR_DELETE, 1);
data << (uint8)CHAR_DELETE_FAILED_GUILD_LEADER;
@ -485,7 +485,7 @@ void WorldSession::HandleCharDeleteOpcode( WorldPacket & recv_data )
}
// is arena team captain
if(objmgr.GetArenaTeamByCaptain(guid))
if(sObjectMgr.GetArenaTeamByCaptain(guid))
{
WorldPacket data(SMSG_CHAR_DELETE, 1);
data << (uint8)CHAR_DELETE_FAILED_ARENA_CAPTAIN;
@ -637,7 +637,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
if(pCurrChar->GetGuildId() != 0)
{
Guild* guild = objmgr.GetGuildById(pCurrChar->GetGuildId());
Guild* guild = sObjectMgr.GetGuildById(pCurrChar->GetGuildId());
if(guild)
{
data.Initialize(SMSG_GUILD_EVENT, (2+guild->GetMOTD().size()+1));
@ -692,14 +692,14 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
if (!pCurrChar->GetMap()->Add(pCurrChar))
{
AreaTrigger const* at = objmgr.GetGoBackTrigger(pCurrChar->GetMapId());
AreaTrigger const* at = sObjectMgr.GetGoBackTrigger(pCurrChar->GetMapId());
if(at)
pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation());
else
pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation());
}
ObjectAccessor::Instance().AddObject(pCurrChar);
sObjectAccessor.AddObject(pCurrChar);
//sLog.outDebug("Player %s added to Map.",pCurrChar->GetName());
pCurrChar->SendInitialPacketsAfterAddToMap();
@ -918,7 +918,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
}
// check name limitations
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(newname))
{
WorldPacket data(SMSG_CHAR_RENAME, 1);
data << uint8(CHAR_NAME_RESERVED);
@ -981,7 +981,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
// not accept declined names for unsupported languages
std::string name;
if(!objmgr.GetPlayerNameByGUID(guid, name))
if(!sObjectMgr.GetPlayerNameByGUID(guid, name))
{
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
data << uint32(1);
@ -1181,7 +1181,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
}
// check name limitations
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
if (GetSecurity() == SEC_PLAYER && sObjectMgr.IsReservedName(newname))
{
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
data << uint8(CHAR_NAME_RESERVED);
@ -1190,7 +1190,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
}
// character with this name already exist
if (uint64 newguid = objmgr.GetPlayerGUIDByName(newname))
if (uint64 newguid = sObjectMgr.GetPlayerGUIDByName(newname))
{
if (newguid != guid)
{

View file

@ -698,7 +698,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
if (target)
target_session = target->GetSession();
else if (guid)
target_account = objmgr.GetPlayerAccountIdByGUID(guid);
target_account = sObjectMgr.GetPlayerAccountIdByGUID(guid);
if(!target_session && !target_account)
{
@ -1164,7 +1164,7 @@ valid examples:
// read item entry
reader.getline(buffer, 256, ':');
linkedItem= objmgr.GetItemPrototype(atoi(buffer));
linkedItem = ObjectMgr::GetItemPrototype(atoi(buffer));
if(!linkedItem)
{
#ifdef MANGOS_DEBUG
@ -1243,7 +1243,7 @@ valid examples:
c = reader.peek();
}
linkedQuest = objmgr.GetQuestTemplate(questid);
linkedQuest = sObjectMgr.GetQuestTemplate(questid);
if(!linkedQuest)
{
@ -1414,7 +1414,7 @@ valid examples:
if (linkedSpell->Attributes & SPELL_ATTR_TRADESPELL)
{
// lookup skillid
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(linkedSpell->Id);
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(linkedSpell->Id);
if (bounds.first == bounds.second)
{
return false;
@ -1461,7 +1461,7 @@ valid examples:
{
if (linkedQuest->GetTitle() != buffer)
{
QuestLocale const *ql = objmgr.GetQuestLocale(linkedQuest->GetQuestId());
QuestLocale const *ql = sObjectMgr.GetQuestLocale(linkedQuest->GetQuestId());
if (!ql)
{
@ -1502,12 +1502,12 @@ valid examples:
if (expectedName != buffer)
{
ItemLocale const *il = objmgr.GetItemLocale(linkedItem->ItemId);
ItemLocale const *il = sObjectMgr.GetItemLocale(linkedItem->ItemId);
bool foundName = false;
for(uint8 i=LOCALE_koKR; i<MAX_LOCALE; ++i)
{
int8 dbIndex = objmgr.GetIndexForLocale(LocaleConstant(i));
int8 dbIndex = sObjectMgr.GetIndexForLocale(LocaleConstant(i));
if (dbIndex == -1 || il == NULL || dbIndex >= il->Name.size())
// using strange database/client combinations can lead to this case
expectedName = linkedItem->Name1;
@ -1758,7 +1758,7 @@ Player * ChatHandler::getSelectedPlayer()
if (guid == 0)
return m_session->GetPlayer();
return objmgr.GetPlayer(guid);
return sObjectMgr.GetPlayer(guid);
}
Unit* ChatHandler::getSelectedUnit()
@ -1935,7 +1935,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
GameObject* obj = pl->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_GAMEOBJECT));
if(!obj && objmgr.GetGOData(lowguid)) // guid is DB guid of object
if(!obj && sObjectMgr.GetGOData(lowguid)) // guid is DB guid of object
{
// search near player then
CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
@ -2036,9 +2036,9 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
// id case (explicit or from shift link)
if(cId[0] >= '0' || cId[0] >= '9')
if(uint32 id = atoi(cId))
return objmgr.GetGameTele(id);
return sObjectMgr.GetGameTele(id);
return objmgr.GetGameTele(cId);
return sObjectMgr.GetGameTele(cId);
}
enum GuidLinkType
@ -2075,10 +2075,10 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
if(!normalizePlayerName(name))
return 0;
if(Player* player = objmgr.GetPlayer(name.c_str()))
if(Player* player = sObjectMgr.GetPlayer(name.c_str()))
return player->GetGUID();
if(uint64 guid = objmgr.GetPlayerGUIDByName(name))
if(uint64 guid = sObjectMgr.GetPlayerGUIDByName(name))
return guid;
return 0;
@ -2087,7 +2087,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
{
uint32 lowguid = (uint32)atol(idS);
if(CreatureData const* data = objmgr.GetCreatureData(lowguid) )
if(CreatureData const* data = sObjectMgr.GetCreatureData(lowguid) )
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT);
else
return 0;
@ -2096,7 +2096,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
{
uint32 lowguid = (uint32)atol(idS);
if(GameObjectData const* data = objmgr.GetGOData(lowguid) )
if(GameObjectData const* data = sObjectMgr.GetGOData(lowguid) )
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_GAMEOBJECT);
else
return 0;
@ -2133,14 +2133,14 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe
return false;
}
Player* pl = objmgr.GetPlayer(name.c_str());
Player* pl = sObjectMgr.GetPlayer(name.c_str());
// if allowed player pointer
if(player)
*player = pl;
// if need guid value from DB (in name case for check player existence)
uint64 guid = !pl && (player_guid || player_name) ? objmgr.GetPlayerGUIDByName(name) : 0;
uint64 guid = !pl && (player_guid || player_name) ? sObjectMgr.GetPlayerGUIDByName(name) : 0;
// if allowed player guid (if no then only online players allowed)
if(player_guid)
@ -2226,7 +2226,7 @@ int ChatHandler::GetSessionDbLocaleIndex() const
const char *CliHandler::GetMangosString(int32 entry) const
{
return objmgr.GetMangosStringForDBCLocale(entry);
return sObjectMgr.GetMangosStringForDBCLocale(entry);
}
bool CliHandler::isAvailable(ChatCommand const& cmd) const
@ -2258,5 +2258,5 @@ LocaleConstant CliHandler::GetSessionDbcLocale() const
int CliHandler::GetSessionDbLocaleIndex() const
{
return objmgr.GetDBCLocaleIndex();
return sObjectMgr.GetDBCLocaleIndex();
}

View file

@ -206,7 +206,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
break;
}
Player *player = objmgr.GetPlayer(to.c_str());
Player *player = sObjectMgr.GetPlayer(to.c_str());
uint32 tSecurity = GetSecurity();
uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
@ -280,7 +280,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if (GetPlayer()->GetGuildId())
{
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if (guild)
guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
@ -306,7 +306,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if (GetPlayer()->GetGuildId())
{
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if (guild)
guild->BroadcastToOfficers(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
@ -602,7 +602,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data )
recv_data >> iguid;
recv_data >> unk; // probably related to spam reporting
Player *player = objmgr.GetPlayer(iguid);
Player *player = sObjectMgr.GetPlayer(iguid);
if(!player || !player->GetSession())
return;

View file

@ -50,7 +50,7 @@ void Corpse::AddToWorld()
{
///- Register the corpse for guid lookup
if(!IsInWorld())
ObjectAccessor::Instance().AddObject(this);
sObjectAccessor.AddObject(this);
Object::AddToWorld();
}
@ -59,7 +59,7 @@ void Corpse::RemoveFromWorld()
{
///- Remove the corpse from the accessor
if(IsInWorld())
ObjectAccessor::Instance().RemoveObject(this);
sObjectAccessor.RemoveObject(this);
Object::RemoveFromWorld();
}

View file

@ -26,7 +26,7 @@
#include "QuestDef.h"
#include "GossipDef.h"
#include "Player.h"
#include "PoolHandler.h"
#include "PoolManager.h"
#include "Opcodes.h"
#include "Log.h"
#include "LootMgr.h"
@ -181,7 +181,7 @@ void Creature::RemoveCorpse()
*/
bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
{
CreatureInfo const *normalInfo = objmgr.GetCreatureTemplate(Entry);
CreatureInfo const *normalInfo = ObjectMgr::GetCreatureTemplate(Entry);
if(!normalInfo)
{
sLog.outErrorDb("Creature::UpdateEntry creature entry %u does not exist.", Entry);
@ -199,7 +199,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
// we already have valid Map pointer for current creature!
if (GetMap()->GetSpawnMode() > diff)
{
cinfo = objmgr.GetCreatureTemplate(normalInfo->DifficultyEntry[diff]);
cinfo = ObjectMgr::GetCreatureTemplate(normalInfo->DifficultyEntry[diff]);
if (!cinfo)
{
// maybe check such things already at startup
@ -219,14 +219,14 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
// known valid are: CLASS_WARRIOR,CLASS_PALADIN,CLASS_ROGUE,CLASS_MAGE
SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
uint32 display_id = objmgr.ChooseDisplayId(team, GetCreatureInfo(), data);
uint32 display_id = sObjectMgr.ChooseDisplayId(team, GetCreatureInfo(), data);
if (!display_id) // Cancel load if no display id
{
sLog.outErrorDb("Creature (Entry: %u) has model %u not found in table `creature_model_info`, can't load. ", Entry, display_id);
return false;
}
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (!minfo) // Cancel load if no model defined
{
sLog.outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
@ -369,9 +369,9 @@ void Creature::Update(uint32 diff)
//Call AI respawn virtual function
i_AI->JustRespawned();
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), GetTypeId());
uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), GetTypeId());
if (poolid)
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_UNIT);
sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_UNIT);
else
GetMap()->Add(this);
}
@ -398,7 +398,7 @@ void Creature::Update(uint32 diff)
}
else
{
Group* group = objmgr.GetGroupByLeader(lootingGroupLeaderGUID);
Group* group = sObjectMgr.GetGroupByLeader(lootingGroupLeaderGUID);
if (group)
group->EndRoll();
m_groupLootTimer = 0;
@ -761,7 +761,7 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
if(gso->Id==1)
{
uint32 textid=GetNpcTextId();
GossipText const* gossiptext=objmgr.GetGossipText(textid);
GossipText const* gossiptext=sObjectMgr.GetGossipText(textid);
if(!gossiptext)
cantalking=false;
}
@ -835,7 +835,7 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
int loc_idx = pPlayer->GetSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
NpcOptionLocale const *no = objmgr.GetNpcOptionLocale(gso->Id);
NpcOptionLocale const *no = sObjectMgr.GetNpcOptionLocale(gso->Id);
if (no)
{
if (no->OptionText.size() > loc_idx && !no->OptionText[loc_idx].empty())
@ -1031,7 +1031,7 @@ uint32 Creature::GetNpcTextId()
if (!m_DBTableGuid)
return DEFAULT_GOSSIP_MESSAGE;
if(uint32 pos = objmgr.GetNpcGossip(m_DBTableGuid))
if(uint32 pos = sObjectMgr.GetNpcGossip(m_DBTableGuid))
return pos;
return DEFAULT_GOSSIP_MESSAGE;
@ -1054,7 +1054,7 @@ void Creature::LoadGossipOptions()
uint32 npcflags=GetUInt32Value(UNIT_NPC_FLAGS);
CacheNpcOptionList const& noList = objmgr.GetNpcOptions ();
CacheNpcOptionList const& noList = sObjectMgr.GetNpcOptions ();
for (CacheNpcOptionList::const_iterator i = noList.begin (); i != noList.end (); ++i)
if(i->NpcFlag & npcflags)
addGossipOption(*i);
@ -1116,7 +1116,7 @@ void Creature::SaveToDB()
{
// this should only be used when the creature has already been loaded
// preferably after adding to map, because mapid may not be valid otherwise
CreatureData const *data = objmgr.GetCreatureData(m_DBTableGuid);
CreatureData const *data = sObjectMgr.GetCreatureData(m_DBTableGuid);
if(!data)
{
sLog.outError("Creature::SaveToDB failed, cannot get creature data!");
@ -1131,7 +1131,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
// update in loaded data
if (!m_DBTableGuid)
m_DBTableGuid = GetGUIDLow();
CreatureData& data = objmgr.NewOrExistCreatureData(m_DBTableGuid);
CreatureData& data = sObjectMgr.NewOrExistCreatureData(m_DBTableGuid);
uint32 displayId = GetNativeDisplayId();
@ -1143,22 +1143,22 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
displayId != cinfo->DisplayID_H[0] && displayId != cinfo->DisplayID_H[1])
{
if (cinfo->DisplayID_A[0])
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_A[0]))
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_A[0]))
if(displayId == minfo->modelid_other_gender)
displayId = 0;
if (displayId && cinfo->DisplayID_A[1])
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_A[1]))
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_A[1]))
if(displayId == minfo->modelid_other_gender)
displayId = 0;
if (displayId && cinfo->DisplayID_H[0])
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_H[0]))
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_H[0]))
if(displayId == minfo->modelid_other_gender)
displayId = 0;
if (displayId && cinfo->DisplayID_H[1])
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_H[1]))
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_H[1]))
if(displayId == minfo->modelid_other_gender)
displayId = 0;
}
@ -1327,7 +1327,7 @@ float Creature::GetSpellDamageMod(int32 Rank)
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const CreatureData *data)
{
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(Entry);
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry);
if(!cinfo)
{
sLog.outErrorDb("Creature entry %u does not exist.", Entry);
@ -1345,7 +1345,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const
bool Creature::LoadFromDB(uint32 guid, Map *map)
{
CreatureData const* data = objmgr.GetCreatureData(guid);
CreatureData const* data = sObjectMgr.GetCreatureData(guid);
if(!data)
{
@ -1364,7 +1364,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
return false;
}
else
guid = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
guid = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
uint16 team = 0;
if(!Create(guid,map,data->phaseMask,data->id,team,data))
@ -1384,7 +1384,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
m_isDeadByDefault = data->is_dead;
m_deathState = m_isDeadByDefault ? DEAD : ALIVE;
m_respawnTime = objmgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
m_respawnTime = sObjectMgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
if(m_respawnTime > time(NULL)) // not ready to respawn
{
m_deathState = DEAD;
@ -1398,7 +1398,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
else if(m_respawnTime) // respawn time set but expired
{
m_respawnTime = 0;
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
}
uint32 curhealth = data->curhealth;
@ -1434,7 +1434,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
return;
}
EquipmentInfo const *einfo = objmgr.GetEquipmentInfo(equip_entry);
EquipmentInfo const *einfo = sObjectMgr.GetEquipmentInfo(equip_entry);
if (!einfo)
return;
@ -1445,7 +1445,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
bool Creature::hasQuest(uint32 quest_id) const
{
QuestRelations const& qr = objmgr.mCreatureQuestRelations;
QuestRelations const& qr = sObjectMgr.mCreatureQuestRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
{
if(itr->second==quest_id)
@ -1456,7 +1456,7 @@ bool Creature::hasQuest(uint32 quest_id) const
bool Creature::hasInvolvedQuest(uint32 quest_id) const
{
QuestRelations const& qr = objmgr.mCreatureQuestInvolvedRelations;
QuestRelations const& qr = sObjectMgr.mCreatureQuestInvolvedRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
{
if(itr->second==quest_id)
@ -1473,8 +1473,8 @@ void Creature::DeleteFromDB()
return;
}
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
objmgr.DeleteCreatureData(m_DBTableGuid);
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
sObjectMgr.DeleteCreatureData(m_DBTableGuid);
WorldDatabase.BeginTransaction();
WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid);
@ -1607,7 +1607,7 @@ void Creature::Respawn()
if(getDeathState()==DEAD)
{
if (m_DBTableGuid)
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
m_respawnTime = time(NULL); // respawn at next tick
}
}
@ -1902,9 +1902,9 @@ void Creature::SaveRespawnTime()
return;
if(m_respawnTime > time(NULL)) // dead (no corpse)
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
else if(m_deathTimer > 0) // dead (corpse)
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
}
bool Creature::IsOutOfThreatArea(Unit* pVictim) const
@ -2139,7 +2139,7 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
{
if (m_DBTableGuid)
{
if (CreatureData const* data = objmgr.GetCreatureData(GetDBTableGUIDLow()))
if (CreatureData const* data = sObjectMgr.GetCreatureData(GetDBTableGUIDLow()))
{
x = data->posX;
y = data->posY;
@ -2203,7 +2203,7 @@ std::string Creature::GetAIName() const
std::string Creature::GetScriptName() const
{
return objmgr.GetScriptName(GetScriptId());
return sObjectMgr.GetScriptName(GetScriptId());
}
uint32 Creature::GetScriptId() const
@ -2213,7 +2213,7 @@ uint32 Creature::GetScriptId() const
VendorItemData const* Creature::GetVendorItems() const
{
return objmgr.GetNpcVendorItemList(GetEntry());
return sObjectMgr.GetNpcVendorItemList(GetEntry());
}
uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
@ -2235,7 +2235,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
if( vCount->lastIncrementTime + vItem->incrtime <= ptime )
{
ItemPrototype const* pProto = objmgr.GetItemPrototype(vItem->item);
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(vItem->item);
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
if((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount )
@ -2274,7 +2274,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
if( vCount->lastIncrementTime + vItem->incrtime <= ptime )
{
ItemPrototype const* pProto = objmgr.GetItemPrototype(vItem->item);
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(vItem->item);
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
if((vCount->count + diff * pProto->BuyCount) < vItem->maxcount )
@ -2290,7 +2290,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
TrainerSpellData const* Creature::GetTrainerSpells() const
{
return objmgr.GetNpcTrainerSpells(GetEntry());
return sObjectMgr.GetNpcTrainerSpells(GetEntry());
}
// overwrite WorldObject function for proper name localization
@ -2298,7 +2298,7 @@ const char* Creature::GetNameForLocaleIdx(int32 loc_idx) const
{
if (loc_idx >= 0)
{
CreatureLocale const *cl = objmgr.GetCreatureLocale(GetEntry());
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(GetEntry());
if (cl)
{
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())

View file

@ -55,8 +55,8 @@ int CreatureEventAI::Permissible(const Creature *creature)
CreatureEventAI::CreatureEventAI(Creature *c ) : CreatureAI(c)
{
// Need make copy for filter unneeded steps and safe in case table reload
CreatureEventAI_Event_Map::const_iterator CreatureEvents = CreatureEAI_Mgr.GetCreatureEventAIMap().find(m_creature->GetEntry());
if (CreatureEvents != CreatureEAI_Mgr.GetCreatureEventAIMap().end())
CreatureEventAI_Event_Map::const_iterator CreatureEvents = sEventAIMgr.GetCreatureEventAIMap().find(m_creature->GetEntry());
if (CreatureEvents != sEventAIMgr.GetCreatureEventAIMap().end())
{
std::vector<CreatureEventAI_Event>::const_iterator i;
for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i)
@ -406,7 +406,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{
if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatureId))
{
uint32 display_id = objmgr.ChooseDisplayId(0,ci);
uint32 display_id = sObjectMgr.ChooseDisplayId(0,ci);
m_creature->SetDisplayId(display_id);
}
}
@ -672,8 +672,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{
Unit* target = GetTargetByType(action.summon_id.target, pActionInvoker);
CreatureEventAI_Summon_Map::const_iterator i = CreatureEAI_Mgr.GetCreatureEventAISummonMap().find(action.summon_id.spawnId);
if (i == CreatureEAI_Mgr.GetCreatureEventAISummonMap().end())
CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr.GetCreatureEventAISummonMap().find(action.summon_id.spawnId);
if (i == sEventAIMgr.GetCreatureEventAISummonMap().end())
{
sLog.outErrorDb( "CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, EventId, m_creature->GetEntry());
return;
@ -1259,9 +1259,9 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit*
return;
}
CreatureEventAI_TextMap::const_iterator i = CreatureEAI_Mgr.GetCreatureEventAITextMap().find(textEntry);
CreatureEventAI_TextMap::const_iterator i = sEventAIMgr.GetCreatureEventAITextMap().find(textEntry);
if (i == CreatureEAI_Mgr.GetCreatureEventAITextMap().end())
if (i == sEventAIMgr.GetCreatureEventAITextMap().end())
{
sLog.outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry);
return;

View file

@ -36,7 +36,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
m_CreatureEventAI_TextMap.clear();
// Load EventAI Text
objmgr.LoadMangosStrings(WorldDatabase,"creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
sObjectMgr.LoadMangosStrings(WorldDatabase,"creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
// Gather Additional data from EventAI Texts
QueryResult *result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
@ -67,7 +67,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
}
// range negative (don't must be happen, loaded from same table)
if (!objmgr.GetMangosStringLocale(i))
if (!sObjectMgr.GetMangosStringLocale(i))
{
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found",i);
continue;
@ -411,7 +411,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break;
case EVENT_T_QUEST_ACCEPT:
case EVENT_T_QUEST_COMPLETE:
if (!objmgr.GetQuestTemplate(temp.quest.questId))
if (!sObjectMgr.GetQuestTemplate(temp.quest.questId))
sLog.outErrorDb("CreatureEventAI: Creature %u are using event(%u) with not existed qyest id (%u) in param1, skipped.", temp.creature_id, i, temp.quest.questId);
sLog.outErrorDb("CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i);
continue;
@ -619,7 +619,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent);
break;
case ACTION_T_QUEST_EVENT:
if (Quest const* qid = objmgr.GetQuestTemplate(action.quest_event.questId))
if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event.questId))
{
if (!qid->HasFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId);
@ -661,7 +661,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
sLog.outErrorDb("CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j+1, action.set_inc_phase.step);
break;
case ACTION_T_QUEST_EVENT_ALL:
if (Quest const* qid = objmgr.GetQuestTemplate(action.quest_event_all.questId))
if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event_all.questId))
{
if (!qid->HasFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId);

View file

@ -45,5 +45,5 @@ class CreatureEventAIMgr
CreatureEventAI_TextMap m_CreatureEventAI_TextMap;
};
#define CreatureEAI_Mgr MaNGOS::Singleton<CreatureEventAIMgr>::Instance()
#define sEventAIMgr MaNGOS::Singleton<CreatureEventAIMgr>::Instance()
#endif

View file

@ -50,7 +50,7 @@ void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/ )
data << (uint32)0;
SendPacket( &data );
GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow());
GMTicket* ticket = sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow());
if(ticket)
SendGMTicketGetTicket(0x06,ticket->GetText());
else
@ -62,7 +62,7 @@ void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data )
std::string ticketText;
recv_data >> ticketText;
if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
if(GMTicket* ticket = sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
ticket->SetText(ticketText.c_str());
else
sLog.outError("Ticket update: Player %s (GUID: %u) doesn't have active ticket", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
@ -70,7 +70,7 @@ void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data )
void WorldSession::HandleGMTicketDeleteTicketOpcode( WorldPacket & /*recv_data*/ )
{
ticketmgr.Delete(GetPlayer()->GetGUIDLow());
sTicketMgr.Delete(GetPlayer()->GetGUIDLow());
WorldPacket data( SMSG_GMTICKET_DELETETICKET, 4 );
data << uint32(9);
@ -95,7 +95,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s", map, x, y, z, ticketText.c_str());
if(ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
if(sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
{
WorldPacket data( SMSG_GMTICKET_CREATE, 4 );
data << uint32(1); // 1 - You already have GM ticket
@ -103,7 +103,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
return;
}
ticketmgr.Create(_player->GetGUIDLow(), ticketText.c_str());
sTicketMgr.Create(_player->GetGUIDLow(), ticketText.c_str());
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
data << (uint32)time(NULL);
@ -116,7 +116,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
DEBUG_LOG("update the ticket");
//TODO: Guard player map
HashMapHolder<Player>::MapType &m = ObjectAccessor::Instance().GetPlayers();
HashMapHolder<Player>::MapType &m = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
if(itr->second->GetSession()->GetSecurity() >= SEC_GAMEMASTER && itr->second->isAcceptTickets())

View file

@ -72,7 +72,7 @@ void GMTicketMgr::DeleteAll()
{
for(GMTicketMap::const_iterator itr = m_GMTicketMap.begin(); itr != m_GMTicketMap.end(); ++itr)
{
if(Player* owner = objmgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER)))
if(Player* owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER)))
owner->GetSession()->SendGMTicketGetTicket(0x0A,0);
}
CharacterDatabase.PExecute("DELETE FROM character_ticket");

View file

@ -121,5 +121,5 @@ class GMTicketMgr
GMTicketMap m_GMTicketMap;
};
#define ticketmgr MaNGOS::Singleton<GMTicketMgr>::Instance()
#define sTicketMgr MaNGOS::Singleton<GMTicketMgr>::Instance()
#endif

View file

@ -19,7 +19,7 @@
#include "GameEventMgr.h"
#include "World.h"
#include "ObjectMgr.h"
#include "PoolHandler.h"
#include "PoolManager.h"
#include "ProgressBar.h"
#include "Language.h"
#include "Log.h"
@ -305,7 +305,7 @@ void GameEventMgr::LoadFromDB()
if(newModelEquipSet.equipment_id > 0)
{
if(!objmgr.GetEquipmentInfo(newModelEquipSet.equipment_id))
if(!sObjectMgr.GetEquipmentInfo(newModelEquipSet.equipment_id))
{
sLog.outErrorDb("Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", guid, newModelEquipSet.equipment_id);
continue;
@ -399,7 +399,7 @@ void GameEventMgr::LoadFromDB()
continue;
}
if (!poolhandler.CheckPool(entry))
if (!sPoolMgr.CheckPool(entry))
{
sLog.outErrorDb("Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry);
continue;
@ -514,13 +514,13 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr)
{
// Add to correct cell
CreatureData const* data = objmgr.GetCreatureData(*itr);
CreatureData const* data = sObjectMgr.GetCreatureData(*itr);
if (data)
{
objmgr.AddCreatureToGrid(*itr, data);
sObjectMgr.AddCreatureToGrid(*itr, data);
// Spawn if necessary (loaded grids only)
Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(data->mapid));
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
// We use spawn coords to spawn
if(!map->Instanceable() && map->IsLoaded(data->posX,data->posY))
{
@ -547,13 +547,13 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr)
{
// Add to correct cell
GameObjectData const* data = objmgr.GetGOData(*itr);
GameObjectData const* data = sObjectMgr.GetGOData(*itr);
if (data)
{
objmgr.AddGameobjectToGrid(*itr, data);
sObjectMgr.AddGameobjectToGrid(*itr, data);
// Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existed
Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(data->mapid));
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
// We use current coords to unspawn, not spawn coords since creature can have changed grid
if(!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
@ -580,9 +580,9 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
{
poolhandler.SpawnPool(*itr, 0, 0);
poolhandler.SpawnPool(*itr, 0, TYPEID_GAMEOBJECT);
poolhandler.SpawnPool(*itr, 0, TYPEID_UNIT);
sPoolMgr.SpawnPool(*itr, 0, 0);
sPoolMgr.SpawnPool(*itr, 0, TYPEID_GAMEOBJECT);
sPoolMgr.SpawnPool(*itr, 0, TYPEID_UNIT);
}
}
@ -599,9 +599,9 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr)
{
// Remove the creature from grid
if( CreatureData const* data = objmgr.GetCreatureData(*itr) )
if( CreatureData const* data = sObjectMgr.GetCreatureData(*itr) )
{
objmgr.RemoveCreatureFromGrid(*itr, data);
sObjectMgr.RemoveCreatureFromGrid(*itr, data);
if( Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT)) )
pCreature->AddObjectToRemoveList();
@ -617,11 +617,11 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr)
{
// Remove the gameobject from grid
if(GameObjectData const* data = objmgr.GetGOData(*itr))
if(GameObjectData const* data = sObjectMgr.GetGOData(*itr))
{
objmgr.RemoveGameobjectFromGrid(*itr, data);
sObjectMgr.RemoveGameobjectFromGrid(*itr, data);
if( GameObject* pGameobject = ObjectAccessor::Instance().GetGameObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT)) )
if( GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT)) )
pGameobject->AddObjectToRemoveList();
}
}
@ -633,7 +633,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
{
poolhandler.DespawnPool(*itr);
sPoolMgr.DespawnPool(*itr);
}
}
@ -642,7 +642,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
for(ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin();itr != mGameEventModelEquip[event_id].end();++itr)
{
// Remove the creature from grid
CreatureData const* data = objmgr.GetCreatureData(itr->first);
CreatureData const* data = sObjectMgr.GetCreatureData(itr->first);
if(!data)
continue;
@ -657,7 +657,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
pCreature->LoadEquipment(itr->second.equipment_id, true);
if (itr->second.modelid >0 && itr->second.modelid_prev != itr->second.modelid)
{
CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(itr->second.modelid);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid);
if (minfo)
{
pCreature->SetDisplayId(itr->second.modelid);
@ -672,7 +672,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
pCreature->LoadEquipment(itr->second.equipement_id_prev, true);
if (itr->second.modelid_prev >0 && itr->second.modelid_prev != itr->second.modelid)
{
CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(itr->second.modelid_prev);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid_prev);
if (minfo)
{
pCreature->SetDisplayId(itr->second.modelid_prev);
@ -685,12 +685,12 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
}
else // If not spawned
{
CreatureData const* data2 = objmgr.GetCreatureData(itr->first);
CreatureData const* data2 = sObjectMgr.GetCreatureData(itr->first);
if (data2 && activate)
{
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(data2->id);
uint32 display_id = objmgr.ChooseDisplayId(0,cinfo,data2);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(data2->id);
uint32 display_id = sObjectMgr.ChooseDisplayId(0,cinfo,data2);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
@ -703,7 +703,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
}
// now last step: put in data
// just to have write access to it
CreatureData& data2 = objmgr.NewOrExistCreatureData(itr->first);
CreatureData& data2 = sObjectMgr.NewOrExistCreatureData(itr->first);
if (activate)
{
data2.displayid = itr->second.modelid;
@ -722,7 +722,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
QuestRelList::iterator itr;
for (itr = mGameEventQuests[event_id].begin();itr != mGameEventQuests[event_id].end();++itr)
{
QuestRelations &CreatureQuestMap = objmgr.mCreatureQuestRelations;
QuestRelations &CreatureQuestMap = sObjectMgr.mCreatureQuestRelations;
if (Activate) // Add the pair(id,quest) to the multimap
CreatureQuestMap.insert(QuestRelations::value_type(itr->first, itr->second));
else
@ -750,8 +750,8 @@ GameEventMgr::GameEventMgr()
MANGOS_DLL_SPEC bool IsHolidayActive( HolidayIds id )
{
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList();
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
GameEventMgr::ActiveEvents const& ae = sGameEventMgr.GetActiveEventList();
for(GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr)
if(events[*itr].holiday_id==id)

View file

@ -97,7 +97,7 @@ class GameEventMgr
bool m_IsGameEventsInit;
};
#define gameeventmgr MaNGOS::Singleton<GameEventMgr>::Instance()
#define sGameEventMgr MaNGOS::Singleton<GameEventMgr>::Instance()
MANGOS_DLL_SPEC bool IsHolidayActive(HolidayIds id);

View file

@ -20,7 +20,7 @@
#include "QuestDef.h"
#include "GameObject.h"
#include "ObjectMgr.h"
#include "PoolHandler.h"
#include "PoolManager.h"
#include "SpellMgr.h"
#include "Spell.h"
#include "UpdateMask.h"
@ -113,7 +113,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
return false;
}
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(name_id);
GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(name_id);
if (!goinfo)
{
sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3);
@ -258,9 +258,9 @@ void GameObject::Update(uint32 /*p_time*/)
return;
}
// respawn timer
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
if (poolid)
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
else
GetMap()->Add(this);
break;
@ -473,9 +473,9 @@ void GameObject::Delete()
SetGoState(GO_STATE_READY);
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
if (poolid)
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
else
AddObjectToRemoveList();
}
@ -497,7 +497,7 @@ void GameObject::SaveToDB()
{
// this should only be used when the gameobject has already been loaded
// preferably after adding to map, because mapid may not be valid otherwise
GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid);
GameObjectData const *data = sObjectMgr.GetGOData(m_DBTableGuid);
if(!data)
{
sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!");
@ -517,7 +517,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
if (!m_DBTableGuid)
m_DBTableGuid = GetGUIDLow();
// update in loaded data (changing data only in this place)
GameObjectData& data = objmgr.NewGOData(m_DBTableGuid);
GameObjectData& data = sObjectMgr.NewGOData(m_DBTableGuid);
// data->guid = guid don't must be update at save
data.id = GetEntry();
@ -564,7 +564,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
bool GameObject::LoadFromDB(uint32 guid, Map *map)
{
GameObjectData const* data = objmgr.GetGOData(guid);
GameObjectData const* data = sObjectMgr.GetGOData(guid);
if( !data )
{
@ -589,7 +589,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
GOState go_state = data->go_state;
m_DBTableGuid = guid;
if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
if (map->GetInstanceId() != 0) guid = sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state) )
return false;
@ -607,13 +607,13 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
{
m_spawnedByDefault = true;
m_respawnDelayTime = data->spawntimesecs;
m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
m_respawnTime = sObjectMgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
// ready to respawn
if(m_respawnTime && m_respawnTime <= time(NULL))
{
m_respawnTime = 0;
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
}
}
else
@ -629,8 +629,8 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
void GameObject::DeleteFromDB()
{
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
objmgr.DeleteGOData(m_DBTableGuid);
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
sObjectMgr.DeleteGOData(m_DBTableGuid);
WorldDatabase.PExecuteLog("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid);
WorldDatabase.PExecuteLog("DELETE FROM game_event_gameobject WHERE guid = '%u'", m_DBTableGuid);
WorldDatabase.PExecuteLog("DELETE FROM gameobject_battleground WHERE guid = '%u'", m_DBTableGuid);
@ -646,7 +646,7 @@ GameObjectInfo const *GameObject::GetGOInfo() const
/*********************************************************/
bool GameObject::hasQuest(uint32 quest_id) const
{
QuestRelations const& qr = objmgr.mGOQuestRelations;
QuestRelations const& qr = sObjectMgr.mGOQuestRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
{
if(itr->second==quest_id)
@ -657,7 +657,7 @@ bool GameObject::hasQuest(uint32 quest_id) const
bool GameObject::hasInvolvedQuest(uint32 quest_id) const
{
QuestRelations const& qr = objmgr.mGOQuestInvolvedRelations;
QuestRelations const& qr = sObjectMgr.mGOQuestInvolvedRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
{
if(itr->second==quest_id)
@ -682,7 +682,7 @@ Unit* GameObject::GetOwner() const
void GameObject::SaveRespawnTime()
{
if(m_respawnTime > time(NULL) && m_spawnedByDefault)
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
}
bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const
@ -725,13 +725,13 @@ void GameObject::Respawn()
if(m_spawnedByDefault && m_respawnTime > 0)
{
m_respawnTime = time(NULL);
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
}
}
bool GameObject::ActivateToQuest( Player *pTarget)const
{
if(!objmgr.IsGameObjectForQuests(GetEntry()))
if(!sObjectMgr.IsGameObjectForQuests(GetEntry()))
return false;
switch(GetGoType())
@ -1012,9 +1012,9 @@ void GameObject::Use(Unit* user)
uint32 zone, subzone;
GetZoneAndAreaId(zone,subzone);
int32 zone_skill = objmgr.GetFishingBaseSkillLevel( subzone );
int32 zone_skill = sObjectMgr.GetFishingBaseSkillLevel( subzone );
if(!zone_skill)
zone_skill = objmgr.GetFishingBaseSkillLevel( zone );
zone_skill = sObjectMgr.GetFishingBaseSkillLevel( zone );
//provide error, no fishable zone or area should be 0
if(!zone_skill)
@ -1293,7 +1293,7 @@ const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
{
if (loc_idx >= 0)
{
GameObjectLocale const *cl = objmgr.GetGameObjectLocale(GetEntry());
GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry());
if (cl)
{
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())

View file

@ -51,7 +51,7 @@ static void CorpsesEraseCallBack(QueryResult *result, bool bones)
/// Resurrectable - convert corpses to bones
if(!bones)
{
if(!ObjectAccessor::Instance().ConvertCorpseForPlayer(player_guid))
if(!sObjectAccessor.ConvertCorpseForPlayer(player_guid))
{
sLog.outDebug("Corpse %u not found in world or bones creating forbidden. Delete from DB.",guidlow);
CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow);
@ -60,7 +60,7 @@ static void CorpsesEraseCallBack(QueryResult *result, bool bones)
else
///- or delete bones
{
MapManager::Instance().RemoveBonesFromMap(mapid, guid, positionX, positionY);
sMapMgr.RemoveBonesFromMap(mapid, guid, positionX, positionY);
///- remove bones from the database
CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow);

View file

@ -147,7 +147,7 @@ void PlayerMenu::SendGossipMenu( uint32 TitleTextId, uint64 npcGUID )
{
QuestMenuItem const& qItem = mQuestMenu.GetItem(iI);
uint32 questID = qItem.m_qId;
Quest const* pQuest = objmgr.GetQuestTemplate(questID);
Quest const* pQuest = sObjectMgr.GetQuestTemplate(questID);
data << uint32(questID);
data << uint32(qItem.m_qIcon);
@ -157,7 +157,7 @@ void PlayerMenu::SendGossipMenu( uint32 TitleTextId, uint64 npcGUID )
int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
QuestLocale const *ql = objmgr.GetQuestLocale(questID);
QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID);
if (ql)
{
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
@ -195,7 +195,7 @@ void PlayerMenu::SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flag
void PlayerMenu::SendPointOfInterest( uint32 poi_id )
{
PointOfInterest const* poi = objmgr.GetPointOfInterest(poi_id);
PointOfInterest const* poi = sObjectMgr.GetPointOfInterest(poi_id);
if(!poi)
{
sLog.outErrorDb("Requested send not existed POI (Id: %u), ignore.",poi_id);
@ -207,7 +207,7 @@ void PlayerMenu::SendPointOfInterest( uint32 poi_id )
int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
PointOfInterestLocale const *pl = objmgr.GetPointOfInterestLocale(poi_id);
PointOfInterestLocale const *pl = sObjectMgr.GetPointOfInterestLocale(poi_id);
if (pl)
{
if (pl->IconName.size() > size_t(loc_idx) && !pl->IconName[loc_idx].empty())
@ -229,7 +229,7 @@ void PlayerMenu::SendPointOfInterest( uint32 poi_id )
void PlayerMenu::SendTalking( uint32 textID )
{
GossipText const* pGossip = objmgr.GetGossipText(textID);
GossipText const* pGossip = sObjectMgr.GetGossipText(textID);
WorldPacket data( SMSG_NPC_TEXT_UPDATE, 100 ); // guess size
data << textID; // can be < 0
@ -261,7 +261,7 @@ void PlayerMenu::SendTalking( uint32 textID )
int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
NpcTextLocale const *nl = objmgr.GetNpcTextLocale(textID);
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID);
if (nl)
{
for (int i=0;i<8;++i)
@ -340,7 +340,7 @@ QuestMenu::~QuestMenu()
void QuestMenu::AddMenuItem( uint32 QuestId, uint8 Icon)
{
Quest const* qinfo = objmgr.GetQuestTemplate(QuestId);
Quest const* qinfo = sObjectMgr.GetQuestTemplate(QuestId);
if (!qinfo) return;
ASSERT( m_qItems.size() <= GOSSIP_MAX_MENU_ITEMS );
@ -384,14 +384,14 @@ void PlayerMenu::SendQuestGiverQuestList( QEmote eEmote, const std::string& Titl
QuestMenuItem const& qmi = mQuestMenu.GetItem(iI);
uint32 questID = qmi.m_qId;
Quest const *pQuest = objmgr.GetQuestTemplate(questID);
Quest const *pQuest = sObjectMgr.GetQuestTemplate(questID);
std::string title = pQuest ? pQuest->GetTitle() : "";
int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
if(QuestLocale const *ql = objmgr.GetQuestLocale(questID))
if(QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID))
{
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
title=ql->Title[loc_idx];
@ -427,7 +427,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId());
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
if (ql)
{
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
@ -470,7 +470,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
if ( !pQuest->RewChoiceItemId[i] ) continue;
data << uint32(pQuest->RewChoiceItemId[i]);
data << uint32(pQuest->RewChoiceItemCount[i]);
IProto = objmgr.GetItemPrototype(pQuest->RewChoiceItemId[i]);
IProto = ObjectMgr::GetItemPrototype(pQuest->RewChoiceItemId[i]);
if ( IProto )
data << uint32(IProto->DisplayInfoID);
else
@ -483,7 +483,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
if ( !pQuest->RewItemId[i] ) continue;
data << uint32(pQuest->RewItemId[i]);
data << uint32(pQuest->RewItemCount[i]);
IProto = objmgr.GetItemPrototype(pQuest->RewItemId[i]);
IProto = ObjectMgr::GetItemPrototype(pQuest->RewItemId[i]);
if ( IProto )
data << uint32(IProto->DisplayInfoID);
else
@ -538,7 +538,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId());
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
if (ql)
{
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
@ -676,7 +676,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId());
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
if (ql)
{
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
@ -716,7 +716,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
data << uint32(pQuest->GetRewChoiceItemsCount());
for (uint32 i=0; i < pQuest->GetRewChoiceItemsCount(); ++i)
{
pItem = objmgr.GetItemPrototype( pQuest->RewChoiceItemId[i] );
pItem = ObjectMgr::GetItemPrototype( pQuest->RewChoiceItemId[i] );
data << uint32(pQuest->RewChoiceItemId[i]);
data << uint32(pQuest->RewChoiceItemCount[i]);
@ -730,7 +730,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
data << uint32(pQuest->GetRewItemsCount());
for (uint16 i=0; i < pQuest->GetRewItemsCount(); ++i)
{
pItem = objmgr.GetItemPrototype(pQuest->RewItemId[i]);
pItem = ObjectMgr::GetItemPrototype(pQuest->RewItemId[i]);
data << uint32(pQuest->RewItemId[i]);
data << uint32(pQuest->RewItemCount[i]);
@ -778,7 +778,7 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
QuestLocale const *ql = objmgr.GetQuestLocale(pQuest->GetQuestId());
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
if (ql)
{
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
@ -824,7 +824,7 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
{
if ( !pQuest->ReqItemId[i] )
continue;
pItem = objmgr.GetItemPrototype(pQuest->ReqItemId[i]);
pItem = ObjectMgr::GetItemPrototype(pQuest->ReqItemId[i]);
data << uint32(pQuest->ReqItemId[i]);
data << uint32(pQuest->ReqItemCount[i]);

View file

@ -99,7 +99,7 @@ bool Group::Create(const uint64 &guid, const char * name)
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
if(!isBGGroup())
{
Player *leader = objmgr.GetPlayer(guid);
Player *leader = sObjectMgr.GetPlayer(guid);
if(leader)
{
m_dungeonDifficulty = leader->GetDungeonDifficulty();
@ -145,7 +145,7 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool
m_leaderGuid = leaderGuid;
// group leader not exist
if(!objmgr.GetPlayerNameByGUID(m_leaderGuid, m_leaderName))
if(!sObjectMgr.GetPlayerNameByGUID(m_leaderGuid, m_leaderName))
{
if(!external) delete result;
return false;
@ -202,7 +202,7 @@ bool Group::LoadMemberFromDB(uint32 guidLow, uint8 subgroup, bool assistant)
member.guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER);
// skip non-existed member
if(!objmgr.GetPlayerNameByGUID(member.guid, member.name))
if(!sObjectMgr.GetPlayerNameByGUID(member.guid, member.name))
return false;
member.group = subgroup;
@ -226,7 +226,7 @@ void Group::ConvertToRaid()
// update quest related GO states (quest activity dependent from raid membership)
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
if(Player* player = objmgr.GetPlayer(citr->guid))
if(Player* player = sObjectMgr.GetPlayer(citr->guid))
player->UpdateForQuestWorldObjects();
}
@ -301,7 +301,7 @@ bool Group::AddMember(const uint64 &guid, const char* name)
return false;
SendUpdate();
Player *player = objmgr.GetPlayer(guid);
Player *player = sObjectMgr.GetPlayer(guid);
if(player)
{
if(!IsLeader(player->GetGUID()) && !isBGGroup())
@ -343,7 +343,7 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
{
bool leaderChanged = _removeMember(guid);
if(Player *player = objmgr.GetPlayer( guid ))
if(Player *player = sObjectMgr.GetPlayer( guid ))
{
// quest related GO state dependent from raid membership
if(isRaidGroup())
@ -409,7 +409,7 @@ void Group::Disband(bool hideDestroy)
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
player = objmgr.GetPlayer(citr->guid);
player = sObjectMgr.GetPlayer(citr->guid);
if(!player)
continue;
@ -491,7 +491,7 @@ void Group::SendLootStartRoll(uint32 CountDown, const Roll &r)
for (Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
{
Player *p = objmgr.GetPlayer(itr->first);
Player *p = sObjectMgr.GetPlayer(itr->first);
if(!p || !p->GetSession())
continue;
@ -515,7 +515,7 @@ void Group::SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uin
for( Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
{
Player *p = objmgr.GetPlayer(itr->first);
Player *p = sObjectMgr.GetPlayer(itr->first);
if(!p || !p->GetSession())
continue;
@ -538,7 +538,7 @@ void Group::SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid,
for( Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
{
Player *p = objmgr.GetPlayer(itr->first);
Player *p = sObjectMgr.GetPlayer(itr->first);
if(!p || !p->GetSession())
continue;
@ -558,7 +558,7 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r)
for( Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
{
Player *p = objmgr.GetPlayer(itr->first);
Player *p = sObjectMgr.GetPlayer(itr->first);
if(!p || !p->GetSession())
continue;
@ -572,12 +572,12 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
std::vector<LootItem>::iterator i;
ItemPrototype const *item;
uint8 itemSlot = 0;
Player *player = objmgr.GetPlayer(playerGUID);
Player *player = sObjectMgr.GetPlayer(playerGUID);
Group *group = player->GetGroup();
for (i = loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
{
item = objmgr.GetItemPrototype(i->itemid);
item = ObjectMgr::GetItemPrototype(i->itemid);
if (!item)
{
//sLog.outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
@ -587,7 +587,7 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
//roll for over-threshold item if it's one-player loot
if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall)
{
uint64 newitemGUID = MAKE_NEW_GUID(objmgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
Roll* r = new Roll(newitemGUID, *i);
//a vector is filled with only near party members
@ -625,18 +625,18 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *creature)
{
ItemPrototype const *item;
Player *player = objmgr.GetPlayer(playerGUID);
Player *player = sObjectMgr.GetPlayer(playerGUID);
Group *group = player->GetGroup();
uint8 itemSlot = 0;
for(std::vector<LootItem>::iterator i=loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
{
item = objmgr.GetItemPrototype(i->itemid);
item = ObjectMgr::GetItemPrototype(i->itemid);
//only roll for one-player items, not for ones everyone can get
if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall)
{
uint64 newitemGUID = MAKE_NEW_GUID(objmgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
Roll* r = new Roll(newitemGUID, *i);
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
@ -678,7 +678,7 @@ void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *crea
void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creature)
{
Player *player = objmgr.GetPlayer(playerGUID);
Player *player = sObjectMgr.GetPlayer(playerGUID);
if(!player)
return;
@ -809,7 +809,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
}
}
SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll);
player = objmgr.GetPlayer(maxguid);
player = sObjectMgr.GetPlayer(maxguid);
if(player && player->GetSession())
{
@ -856,7 +856,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
}
}
SendLootRollWon(0, maxguid, maxresul, ROLL_GREED, *roll);
player = objmgr.GetPlayer(maxguid);
player = sObjectMgr.GetPlayer(maxguid);
if(player && player->GetSession())
{
@ -992,7 +992,7 @@ void Group::SendUpdate()
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
player = objmgr.GetPlayer(citr->guid);
player = sObjectMgr.GetPlayer(citr->guid);
if(!player || !player->GetSession() || player->GetGroup() != this )
continue;
// guess size
@ -1007,7 +1007,7 @@ void Group::SendUpdate()
{
if(citr->guid == citr2->guid)
continue;
Player* member = objmgr.GetPlayer(citr2->guid);
Player* member = sObjectMgr.GetPlayer(citr2->guid);
uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);
@ -1079,7 +1079,7 @@ void Group::OfflineReadyCheck()
{
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
Player *pl = objmgr.GetPlayer(citr->guid);
Player *pl = sObjectMgr.GetPlayer(citr->guid);
if (!pl || !pl->GetSession())
{
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
@ -1121,7 +1121,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
if(!guid)
return false;
Player *player = objmgr.GetPlayer(guid);
Player *player = sObjectMgr.GetPlayer(guid);
MemberSlot member;
member.guid = guid;
@ -1167,7 +1167,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
bool Group::_removeMember(const uint64 &guid)
{
Player *player = objmgr.GetPlayer(guid);
Player *player = sObjectMgr.GetPlayer(guid);
if (player)
{
//if we are removing player from battleground raid
@ -1228,7 +1228,7 @@ void Group::_setLeader(const uint64 &guid)
")", GUID_LOPART(m_leaderGuid), GUID_LOPART(slot->guid)
);
Player *player = objmgr.GetPlayer(slot->guid);
Player *player = sObjectMgr.GetPlayer(slot->guid);
if(player)
{
for(uint8 i = 0; i < MAX_DIFFICULTY; ++i)
@ -1361,7 +1361,7 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group)
{
if(!isRaidGroup())
return;
Player *player = objmgr.GetPlayer(guid);
Player *player = sObjectMgr.GetPlayer(guid);
if (!player)
{
@ -1606,7 +1606,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
bool isEmpty = true;
// if the map is loaded, reset it
Map *map = MapManager::Instance().FindMap(p->GetMapId(), p->GetInstanceId());
Map *map = sMapMgr.FindMap(p->GetMapId(), p->GetInstanceId());
if(map && map->IsDungeon() && !(method == INSTANCE_RESET_GROUP_DISBAND && !p->CanReset()))
isEmpty = ((InstanceMap*)map)->Reset(method);
@ -1725,7 +1725,7 @@ void Group::_homebindIfInstance(Player *player)
{
// leaving the group in an instance, the homebind timer is started
// unless the player is permanently saved to the instance
InstanceSave *save = sInstanceSaveManager.GetInstanceSave(player->GetInstanceId());
InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(player->GetInstanceId());
InstancePlayerBind *playerBind = save ? player->GetBoundInstance(save->GetMapId(), save->GetDifficulty()) : NULL;
if(!playerBind || !playerBind->perm)
player->m_InstanceValid = false;

View file

@ -64,7 +64,7 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
return;
}
Player *player = objmgr.GetPlayer(membername.c_str());
Player *player = sObjectMgr.GetPlayer(membername.c_str());
// no player
if(!player)
@ -181,7 +181,7 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
return;
}
Player* leader = objmgr.GetPlayer(group->GetLeaderGUID());
Player* leader = sObjectMgr.GetPlayer(group->GetLeaderGUID());
// forming a new group, create it
if(!group->IsCreated())
@ -189,7 +189,7 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
if( leader )
group->RemoveInvite(leader);
group->Create(group->GetLeaderGUID(), group->GetLeaderName());
objmgr.AddGroup(group);
sObjectMgr.AddGroup(group);
}
// everything's fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!!
@ -204,7 +204,7 @@ void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ )
if (!group) return;
// remember leader if online
Player *leader = objmgr.GetPlayer(group->GetLeaderGUID());
Player *leader = sObjectMgr.GetPlayer(group->GetLeaderGUID());
// uninvite, group can be deleted
GetPlayer()->UninviteFromGroup();
@ -307,7 +307,7 @@ void WorldSession::HandleGroupSetLeaderOpcode( WorldPacket & recv_data )
uint64 guid;
recv_data >> guid;
Player *player = objmgr.GetPlayer(guid);
Player *player = sObjectMgr.GetPlayer(guid);
/** error handling **/
if (!player || !group->IsLeader(GetPlayer()->GetGUID()) || player->GetGroup() != group)
@ -511,7 +511,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
/********************/
// everything's fine, do it
group->ChangeMembersGroup(objmgr.GetPlayer(name.c_str()), groupNr);
group->ChangeMembersGroup(sObjectMgr.GetPlayer(name.c_str()), groupNr);
}
void WorldSession::HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data )
@ -774,7 +774,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
uint64 Guid;
recv_data >> Guid;
Player *player = objmgr.GetPlayer(Guid);
Player *player = sObjectMgr.GetPlayer(Guid);
if(!player)
{
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2);

View file

@ -64,7 +64,7 @@ Guild::~Guild()
bool Guild::Create(Player* leader, std::string gname)
{
if (objmgr.GetGuildByName(gname))
if (sObjectMgr.GetGuildByName(gname))
return false;
WorldSession* lSession = leader->GetSession();
@ -77,7 +77,7 @@ bool Guild::Create(Player* leader, std::string gname)
MOTD = "No message set.";
m_GuildBankMoney = 0;
m_PurchasedTabs = 0;
m_Id = objmgr.GenerateGuildId();
m_Id = sObjectMgr.GenerateGuildId();
sLog.outDebug("GUILD: creating guild %s to leader: %u", gname.c_str(), GUID_LOPART(m_LeaderGuid));
@ -107,18 +107,18 @@ void Guild::CreateDefaultGuildRanks(int locale_idx)
CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid='%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM guild_bank_right WHERE guildid = '%u'", m_Id);
CreateRank(objmgr.GetMangosString(LANG_GUILD_MASTER, locale_idx), GR_RIGHT_ALL);
CreateRank(objmgr.GetMangosString(LANG_GUILD_OFFICER, locale_idx), GR_RIGHT_ALL);
CreateRank(objmgr.GetMangosString(LANG_GUILD_VETERAN, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
CreateRank(objmgr.GetMangosString(LANG_GUILD_MEMBER, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
CreateRank(objmgr.GetMangosString(LANG_GUILD_INITIATE, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_MASTER, locale_idx), GR_RIGHT_ALL);
CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_OFFICER, locale_idx), GR_RIGHT_ALL);
CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_VETERAN, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_MEMBER, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
CreateRank(sObjectMgr.GetMangosString(LANG_GUILD_INITIATE, locale_idx), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
SetBankMoneyPerDay((uint32)GR_GUILDMASTER, WITHDRAW_MONEY_UNLIMITED);
}
bool Guild::AddMember(uint64 plGuid, uint32 plRank)
{
Player* pl = objmgr.GetPlayer(plGuid);
Player* pl = sObjectMgr.GetPlayer(plGuid);
if (pl)
{
if (pl->GetGuildId() != 0)
@ -482,7 +482,7 @@ void Guild::DelMember(uint64 guid, bool isDisbanding)
SetLeader(newLeaderGUID);
// If player not online data in data field will be loaded from guild tabs no need to update it !!
if (Player *newLeader = objmgr.GetPlayer(newLeaderGUID))
if (Player *newLeader = sObjectMgr.GetPlayer(newLeaderGUID))
newLeader->SetRank(GR_GUILDMASTER);
// when leader non-exist (at guild load with deleted leader only) not send broadcasts
@ -507,7 +507,7 @@ void Guild::DelMember(uint64 guid, bool isDisbanding)
members.erase(GUID_LOPART(guid));
Player *player = objmgr.GetPlayer(guid);
Player *player = sObjectMgr.GetPlayer(guid);
// If player not online data in data field will be loaded from guild tabs no need to update it !!
if (player)
{
@ -524,7 +524,7 @@ void Guild::ChangeRank(uint64 guid, uint32 newRank)
if (itr != members.end())
itr->second.RankId = newRank;
Player *player = objmgr.GetPlayer(guid);
Player *player = sObjectMgr.GetPlayer(guid);
// If player not online data in data field will be loaded from guild tabs no need to update it !!
if (player)
player->SetRank(newRank);
@ -723,7 +723,7 @@ void Guild::Disband()
CharacterDatabase.PExecute("DELETE FROM guild_bank_eventlog WHERE guildid = '%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE guildid = '%u'", m_Id);
CharacterDatabase.CommitTransaction();
objmgr.RemoveGuild(m_Id);
sObjectMgr.RemoveGuild(m_Id);
}
void Guild::Roster(WorldSession *session /*= NULL*/)
@ -1211,7 +1211,7 @@ void Guild::LoadGuildBankFromDB()
continue;
}
ItemPrototype const *proto = objmgr.GetItemPrototype(ItemEntry);
ItemPrototype const *proto = ObjectMgr::GetItemPrototype(ItemEntry);
if (!proto)
{

View file

@ -34,7 +34,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
uint32 guildId;
recvPacket >> guildId;
if(Guild *guild = objmgr.GetGuildById(guildId))
if(Guild *guild = sObjectMgr.GetGuildById(guildId))
{
guild->Query(this);
return;
@ -60,7 +60,7 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
return;
}
objmgr.AddGuild(guild);
sObjectMgr.AddGuild(guild);
}
void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
@ -73,7 +73,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
recvPacket >> Invitedname;
if(normalizePlayerName(Invitedname))
player = ObjectAccessor::Instance().FindPlayerByName(Invitedname.c_str());
player = ObjectAccessor::FindPlayerByName(Invitedname.c_str());
if(!player)
{
@ -81,7 +81,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
return;
}
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -143,7 +143,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(plName))
return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -196,12 +196,12 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
sLog.outDebug("WORLD: Received CMSG_GUILD_ACCEPT");
guild = objmgr.GetGuildById(player->GetGuildIdInvited());
guild = sObjectMgr.GetGuildById(player->GetGuildIdInvited());
if(!guild || player->GetGuildId())
return;
// not let enemies sign guild charter
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != objmgr.GetPlayerTeamByGUID(guild->GetLeader()))
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(guild->GetLeader()))
return;
if(!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank()))
@ -230,7 +230,7 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
{
sLog.outDebug("WORLD: Received CMSG_GUILD_INFO");
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -252,7 +252,7 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/)
{
sLog.outDebug("WORLD: Received CMSG_GUILD_ROSTER");
if(Guild* guild = objmgr.GetGuildById(_player->GetGuildId()))
if(Guild* guild = sObjectMgr.GetGuildById(_player->GetGuildId()))
guild->Roster(this);
}
@ -266,7 +266,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(plName))
return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -327,7 +327,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(plName))
return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
@ -389,7 +389,7 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
{
sLog.outDebug("WORLD: Received CMSG_GUILD_LEAVE");
Guild *guild = objmgr.GetGuildById(_player->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(_player->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -427,7 +427,7 @@ void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
{
sLog.outDebug("WORLD: Received CMSG_GUILD_DISBAND");
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -457,7 +457,7 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(name))
return;
Guild *guild = objmgr.GetGuildById(oldLeader->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(oldLeader->GetGuildId());
if (!guild)
{
@ -504,7 +504,7 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
else
MOTD = "";
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -537,7 +537,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
if(!normalizePlayerName(name))
return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if (!guild)
{
@ -576,7 +576,7 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
if (!normalizePlayerName(plName))
return;
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild* guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if (!guild)
{
@ -612,7 +612,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
sLog.outDebug("WORLD: Received CMSG_GUILD_RANK");
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
recvPacket.rpos(recvPacket.wpos()); // set to end to avoid warnings spam
@ -662,7 +662,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
std::string rankname;
recvPacket >> rankname;
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -688,7 +688,7 @@ void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
{
sLog.outDebug("WORLD: Received CMSG_GUILD_DEL_RANK");
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -724,7 +724,7 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
std::string GINFO;
recvPacket >> GINFO;
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
@ -763,7 +763,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId());
if(!guild)
{
//"You are not part of a guild!";
@ -800,7 +800,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
sLog.outDebug("WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)");
if(uint32 GuildId = GetPlayer()->GetGuildId())
if(Guild *pGuild = objmgr.GetGuildById(GuildId))
if(Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
pGuild->DisplayGuildEventLog(this);
}
@ -811,7 +811,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn( WorldPacket & /* recv_data */
sLog.outDebug("WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)");
if(uint32 GuildId = GetPlayer()->GetGuildId())
if(Guild *pGuild = objmgr.GetGuildById(GuildId))
if(Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
pGuild->SendMoneyInfo(this, GetPlayer()->GetGUIDLow());
}
@ -821,7 +821,7 @@ void WorldSession::HandleGuildPermissions( WorldPacket& /* recv_data */ )
if(uint32 GuildId = GetPlayer()->GetGuildId())
{
if(Guild *pGuild = objmgr.GetGuildById(GuildId))
if(Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
{
uint32 rankId = GetPlayer()->GetRank();
@ -857,7 +857,7 @@ void WorldSession::HandleGuildBankerActivate( WorldPacket & recv_data )
if (uint32 GuildId = GetPlayer()->GetGuildId())
{
if(Guild *pGuild = objmgr.GetGuildById(GuildId))
if(Guild *pGuild = sObjectMgr.GetGuildById(GuildId))
{
pGuild->DisplayGuildBankTabsInfo(this); // this also will load guild bank if not yet
return;
@ -883,7 +883,7 @@ void WorldSession::HandleGuildBankQueryTab( WorldPacket & recv_data )
if (!GuildId)
return;
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild)
return;
@ -917,7 +917,7 @@ void WorldSession::HandleGuildBankDepositMoney( WorldPacket & recv_data )
if (!GuildId)
return;
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild)
return;
@ -965,7 +965,7 @@ void WorldSession::HandleGuildBankWithdrawMoney( WorldPacket & recv_data )
if (GuildId == 0)
return;
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if(!pGuild)
return;
@ -1025,7 +1025,7 @@ void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data )
return;
}
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild || !pGuild->IsGuildBankLoaded())
{
recv_data.rpos(recv_data.wpos()); // prevent additional spam at rejected packet
@ -1123,7 +1123,7 @@ void WorldSession::HandleGuildBankBuyTab( WorldPacket & recv_data )
if (!GuildId)
return;
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if(!pGuild)
return;
@ -1173,7 +1173,7 @@ void WorldSession::HandleGuildBankUpdateTab( WorldPacket & recv_data )
if (!GuildId)
return;
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild)
return;
@ -1196,7 +1196,7 @@ void WorldSession::HandleGuildBankLogQuery( WorldPacket & recv_data )
if (!GuildId)
return;
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild)
return;
@ -1221,7 +1221,7 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data)
if (!GuildId)
return;
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild)
return;
@ -1244,7 +1244,7 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data)
if (!GuildId)
return;
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild)
return;

View file

@ -68,7 +68,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
// restore orientation of not moving creature at returning to home
if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
{
if(CreatureData const* data = objmgr.GetCreatureData(owner.GetDBTableGUIDLow()))
if(CreatureData const* data = sObjectMgr.GetCreatureData(owner.GetDBTableGUIDLow()))
{
owner.SetOrientation(data->orientation);
WorldPacket packet;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "HostilRefManager.h"
#include "HostileRefManager.h"
#include "ThreatManager.h"
#include "Unit.h"
#include "DBCStructure.h"

View file

@ -168,7 +168,7 @@ void InstanceSave::SaveToDB()
// save instance data too
std::string data;
Map *map = MapManager::Instance().FindMap(GetMapId(),m_instanceid);
Map *map = sMapMgr.FindMap(GetMapId(),m_instanceid);
if(map)
{
assert(map->IsDungeon());
@ -196,7 +196,7 @@ time_t InstanceSave::GetResetTimeForDB()
// to cache or not to cache, that is the question
InstanceTemplate const* InstanceSave::GetTemplate()
{
return objmgr.GetInstanceTemplate(m_mapid);
return ObjectMgr::GetInstanceTemplate(m_mapid);
}
MapEntry const* InstanceSave::GetMapEntry()
@ -214,8 +214,8 @@ bool InstanceSave::UnloadIfEmpty()
{
if(m_playerList.empty() && m_groupList.empty())
{
if(!sInstanceSaveManager.lock_instLists)
sInstanceSaveManager.RemoveInstanceSave(GetInstanceId());
if(!sInstanceSaveMgr.lock_instLists)
sInstanceSaveMgr.RemoveInstanceSave(GetInstanceId());
return false;
}
else
@ -258,7 +258,7 @@ void InstanceSaveManager::CleanupInstances()
bar.step();
// load reset times and clean expired instances
sInstanceSaveManager.LoadResetTimes();
LoadResetTimes();
// clean character/group - instance binds with invalid group/characters
_DelHelper(CharacterDatabase, "character_instance.guid, instance", "character_instance", "LEFT JOIN characters ON character_instance.guid = characters.guid WHERE characters.guid IS NULL");
@ -431,7 +431,7 @@ void InstanceSaveManager::LoadResetTimes()
{
Field *fields = result->Fetch();
uint32 mapid = fields[0].GetUInt32();
if(!objmgr.GetInstanceTemplate(mapid))
if(!ObjectMgr::GetInstanceTemplate(mapid))
{
sLog.outError("InstanceSaveManager::LoadResetTimes: invalid mapid %u in instance_reset!", mapid);
CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u'", mapid);
@ -457,7 +457,7 @@ void InstanceSaveManager::LoadResetTimes()
// add the global reset times to the priority queue
for(uint32 i = 0; i < sInstanceTemplate.MaxEntry; i++)
{
InstanceTemplate const* temp = objmgr.GetInstanceTemplate(i);
InstanceTemplate const* temp = ObjectMgr::GetInstanceTemplate(i);
if(!temp || temp->reset_delay == 0)
continue;
@ -567,7 +567,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr)
void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
{
sLog.outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId);
Map *map = (MapInstanced*)MapManager::Instance().CreateBaseMap(mapid);
Map *map = (MapInstanced*)sMapMgr.CreateBaseMap(mapid);
if(!map->Instanceable())
return;
@ -577,14 +577,14 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
Map* iMap = ((MapInstanced*)map)->FindMap(instanceId);
if(iMap && iMap->IsDungeon()) ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);
else objmgr.DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded
else sObjectMgr.DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded
}
void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLeft)
{
// global reset for all instances of the given map
// note: this isn't fast but it's meant to be executed very rarely
Map const *map = MapManager::Instance().CreateBaseMap(mapid);
Map const *map = sMapMgr.CreateBaseMap(mapid);
if(!map->Instanceable())
return;
uint64 now = (uint64)time(NULL);
@ -592,7 +592,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe
if(!warn)
{
// this is called one minute before the reset time
InstanceTemplate const* temp = objmgr.GetInstanceTemplate(mapid);
InstanceTemplate const* temp = ObjectMgr::GetInstanceTemplate(mapid);
if(!temp || !temp->reset_delay)
{
sLog.outError("InstanceSaveManager::ResetOrWarnAll: no instance template or reset delay for map %d", mapid);

View file

@ -169,5 +169,5 @@ class MANGOS_DLL_DECL InstanceSaveManager : public MaNGOS::Singleton<InstanceSav
ResetTimeQueue m_resetTimeQueue;
};
#define sInstanceSaveManager MaNGOS::Singleton<InstanceSaveManager>::Instance()
#define sInstanceSaveMgr MaNGOS::Singleton<InstanceSaveManager>::Instance()
#endif

View file

@ -255,7 +255,7 @@ bool Item::Create( uint32 guidlow, uint32 itemid, Player const* owner)
SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0);
SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0);
ItemPrototype const *itemProto = objmgr.GetItemPrototype(itemid);
ItemPrototype const *itemProto = ObjectMgr::GetItemPrototype(itemid);
if(!itemProto)
return false;
@ -441,12 +441,12 @@ void Item::DeleteFromInventoryDB()
ItemPrototype const *Item::GetProto() const
{
return objmgr.GetItemPrototype(GetEntry());
return ObjectMgr::GetItemPrototype(GetEntry());
}
Player* Item::GetOwner()const
{
return objmgr.GetPlayer(GetOwnerGUID());
return sObjectMgr.GetPlayer(GetOwnerGUID());
}
uint32 Item::GetSkill()
@ -774,7 +774,7 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const
bool Item::IsTargetValidForItemUse(Unit* pUnitTarget)
{
ItemRequiredTargetMapBounds bounds = objmgr.GetItemRequiredTargetMapBounds(GetProto()->ItemId);
ItemRequiredTargetMapBounds bounds = sObjectMgr.GetItemRequiredTargetMapBounds(GetProto()->ItemId);
if (bounds.first == bounds.second)
return true;
@ -936,7 +936,7 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player )
if ( count < 1 )
return NULL; //don't create item at zero count
ItemPrototype const *pProto = objmgr.GetItemPrototype( item );
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( item );
if( pProto )
{
if ( count > pProto->GetMaxStackSize())
@ -945,7 +945,7 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player )
assert(count !=0 && "pProto->Stackable==0 but checked at loading already");
Item *pItem = NewItemOrBag( pProto );
if( pItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), item, player) )
if( pItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), item, player) )
{
pItem->SetCount( count );
return pItem;
@ -985,14 +985,14 @@ bool Item::IsBindedNotWith( Player const* player ) const
return true;
// online
if(Player* owner = objmgr.GetPlayer(GetOwnerGUID()))
if(Player* owner = sObjectMgr.GetPlayer(GetOwnerGUID()))
{
return owner->GetSession()->GetAccountId() != player->GetSession()->GetAccountId();
}
// offline slow case
else
{
return objmgr.GetPlayerAccountIdByGUID(GetOwnerGUID()) != player->GetSession()->GetAccountId();
return sObjectMgr.GetPlayerAccountIdByGUID(GetOwnerGUID()) != player->GetSession()->GetAccountId();
}
}

View file

@ -124,7 +124,7 @@ uint32 GetItemEnchantMod(uint32 entry)
uint32 GenerateEnchSuffixFactor(uint32 item_id)
{
ItemPrototype const *itemProto = objmgr.GetItemPrototype(item_id);
ItemPrototype const *itemProto = ObjectMgr::GetItemPrototype(item_id);
if(!itemProto)
return 0;

View file

@ -285,7 +285,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
sLog.outDetail("STORAGE: Item Query = %u", item);
ItemPrototype const *pProto = objmgr.GetItemPrototype( item );
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( item );
if( pProto )
{
std::string Name = pProto->Name1;
@ -294,7 +294,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex();
if ( loc_idx >= 0 )
{
ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId);
ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
if (il)
{
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
@ -739,7 +739,7 @@ void WorldSession::SendListInventory( uint64 vendorguid )
{
if(VendorItem const* crItem = vItems->GetItem(i))
{
if(ItemPrototype const *pProto = objmgr.GetItemPrototype(crItem->item))
if(ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(crItem->item))
{
if((pProto->AllowableClass & _player->getClassMask()) == 0 && pProto->Bonding == BIND_WHEN_PICKED_UP && !_player->isGameMaster())
continue;
@ -971,7 +971,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data)
recv_data.read_skip<uint64>(); // guid
sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid);
ItemPrototype const *pProto = objmgr.GetItemPrototype( itemid );
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( itemid );
if( pProto )
{
std::string Name;
@ -980,7 +980,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data)
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId);
ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
if (il)
{
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())

View file

@ -31,7 +31,7 @@ static void AttemptJoin(Player* _player)
return;
//TODO: Guard Player Map
HashMapHolder<Player>::MapType const& players = ObjectAccessor::Instance().GetPlayers();
HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
{
Player *plr = iter->second;
@ -62,7 +62,7 @@ static void AttemptJoin(Player* _player)
continue;
}
objmgr.AddGroup(group);
sObjectMgr.AddGroup(group);
}
// stop at success join
@ -91,7 +91,7 @@ static void AttemptAddMore(Player* _player)
return;
//TODO: Guard Player map
HashMapHolder<Player>::MapType const& players = ObjectAccessor::Instance().GetPlayers();
HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
{
Player *plr = iter->second;
@ -120,7 +120,7 @@ static void AttemptAddMore(Player* _player)
return; // can't create group (??)
}
objmgr.AddGroup(group);
sObjectMgr.AddGroup(group);
}
// stop at join fail (full)
@ -302,7 +302,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
data << uint32(0); // unk
//TODO: Guard Player map
HashMapHolder<Player>::MapType const& players = ObjectAccessor::Instance().GetPlayers();
HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
{
Player *plr = iter->second;

View file

@ -113,7 +113,7 @@ bool ChatHandler::HandleNpcWhisperCommand(const char* args)
uint64 receiver_guid= atol(receiver_str);
// check online security
if (HasLowerSecurity(objmgr.GetPlayer(receiver_guid), 0))
if (HasLowerSecurity(sObjectMgr.GetPlayer(receiver_guid), 0))
return false;
pCreature->MonsterWhisper(text,receiver_guid);
@ -545,7 +545,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
InstanceGroupBind *gBind = group ? group->GetBoundInstance(target) : NULL;
// if no bind exists, create a solo bind
if (!gBind)
if (InstanceSave *save = sInstanceSaveManager.GetInstanceSave(target->GetInstanceId()))
if (InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(target->GetInstanceId()))
_player->BindToInstance(save, !save->CanReset());
}
@ -1911,7 +1911,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
std::ostringstream reply;
GameTeleMap const & teleMap = objmgr.GetGameTeleMap();
GameTeleMap const & teleMap = sObjectMgr.GetGameTeleMap();
for(GameTeleMap::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
{
GameTele const* tele = &itr->second;
@ -1967,7 +1967,7 @@ bool ChatHandler::HandleWhispersCommand(const char* args)
//Save all players in the world
bool ChatHandler::HandleSaveAllCommand(const char* /*args*/)
{
ObjectAccessor::Instance().SaveAllPlayers();
sObjectAccessor.SaveAllPlayers();
SendSysMessage(LANG_PLAYERS_SAVED);
return true;
}
@ -2005,7 +2005,7 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
// from console show not existed sender
MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
uint32 itemTextId = !text.empty() ? objmgr.CreateItemText( text ) : 0;
uint32 itemTextId = !text.empty() ? sObjectMgr.CreateItemText( text ) : 0;
MailDraft(subject, itemTextId)
.SendMailTo(MailReceiver(target,GUID_LOPART(target_guid)),sender);
@ -2080,7 +2080,7 @@ bool ChatHandler::HandleTeleNameCommand(const char * args)
PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), GetMangosString(LANG_OFFLINE), tele->name.c_str());
Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation,
MapManager::Instance().GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid);
sMapMgr.GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid);
}
return true;
@ -2338,7 +2338,7 @@ bool ChatHandler::HandleGoXYCommand(const char* args)
else
_player->SaveRecallPosition();
Map const *map = MapManager::Instance().CreateBaseMap(mapid);
Map const *map = sMapMgr.CreateBaseMap(mapid);
float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
_player->TeleportTo(mapid, x, y, z, _player->GetOrientation());
@ -2431,7 +2431,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
// update to parent zone if exist (client map show only zones without parents)
AreaTableEntry const* zoneEntry = areaEntry->zone ? GetAreaEntryByAreaID(areaEntry->zone) : areaEntry;
Map const *map = MapManager::Instance().CreateBaseMap(zoneEntry->mapid);
Map const *map = sMapMgr.CreateBaseMap(zoneEntry->mapid);
if(map->Instanceable())
{
@ -2506,7 +2506,7 @@ bool ChatHandler::HandleGoGridCommand(const char* args)
else
_player->SaveRecallPosition();
Map const *map = MapManager::Instance().CreateBaseMap(mapid);
Map const *map = sMapMgr.CreateBaseMap(mapid);
float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
_player->TeleportTo(mapid, x, y, z, _player->GetOrientation());

View file

@ -30,7 +30,7 @@
#include "World.h"
#include "GameEventMgr.h"
#include "SpellMgr.h"
#include "PoolHandler.h"
#include "PoolManager.h"
#include "AccountMgr.h"
#include "GMTicketMgr.h"
#include "WaypointManager.h"
@ -64,7 +64,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if(!extractPlayerTarget(nameStr,&target,&target_guid,&target_name))
return false;
uint32 account_id = target ? target->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(target_guid);
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);
// find only player from same account if any
if(!target)
@ -104,7 +104,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
if(!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
return false;
uint32 account_id = target ? target->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(target_guid);
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);
// find only player from same account if any
if(!target)
@ -358,7 +358,7 @@ bool ChatHandler::HandleGoObjectCommand(const char* args)
int mapid;
// by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(guid))
if (GameObjectData const* go_data = sObjectMgr.GetGOData(guid))
{
x = go_data->posX;
y = go_data->posY;
@ -398,7 +398,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
{
Player* pl = m_session->GetPlayer();
QueryResult *result;
GameEventMgr::ActiveEvents const& activeEventsList = gameeventmgr.GetActiveEventList();
GameEventMgr::ActiveEvents const& activeEventsList = sGameEventMgr.GetActiveEventList();
if(*args)
{
// number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
@ -470,8 +470,8 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
z = fields[4].GetFloat();
o = fields[5].GetFloat();
mapid = fields[6].GetUInt16();
pool_id = poolhandler.IsPartOfAPool(lowguid, TYPEID_GAMEOBJECT);
if (!pool_id || (pool_id && poolhandler.IsSpawnedObject(pool_id, lowguid, TYPEID_GAMEOBJECT)))
pool_id = sPoolMgr.IsPartOfAPool(lowguid, TYPEID_GAMEOBJECT);
if (!pool_id || (pool_id && sPoolMgr.IsSpawnedObject(pool_id, lowguid, TYPEID_GAMEOBJECT)))
found = true;
} while( result->NextRow() && (!found) );
@ -483,7 +483,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
return false;
}
GameObjectInfo const* goI = objmgr.GetGameObjectInfo(id);
GameObjectInfo const* goI = ObjectMgr::GetGameObjectInfo(id);
if (!goI)
{
@ -524,7 +524,7 @@ bool ChatHandler::HandleGameObjectDeleteCommand(const char* args)
GameObject* obj = NULL;
// by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(lowguid))
if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid))
obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
if(!obj)
@ -572,7 +572,7 @@ bool ChatHandler::HandleGameObjectTurnCommand(const char* args)
GameObject* obj = NULL;
// by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(lowguid))
if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid))
obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
if(!obj)
@ -626,7 +626,7 @@ bool ChatHandler::HandleGameObjectMoveCommand(const char* args)
GameObject* obj = NULL;
// by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(lowguid))
if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid))
obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
if(!obj)
@ -700,7 +700,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
char* spawntimeSecs = strtok(NULL, " ");
const GameObjectInfo *gInfo = objmgr.GetGameObjectInfo(id);
const GameObjectInfo *gInfo = ObjectMgr::GetGameObjectInfo(id);
if (!gInfo)
{
@ -726,7 +726,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
Map *map = chr->GetMap();
GameObject* pGameObj = new GameObject;
uint32 db_lowGUID = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
uint32 db_lowGUID = sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
if(!pGameObj->Create(db_lowGUID, gInfo->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
{
@ -756,7 +756,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
map->Add(pGameObj);
// TODO: is it really necessary to add both the real and DB table guid here ?
objmgr.AddGameobjectToGrid(db_lowGUID, objmgr.GetGOData(db_lowGUID));
sObjectMgr.AddGameobjectToGrid(db_lowGUID, sObjectMgr.GetGOData(db_lowGUID));
PSendSysMessage(LANG_GAMEOBJECT_ADD,id,gInfo->name,db_lowGUID,x,y,z);
return true;
@ -777,7 +777,7 @@ bool ChatHandler::HandleGameObjectPhaseCommand(const char* args)
GameObject* obj = NULL;
// by DB guid
if (GameObjectData const* go_data = objmgr.GetGOData(lowguid))
if (GameObjectData const* go_data = sObjectMgr.GetGOData(lowguid))
obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
if(!obj)
@ -825,7 +825,7 @@ bool ChatHandler::HandleGameObjectNearCommand(const char* args)
float z = fields[4].GetFloat();
int mapid = fields[5].GetUInt16();
GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(entry);
GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(entry);
if(!gInfo)
continue;
@ -1074,7 +1074,7 @@ bool ChatHandler::HandleNpcAddCommand(const char* args)
Map *map = chr->GetMap();
Creature* pCreature = new Creature;
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, (uint32)teamval))
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, (uint32)teamval))
{
delete pCreature;
return false;
@ -1097,7 +1097,7 @@ bool ChatHandler::HandleNpcAddCommand(const char* args)
pCreature->LoadFromDB(db_guid, map);
map->Add(pCreature);
objmgr.AddCreatureToGrid(db_guid, objmgr.GetCreatureData(db_guid));
sObjectMgr.AddCreatureToGrid(db_guid, sObjectMgr.GetCreatureData(db_guid));
return true;
}
@ -1134,15 +1134,15 @@ bool ChatHandler::HandleNpcAddVendorItemCommand(const char* args)
uint32 vendor_entry = vendor ? vendor->GetEntry() : 0;
if(!objmgr.IsVendorItemValid(vendor_entry,itemId,maxcount,incrtime,extendedcost,m_session->GetPlayer()))
if(!sObjectMgr.IsVendorItemValid(vendor_entry,itemId,maxcount,incrtime,extendedcost,m_session->GetPlayer()))
{
SetSentErrorMessage(true);
return false;
}
objmgr.AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost);
sObjectMgr.AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost);
ItemPrototype const* pProto = objmgr.GetItemPrototype(itemId);
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemId);
PSendSysMessage(LANG_ITEM_ADDED_TO_LIST,itemId,pProto->Name1,maxcount,incrtime,extendedcost);
return true;
@ -1171,14 +1171,14 @@ bool ChatHandler::HandleNpcDelVendorItemCommand(const char* args)
}
uint32 itemId = atol(pitem);
if(!objmgr.RemoveVendorItem(vendor->GetEntry(),itemId))
if(!sObjectMgr.RemoveVendorItem(vendor->GetEntry(),itemId))
{
PSendSysMessage(LANG_ITEM_NOT_IN_LIST,itemId);
SetSentErrorMessage(true);
return false;
}
ItemPrototype const* pProto = objmgr.GetItemPrototype(itemId);
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemId);
PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST,itemId,pProto->Name1);
return true;
@ -1205,7 +1205,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args)
// attempt check creature existence by DB data
if(!pCreature)
{
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
@ -1226,7 +1226,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args)
Player* player = m_session->GetPlayer();
WaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), wait, 0);
sWaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), wait, 0);
// update movement type
WorldDatabase.PExecuteLog("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid);
@ -1273,7 +1273,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(const char* args)
{
if(((Pet*)pCreature)->getPetType()==HUNTER_PET)
{
pCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(lvl)/4);
pCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(lvl)/4);
pCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
}
((Pet*)pCreature)->GivePetLevel(lvl);
@ -1330,7 +1330,7 @@ bool ChatHandler::HandleNpcDeleteCommand(const char* args)
if(!lowguid)
return false;
if (CreatureData const* cr_data = objmgr.GetCreatureData(lowguid))
if (CreatureData const* cr_data = sObjectMgr.GetCreatureData(lowguid))
unit = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT));
}
else
@ -1377,7 +1377,7 @@ bool ChatHandler::HandleNpcMoveCommand(const char* args)
// Attempting creature load from DB data
if(!pCreature)
{
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
@ -1411,7 +1411,7 @@ bool ChatHandler::HandleNpcMoveCommand(const char* args)
if (pCreature)
{
if(CreatureData const* data = objmgr.GetCreatureData(pCreature->GetDBTableGUIDLow()))
if(CreatureData const* data = sObjectMgr.GetCreatureData(pCreature->GetDBTableGUIDLow()))
{
const_cast<CreatureData*>(data)->posX = x;
const_cast<CreatureData*>(data)->posY = y;
@ -1517,7 +1517,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args)
// attempt check creature existence by DB data
if(!pCreature)
{
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
@ -1549,7 +1549,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args)
// update movement type
if(doNotDelete == false)
WaypointMgr.DeletePath(lowguid);
sWaypointMgr.DeletePath(lowguid);
if(pCreature)
{
@ -1933,7 +1933,7 @@ bool ChatHandler::HandleNpcNameCommand(const char* /*args*/)
}
pCreature->SetName(args);
uint32 idname = objmgr.AddCreatureTemplate(pCreature->GetName());
uint32 idname = sObjectMgr.AddCreatureTemplate(pCreature->GetName());
pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
pCreature->SaveToDB();
@ -1980,7 +1980,7 @@ bool ChatHandler::HandleNpcSubNameCommand(const char* /*args*/)
return true;
}
uint32 idname = objmgr.AddCreatureSubName(pCreature->GetName(),args,pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID));
uint32 idname = sObjectMgr.AddCreatureSubName(pCreature->GetName(),args,pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID));
pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
pCreature->SaveToDB();
@ -2197,7 +2197,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
void ChatHandler::ShowTicket(uint64 guid, char const* text, char const* time)
{
std::string name;
if(!objmgr.GetPlayerNameByGUID(guid,name))
if(!sObjectMgr.GetPlayerNameByGUID(guid,name))
name = GetMangosString(LANG_UNKNOWN);
std::string nameLink = playerLink(name);
@ -2220,7 +2220,7 @@ bool ChatHandler::HandleTicketCommand(const char* args)
return false;
}
size_t count = ticketmgr.GetTicketCount();
size_t count = sTicketMgr.GetTicketCount();
bool accept = m_session->GetPlayer()->isAcceptTickets();
@ -2287,7 +2287,7 @@ bool ChatHandler::HandleTicketCommand(const char* args)
return false;
// ticket $char_name
GMTicket* ticket = ticketmgr.GetGMTicket(GUID_LOPART(target_guid));
GMTicket* ticket = sTicketMgr.GetGMTicket(GUID_LOPART(target_guid));
if(!ticket)
return false;
@ -2308,7 +2308,7 @@ bool ChatHandler::HandleDelTicketCommand(const char *args)
// delticket all
if(strncmp(px,"all",4) == 0)
{
ticketmgr.DeleteAll();
sTicketMgr.DeleteAll();
SendSysMessage(LANG_COMMAND_ALLTICKETDELETED);
return true;
}
@ -2329,10 +2329,10 @@ bool ChatHandler::HandleDelTicketCommand(const char *args)
uint32 guid = fields[0].GetUInt32();
delete result;
ticketmgr.Delete(guid);
sTicketMgr.Delete(guid);
//notify player
if(Player* pl = objmgr.GetPlayer(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)))
if(Player* pl = sObjectMgr.GetPlayer(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)))
{
pl->GetSession()->SendGMTicketGetTicket(0x0A, 0);
PSendSysMessage(LANG_COMMAND_TICKETPLAYERDEL, GetNameLink(pl).c_str());
@ -2350,7 +2350,7 @@ bool ChatHandler::HandleDelTicketCommand(const char *args)
return false;
// delticket $char_name
ticketmgr.Delete(GUID_LOPART(target_guid));
sTicketMgr.Delete(GUID_LOPART(target_guid));
// notify players about ticket deleting
if(target)
@ -2447,7 +2447,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
}while( result->NextRow() );
delete result;
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2481,7 +2481,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
}
lowguid = atoi((char*)guid_str);
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2504,7 +2504,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0");
Player* player = m_session->GetPlayer();
WaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0);
sWaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0);
// update movement type
if(target)
@ -2627,7 +2627,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
}
lowguid = atoi((char*)guid_str);
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2696,7 +2696,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
PSendSysMessage("DEBUG: wp modify add, GUID: %u", lowguid);
// Get the creature for which we read the waypoint
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2737,7 +2737,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
// create the waypoint creature
wpGuid = 0;
Creature* wpCreature = new Creature;
if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT,0))
if (!wpCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT,0))
{
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature;
@ -2761,7 +2761,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
}
}
WaypointMgr.AddAfterNode(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), 0, 0, wpGuid);
sWaypointMgr.AddAfterNode(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), 0, 0, wpGuid);
if(!wpGuid)
return false;
@ -2775,7 +2775,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
PSendSysMessage("DEBUG: wp modify del, GUID: %u", lowguid);
// Get the creature for which we read the waypoint
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2799,7 +2799,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
// Adjust the waypoints
// Respawn the owner of the waypoints
WaypointMgr.DeleteNode(lowguid, point);
sWaypointMgr.DeleteNode(lowguid, point);
if(npcCreature)
{
@ -2835,7 +2835,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
Map *map = chr->GetMap();
{
// Get the creature for which we read the waypoint
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2857,7 +2857,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
wpCreature->AddObjectToRemoveList();
// re-create
Creature* wpCreature2 = new Creature;
if (!wpCreature2->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0))
if (!wpCreature2->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0))
{
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2;
@ -2880,7 +2880,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
//npcCreature->GetMap()->Add(wpCreature2);
}
WaypointMgr.SetNodePosition(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ());
sWaypointMgr.SetNodePosition(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ());
if(npcCreature)
{
@ -2897,7 +2897,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
} // move
// Create creature - npc that has the waypoint
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -2912,7 +2912,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
return false;
}
WaypointMgr.SetNodeText(lowguid, point, show_str, arg_str);
sWaypointMgr.SetNodeText(lowguid, point, show_str, arg_str);
Creature* npcCreature = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT));
if(npcCreature)
@ -3006,7 +3006,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
uint32 lowguid = atoi((char*)guid_str);
CreatureData const* data = objmgr.GetCreatureData(lowguid);
CreatureData const* data = sObjectMgr.GetCreatureData(lowguid);
if(!data)
{
PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid);
@ -3161,7 +3161,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
float o = chr->GetOrientation();
Creature* wpCreature = new Creature;
if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0))
if (!wpCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0))
{
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete wpCreature;
@ -3219,7 +3219,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
Map *map = chr->GetMap();
Creature* pCreature = new Creature;
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0))
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0))
{
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete pCreature;
@ -3279,7 +3279,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
Map *map = chr->GetMap();
Creature* pCreature = new Creature;
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0))
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0))
{
PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
delete pCreature;
@ -3687,8 +3687,8 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
uint32 counter = 0;
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
for(uint32 id = 0; id < events.size(); ++id )
{
@ -3725,8 +3725,8 @@ bool ChatHandler::HandleEventListCommand(const char* args)
if (arg == "all")
all = true;
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
char const* active = GetMangosString(LANG_ACTIVE);
char const* inactive = GetMangosString(LANG_FACTION_INACTIVE);
@ -3771,7 +3771,7 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
uint32 event_id = atoi(cId);
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
if(event_id >=events.size())
{
@ -3788,14 +3788,14 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
return false;
}
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
bool active = activeEvents.find(event_id) != activeEvents.end();
char const* activeStr = active ? GetMangosString(LANG_ACTIVE) : "";
std::string startTimeStr = TimeToTimestampStr(eventData.start);
std::string endTimeStr = TimeToTimestampStr(eventData.end);
uint32 delay = gameeventmgr.NextCheck(event_id);
uint32 delay = sGameEventMgr.NextCheck(event_id);
time_t nextTime = time(NULL)+delay;
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(NULL)+delay) : "-";
@ -3820,7 +3820,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
int32 event_id = atoi(cId);
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
if(event_id < 1 || event_id >=events.size())
{
@ -3837,7 +3837,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
return false;
}
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
if(activeEvents.find(event_id) != activeEvents.end())
{
PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE,event_id);
@ -3846,7 +3846,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
}
PSendSysMessage(LANG_EVENT_STARTED, event_id, eventData.description.c_str());
gameeventmgr.StartEvent(event_id,true);
sGameEventMgr.StartEvent(event_id,true);
return true;
}
@ -3862,7 +3862,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
int32 event_id = atoi(cId);
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
if(event_id < 1 || event_id >=events.size())
{
@ -3879,7 +3879,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
return false;
}
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
if(activeEvents.find(event_id) == activeEvents.end())
{
@ -3889,7 +3889,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
}
PSendSysMessage(LANG_EVENT_STOPPED, event_id, eventData.description.c_str());
gameeventmgr.StopEvent(event_id,true);
sGameEventMgr.StopEvent(event_id,true);
return true;
}

View file

@ -116,7 +116,7 @@ bool ChatHandler::HandleReloadAllQuestCommand(const char* /*args*/)
HandleReloadQuestTemplateCommand("a");
sLog.outString( "Re-Loading Quests Relations..." );
objmgr.LoadQuestRelations();
sObjectMgr.LoadQuestRelations();
SendGlobalSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded.");
return true;
}
@ -192,7 +192,7 @@ bool ChatHandler::HandleReloadConfigCommand(const char* /*args*/)
{
sLog.outString( "Re-Loading config settings..." );
sWorld.LoadConfigSettings(true);
MapManager::Instance().InitializeVisibilityDistanceInfo();
sMapMgr.InitializeVisibilityDistanceInfo();
SendGlobalSysMessage("World config settings reloaded.");
return true;
}
@ -200,7 +200,7 @@ bool ChatHandler::HandleReloadConfigCommand(const char* /*args*/)
bool ChatHandler::HandleReloadAchievementCriteriaRequirementCommand(const char*)
{
sLog.outString( "Re-Loading Additional Achievement Criteria Requirements Data..." );
achievementmgr.LoadAchievementCriteriaRequirements();
sAchievementMgr.LoadAchievementCriteriaRequirements();
SendGlobalSysMessage("DB table `achievement_criteria_requirement` reloaded.");
return true;
}
@ -208,7 +208,7 @@ bool ChatHandler::HandleReloadAchievementCriteriaRequirementCommand(const char*)
bool ChatHandler::HandleReloadAchievementRewardCommand(const char*)
{
sLog.outString( "Re-Loading Achievement Reward Data..." );
achievementmgr.LoadRewards();
sAchievementMgr.LoadRewards();
SendGlobalSysMessage("DB table `achievement_reward` reloaded.");
return true;
}
@ -216,7 +216,7 @@ bool ChatHandler::HandleReloadAchievementRewardCommand(const char*)
bool ChatHandler::HandleReloadAreaTriggerTavernCommand(const char*)
{
sLog.outString( "Re-Loading Tavern Area Triggers..." );
objmgr.LoadTavernAreaTriggers();
sObjectMgr.LoadTavernAreaTriggers();
SendGlobalSysMessage("DB table `areatrigger_tavern` reloaded.");
return true;
}
@ -224,7 +224,7 @@ bool ChatHandler::HandleReloadAreaTriggerTavernCommand(const char*)
bool ChatHandler::HandleReloadAreaTriggerTeleportCommand(const char*)
{
sLog.outString( "Re-Loading AreaTrigger teleport definitions..." );
objmgr.LoadAreaTriggerTeleports();
sObjectMgr.LoadAreaTriggerTeleports();
SendGlobalSysMessage("DB table `areatrigger_teleport` reloaded.");
return true;
}
@ -239,7 +239,7 @@ bool ChatHandler::HandleReloadCommandCommand(const char*)
bool ChatHandler::HandleReloadCreatureQuestRelationsCommand(const char*)
{
sLog.outString( "Loading Quests Relations... (`creature_questrelation`)" );
objmgr.LoadCreatureQuestRelations();
sObjectMgr.LoadCreatureQuestRelations();
SendGlobalSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded.");
return true;
}
@ -247,7 +247,7 @@ bool ChatHandler::HandleReloadCreatureQuestRelationsCommand(const char*)
bool ChatHandler::HandleReloadCreatureQuestInvRelationsCommand(const char*)
{
sLog.outString( "Loading Quests Relations... (`creature_involvedrelation`)" );
objmgr.LoadCreatureInvolvedRelations();
sObjectMgr.LoadCreatureInvolvedRelations();
SendGlobalSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded.");
return true;
}
@ -255,7 +255,7 @@ bool ChatHandler::HandleReloadCreatureQuestInvRelationsCommand(const char*)
bool ChatHandler::HandleReloadGOQuestRelationsCommand(const char*)
{
sLog.outString( "Loading Quests Relations... (`gameobject_questrelation`)" );
objmgr.LoadGameobjectQuestRelations();
sObjectMgr.LoadGameobjectQuestRelations();
SendGlobalSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded.");
return true;
}
@ -263,7 +263,7 @@ bool ChatHandler::HandleReloadGOQuestRelationsCommand(const char*)
bool ChatHandler::HandleReloadGOQuestInvRelationsCommand(const char*)
{
sLog.outString( "Loading Quests Relations... (`gameobject_involvedrelation`)" );
objmgr.LoadGameobjectInvolvedRelations();
sObjectMgr.LoadGameobjectInvolvedRelations();
SendGlobalSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded.");
return true;
}
@ -271,7 +271,7 @@ bool ChatHandler::HandleReloadGOQuestInvRelationsCommand(const char*)
bool ChatHandler::HandleReloadQuestAreaTriggersCommand(const char*)
{
sLog.outString( "Re-Loading Quest Area Triggers..." );
objmgr.LoadQuestAreaTriggers();
sObjectMgr.LoadQuestAreaTriggers();
SendGlobalSysMessage("DB table `areatrigger_involvedrelation` (quest area triggers) reloaded.");
return true;
}
@ -279,12 +279,12 @@ bool ChatHandler::HandleReloadQuestAreaTriggersCommand(const char*)
bool ChatHandler::HandleReloadQuestTemplateCommand(const char*)
{
sLog.outString( "Re-Loading Quest Templates..." );
objmgr.LoadQuests();
sObjectMgr.LoadQuests();
SendGlobalSysMessage("DB table `quest_template` (quest definitions) reloaded.");
/// dependent also from `gameobject` but this table not reloaded anyway
sLog.outString( "Re-Loading GameObjects for quests..." );
objmgr.LoadGameObjectForQuests();
sObjectMgr.LoadGameObjectForQuests();
SendGlobalSysMessage("Data GameObjects for quests reloaded.");
return true;
}
@ -399,7 +399,7 @@ bool ChatHandler::HandleReloadLootTemplatesSpellCommand(const char*)
bool ChatHandler::HandleReloadMangosStringCommand(const char*)
{
sLog.outString( "Re-Loading mangos_string Table!" );
objmgr.LoadMangosStrings();
sObjectMgr.LoadMangosStrings();
SendGlobalSysMessage("DB table `mangos_string` reloaded.");
return true;
}
@ -407,7 +407,7 @@ bool ChatHandler::HandleReloadMangosStringCommand(const char*)
bool ChatHandler::HandleReloadNpcOptionCommand(const char*)
{
sLog.outString( "Re-Loading `npc_option` Table!" );
objmgr.LoadNpcOptions();
sObjectMgr.LoadNpcOptions();
SendGlobalSysMessage("DB table `npc_option` reloaded.");
return true;
}
@ -415,7 +415,7 @@ bool ChatHandler::HandleReloadNpcOptionCommand(const char*)
bool ChatHandler::HandleReloadNpcGossipCommand(const char*)
{
sLog.outString( "Re-Loading `npc_gossip` Table!" );
objmgr.LoadNpcTextId();
sObjectMgr.LoadNpcTextId();
SendGlobalSysMessage("DB table `npc_gossip` reloaded.");
return true;
}
@ -423,7 +423,7 @@ bool ChatHandler::HandleReloadNpcGossipCommand(const char*)
bool ChatHandler::HandleReloadNpcTrainerCommand(const char*)
{
sLog.outString( "Re-Loading `npc_trainer` Table!" );
objmgr.LoadTrainerSpell();
sObjectMgr.LoadTrainerSpell();
SendGlobalSysMessage("DB table `npc_trainer` reloaded.");
return true;
}
@ -431,7 +431,7 @@ bool ChatHandler::HandleReloadNpcTrainerCommand(const char*)
bool ChatHandler::HandleReloadNpcVendorCommand(const char*)
{
sLog.outString( "Re-Loading `npc_vendor` Table!" );
objmgr.LoadVendors();
sObjectMgr.LoadVendors();
SendGlobalSysMessage("DB table `npc_vendor` reloaded.");
return true;
}
@ -439,7 +439,7 @@ bool ChatHandler::HandleReloadNpcVendorCommand(const char*)
bool ChatHandler::HandleReloadPointsOfInterestCommand(const char*)
{
sLog.outString( "Re-Loading `points_of_interest` Table!" );
objmgr.LoadPointsOfInterest();
sObjectMgr.LoadPointsOfInterest();
SendGlobalSysMessage("DB table `points_of_interest` reloaded.");
return true;
}
@ -447,7 +447,7 @@ bool ChatHandler::HandleReloadPointsOfInterestCommand(const char*)
bool ChatHandler::HandleReloadSpellClickSpellsCommand(const char*)
{
sLog.outString( "Re-Loading `npc_spellclick_spells` Table!" );
objmgr.LoadNPCSpellClickSpells();
sObjectMgr.LoadNPCSpellClickSpells();
SendGlobalSysMessage("DB table `npc_spellclick_spells` reloaded.");
return true;
}
@ -455,7 +455,7 @@ bool ChatHandler::HandleReloadSpellClickSpellsCommand(const char*)
bool ChatHandler::HandleReloadReservedNameCommand(const char*)
{
sLog.outString( "Loading ReservedNames... (`reserved_name`)" );
objmgr.LoadReservedPlayersNames();
sObjectMgr.LoadReservedPlayersNames();
SendGlobalSysMessage("DB table `reserved_name` (player reserved names) reloaded.");
return true;
}
@ -479,7 +479,7 @@ bool ChatHandler::HandleReloadSkillExtraItemTemplateCommand(const char* /*args*/
bool ChatHandler::HandleReloadSkillFishingBaseLevelCommand(const char* /*args*/)
{
sLog.outString( "Re-Loading Skill Fishing base level requirements..." );
objmgr.LoadFishingBaseSkillLevel();
sObjectMgr.LoadFishingBaseSkillLevel();
SendGlobalSysMessage("DB table `skill_fishing_base_level` (fishing base level for zone/subzone) reloaded.");
return true;
}
@ -487,7 +487,7 @@ bool ChatHandler::HandleReloadSkillFishingBaseLevelCommand(const char* /*args*/)
bool ChatHandler::HandleReloadSpellAreaCommand(const char*)
{
sLog.outString( "Re-Loading SpellArea Data..." );
spellmgr.LoadSpellAreas();
sSpellMgr.LoadSpellAreas();
SendGlobalSysMessage("DB table `spell_area` (spell dependences from area/quest/auras state) reloaded.");
return true;
}
@ -495,7 +495,7 @@ bool ChatHandler::HandleReloadSpellAreaCommand(const char*)
bool ChatHandler::HandleReloadSpellChainCommand(const char*)
{
sLog.outString( "Re-Loading Spell Chain Data... " );
spellmgr.LoadSpellChains();
sSpellMgr.LoadSpellChains();
SendGlobalSysMessage("DB table `spell_chain` (spell ranks) reloaded.");
return true;
}
@ -503,7 +503,7 @@ bool ChatHandler::HandleReloadSpellChainCommand(const char*)
bool ChatHandler::HandleReloadSpellElixirCommand(const char*)
{
sLog.outString( "Re-Loading Spell Elixir types..." );
spellmgr.LoadSpellElixirs();
sSpellMgr.LoadSpellElixirs();
SendGlobalSysMessage("DB table `spell_elixir` (spell elixir types) reloaded.");
return true;
}
@ -511,7 +511,7 @@ bool ChatHandler::HandleReloadSpellElixirCommand(const char*)
bool ChatHandler::HandleReloadSpellLearnSpellCommand(const char*)
{
sLog.outString( "Re-Loading Spell Learn Spells..." );
spellmgr.LoadSpellLearnSpells();
sSpellMgr.LoadSpellLearnSpells();
SendGlobalSysMessage("DB table `spell_learn_spell` reloaded.");
return true;
}
@ -519,7 +519,7 @@ bool ChatHandler::HandleReloadSpellLearnSpellCommand(const char*)
bool ChatHandler::HandleReloadSpellProcEventCommand(const char*)
{
sLog.outString( "Re-Loading Spell Proc Event conditions..." );
spellmgr.LoadSpellProcEvents();
sSpellMgr.LoadSpellProcEvents();
SendGlobalSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded.");
return true;
}
@ -527,7 +527,7 @@ bool ChatHandler::HandleReloadSpellProcEventCommand(const char*)
bool ChatHandler::HandleReloadSpellBonusesCommand(const char*)
{
sLog.outString( "Re-Loading Spell Bonus Data..." );
spellmgr.LoadSpellBonusess();
sSpellMgr.LoadSpellBonusess();
SendGlobalSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded.");
return true;
}
@ -535,7 +535,7 @@ bool ChatHandler::HandleReloadSpellBonusesCommand(const char*)
bool ChatHandler::HandleReloadSpellProcItemEnchantCommand(const char*)
{
sLog.outString( "Re-Loading Spell Proc Item Enchant..." );
spellmgr.LoadSpellProcItemEnchant();
sSpellMgr.LoadSpellProcItemEnchant();
SendGlobalSysMessage("DB table `spell_proc_item_enchant` (item enchantment ppm) reloaded.");
return true;
}
@ -543,7 +543,7 @@ bool ChatHandler::HandleReloadSpellProcItemEnchantCommand(const char*)
bool ChatHandler::HandleReloadSpellScriptTargetCommand(const char*)
{
sLog.outString( "Re-Loading SpellsScriptTarget..." );
spellmgr.LoadSpellScriptTarget();
sSpellMgr.LoadSpellScriptTarget();
SendGlobalSysMessage("DB table `spell_script_target` (spell targets selection in case specific creature/GO requirements) reloaded.");
return true;
}
@ -551,7 +551,7 @@ bool ChatHandler::HandleReloadSpellScriptTargetCommand(const char*)
bool ChatHandler::HandleReloadSpellTargetPositionCommand(const char*)
{
sLog.outString( "Re-Loading Spell target coordinates..." );
spellmgr.LoadSpellTargetPositions();
sSpellMgr.LoadSpellTargetPositions();
SendGlobalSysMessage("DB table `spell_target_position` (destination coordinates for spell targets) reloaded.");
return true;
}
@ -559,7 +559,7 @@ bool ChatHandler::HandleReloadSpellTargetPositionCommand(const char*)
bool ChatHandler::HandleReloadSpellThreatsCommand(const char*)
{
sLog.outString( "Re-Loading Aggro Spells Definitions...");
spellmgr.LoadSpellThreats();
sSpellMgr.LoadSpellThreats();
SendGlobalSysMessage("DB table `spell_threat` (spell aggro definitions) reloaded.");
return true;
}
@ -567,7 +567,7 @@ bool ChatHandler::HandleReloadSpellThreatsCommand(const char*)
bool ChatHandler::HandleReloadSpellPetAurasCommand(const char*)
{
sLog.outString( "Re-Loading Spell pet auras...");
spellmgr.LoadSpellPetAuras();
sSpellMgr.LoadSpellPetAuras();
SendGlobalSysMessage("DB table `spell_pet_auras` reloaded.");
return true;
}
@ -575,7 +575,7 @@ bool ChatHandler::HandleReloadSpellPetAurasCommand(const char*)
bool ChatHandler::HandleReloadPageTextsCommand(const char*)
{
sLog.outString( "Re-Loading Page Texts..." );
objmgr.LoadPageTexts();
sObjectMgr.LoadPageTexts();
SendGlobalSysMessage("DB table `page_texts` reloaded.");
return true;
}
@ -591,7 +591,7 @@ bool ChatHandler::HandleReloadItemEnchantementsCommand(const char*)
bool ChatHandler::HandleReloadItemRequiredTragetCommand(const char*)
{
sLog.outString( "Re-Loading Item Required Targets Table..." );
objmgr.LoadItemRequiredTarget();
sObjectMgr.LoadItemRequiredTarget();
SendGlobalSysMessage("DB table `item_required_target` reloaded.");
return true;
}
@ -616,7 +616,7 @@ bool ChatHandler::HandleReloadGameObjectScriptsCommand(const char* arg)
if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `gameobject_scripts`...");
objmgr.LoadGameObjectScripts();
sObjectMgr.LoadGameObjectScripts();
if(*arg!='a')
SendGlobalSysMessage("DB table `gameobject_scripts` reloaded.");
@ -636,7 +636,7 @@ bool ChatHandler::HandleReloadEventScriptsCommand(const char* arg)
if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `event_scripts`...");
objmgr.LoadEventScripts();
sObjectMgr.LoadEventScripts();
if(*arg!='a')
SendGlobalSysMessage("DB table `event_scripts` reloaded.");
@ -648,7 +648,7 @@ bool ChatHandler::HandleReloadEventAITextsCommand(const char* arg)
{
sLog.outString( "Re-Loading Texts from `creature_ai_texts`...");
CreatureEAI_Mgr.LoadCreatureEventAI_Texts(true);
sEventAIMgr.LoadCreatureEventAI_Texts(true);
SendGlobalSysMessage("DB table `creature_ai_texts` reloaded.");
return true;
}
@ -656,7 +656,7 @@ bool ChatHandler::HandleReloadEventAITextsCommand(const char* arg)
bool ChatHandler::HandleReloadEventAISummonsCommand(const char* arg)
{
sLog.outString( "Re-Loading Summons from `creature_ai_summons`...");
CreatureEAI_Mgr.LoadCreatureEventAI_Summons(true);
sEventAIMgr.LoadCreatureEventAI_Summons(true);
SendGlobalSysMessage("DB table `creature_ai_summons` reloaded.");
return true;
}
@ -664,7 +664,7 @@ bool ChatHandler::HandleReloadEventAISummonsCommand(const char* arg)
bool ChatHandler::HandleReloadEventAIScriptsCommand(const char* arg)
{
sLog.outString( "Re-Loading Scripts from `creature_ai_scripts`...");
CreatureEAI_Mgr.LoadCreatureEventAI_Scripts();
sEventAIMgr.LoadCreatureEventAI_Scripts();
SendGlobalSysMessage("DB table `creature_ai_scripts` reloaded.");
return true;
}
@ -681,7 +681,7 @@ bool ChatHandler::HandleReloadQuestEndScriptsCommand(const char* arg)
if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `quest_end_scripts`...");
objmgr.LoadQuestEndScripts();
sObjectMgr.LoadQuestEndScripts();
if(*arg!='a')
SendGlobalSysMessage("DB table `quest_end_scripts` reloaded.");
@ -701,7 +701,7 @@ bool ChatHandler::HandleReloadQuestStartScriptsCommand(const char* arg)
if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `quest_start_scripts`...");
objmgr.LoadQuestStartScripts();
sObjectMgr.LoadQuestStartScripts();
if(*arg!='a')
SendGlobalSysMessage("DB table `quest_start_scripts` reloaded.");
@ -721,7 +721,7 @@ bool ChatHandler::HandleReloadSpellScriptsCommand(const char* arg)
if(*arg!='a')
sLog.outString( "Re-Loading Scripts from `spell_scripts`...");
objmgr.LoadSpellScripts();
sObjectMgr.LoadSpellScripts();
if(*arg!='a')
SendGlobalSysMessage("DB table `spell_scripts` reloaded.");
@ -732,7 +732,7 @@ bool ChatHandler::HandleReloadSpellScriptsCommand(const char* arg)
bool ChatHandler::HandleReloadDbScriptStringCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Script strings from `db_script_string`...");
objmgr.LoadDbScriptStrings();
sObjectMgr.LoadDbScriptStrings();
SendGlobalSysMessage("DB table `db_script_string` reloaded.");
return true;
}
@ -741,7 +741,7 @@ bool ChatHandler::HandleReloadGameGraveyardZoneCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Graveyard-zone links...");
objmgr.LoadGraveyardZones();
sObjectMgr.LoadGraveyardZones();
SendGlobalSysMessage("DB table `game_graveyard_zone` reloaded.");
@ -752,7 +752,7 @@ bool ChatHandler::HandleReloadGameTeleCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Game Tele coordinates...");
objmgr.LoadGameTele();
sObjectMgr.LoadGameTele();
SendGlobalSysMessage("DB table `game_tele` reloaded.");
@ -762,7 +762,7 @@ bool ChatHandler::HandleReloadGameTeleCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesAchievementRewardCommand(const char*)
{
sLog.outString( "Re-Loading Locales Achievement Reward Data..." );
achievementmgr.LoadRewardLocales();
sAchievementMgr.LoadRewardLocales();
SendGlobalSysMessage("DB table `locales_achievement_reward` reloaded.");
return true;
}
@ -770,7 +770,7 @@ bool ChatHandler::HandleReloadLocalesAchievementRewardCommand(const char*)
bool ChatHandler::HandleReloadLocalesCreatureCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Locales Creature ...");
objmgr.LoadCreatureLocales();
sObjectMgr.LoadCreatureLocales();
SendGlobalSysMessage("DB table `locales_creature` reloaded.");
return true;
}
@ -778,7 +778,7 @@ bool ChatHandler::HandleReloadLocalesCreatureCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesGameobjectCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Locales Gameobject ... ");
objmgr.LoadGameObjectLocales();
sObjectMgr.LoadGameObjectLocales();
SendGlobalSysMessage("DB table `locales_gameobject` reloaded.");
return true;
}
@ -786,7 +786,7 @@ bool ChatHandler::HandleReloadLocalesGameobjectCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesItemCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Locales Item ... ");
objmgr.LoadItemLocales();
sObjectMgr.LoadItemLocales();
SendGlobalSysMessage("DB table `locales_item` reloaded.");
return true;
}
@ -794,7 +794,7 @@ bool ChatHandler::HandleReloadLocalesItemCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesNpcTextCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Locales NPC Text ... ");
objmgr.LoadNpcTextLocales();
sObjectMgr.LoadNpcTextLocales();
SendGlobalSysMessage("DB table `locales_npc_text` reloaded.");
return true;
}
@ -802,7 +802,7 @@ bool ChatHandler::HandleReloadLocalesNpcTextCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesPageTextCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Locales Page Text ... ");
objmgr.LoadPageTextLocales();
sObjectMgr.LoadPageTextLocales();
SendGlobalSysMessage("DB table `locales_page_text` reloaded.");
return true;
}
@ -810,7 +810,7 @@ bool ChatHandler::HandleReloadLocalesPageTextCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadLocalesPointsOfInterestCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Locales Points Of Interest ... ");
objmgr.LoadPointOfInterestLocales();
sObjectMgr.LoadPointOfInterestLocales();
SendGlobalSysMessage("DB table `locales_points_of_interest` reloaded.");
return true;
}
@ -818,7 +818,7 @@ bool ChatHandler::HandleReloadLocalesPointsOfInterestCommand(const char* /*arg*/
bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Locales Quest ... ");
objmgr.LoadQuestLocales();
sObjectMgr.LoadQuestLocales();
SendGlobalSysMessage("DB table `locales_quest` reloaded.");
return true;
}
@ -826,7 +826,7 @@ bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
bool ChatHandler::HandleReloadMailLevelRewardCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Player level dependent mail rewards..." );
objmgr.LoadMailLevelRewards();
sObjectMgr.LoadMailLevelRewards();
SendGlobalSysMessage("DB table `mail_level_reward` reloaded.");
return true;
}
@ -1086,7 +1086,7 @@ bool ChatHandler::HandleUnLearnCommand(const char* args)
}
if(allRanks)
spell_id = spellmgr.GetFirstSpellInChain (spell_id);
spell_id = sSpellMgr.GetFirstSpellInChain (spell_id);
if (target->HasSpell(spell_id))
target->removeSpell(spell_id,false,!allRanks);
@ -1837,7 +1837,7 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
continue;
// skip spells with first rank learned as talent (and all talents then also)
uint32 first_rank = spellmgr.GetFirstSpellInChain(spellInfo->Id);
uint32 first_rank = sSpellMgr.GetFirstSpellInChain(spellInfo->Id);
if(GetTalentSpellCost(first_rank) > 0 )
continue;
@ -2038,7 +2038,7 @@ bool ChatHandler::HandleLearnCommand(const char* args)
else
targetPlayer->learnSpell(spell,false);
uint32 first_spell = spellmgr.GetFirstSpellInChain(spell);
uint32 first_spell = sSpellMgr.GetFirstSpellInChain(spell);
if(GetTalentSpellCost(first_spell))
targetPlayer->SendTalentsInfoData(false);
@ -2098,7 +2098,7 @@ bool ChatHandler::HandleAddItemCommand(const char* args)
sLog.outDetail(GetMangosString(LANG_ADDITEM), itemId, count);
ItemPrototype const *pProto = objmgr.GetItemPrototype(itemId);
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemId);
if(!pProto)
{
PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
@ -2237,7 +2237,7 @@ bool ChatHandler::HandleListItemCommand(const char* args)
return false;
}
ItemPrototype const* itemProto = objmgr.GetItemPrototype(item_id);
ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(item_id);
if(!itemProto)
{
PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id);
@ -2462,7 +2462,7 @@ bool ChatHandler::HandleListObjectCommand(const char* args)
return false;
}
GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(go_id);
GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(go_id);
if(!gInfo)
{
PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id);
@ -2538,7 +2538,7 @@ bool ChatHandler::HandleListCreatureCommand(const char* args)
return false;
}
CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(cr_id);
CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(cr_id);
if(!cInfo)
{
PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id);
@ -2622,7 +2622,7 @@ bool ChatHandler::HandleLookupItemCommand(const char* args)
int loc_idx = GetSessionDbLocaleIndex();
if ( loc_idx >= 0 )
{
ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId);
ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
if (il)
{
if (il->Name.size() > loc_idx && !il->Name[loc_idx].empty())
@ -2860,7 +2860,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char* args)
// unit32 used to prevent interpreting uint8 as char at output
// find rank of learned spell for learning spell, or talent rank
uint32 rank = talentCost ? talentCost : spellmgr.GetSpellRank(learn ? spellInfo->EffectTriggerSpell[0] : id);
uint32 rank = talentCost ? talentCost : sSpellMgr.GetSpellRank(learn ? spellInfo->EffectTriggerSpell[0] : id);
// send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
std::ostringstream ss;
@ -2919,7 +2919,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char* args)
uint32 counter = 0 ;
ObjectMgr::QuestMap const& qTemplates = objmgr.GetQuestTemplates();
ObjectMgr::QuestMap const& qTemplates = sObjectMgr.GetQuestTemplates();
for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter)
{
Quest * qinfo = iter->second;
@ -2927,7 +2927,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char* args)
int loc_idx = GetSessionDbLocaleIndex();
if ( loc_idx >= 0 )
{
QuestLocale const *il = objmgr.GetQuestLocale(qinfo->GetQuestId());
QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId());
if (il)
{
if (il->Title.size() > loc_idx && !il->Title[loc_idx].empty())
@ -3027,7 +3027,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char* args)
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
CreatureLocale const *cl = objmgr.GetCreatureLocale (id);
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id);
if (cl)
{
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty ())
@ -3092,7 +3092,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char* args)
int loc_idx = GetSessionDbLocaleIndex();
if ( loc_idx >= 0 )
{
GameObjectLocale const *gl = objmgr.GetGameObjectLocale(id);
GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id);
if (gl)
{
if (gl->Name.size() > loc_idx && !gl->Name[loc_idx].empty())
@ -3237,7 +3237,7 @@ bool ChatHandler::HandleGuildCreateCommand(const char* args)
return false;
}
objmgr.AddGuild (guild);
sObjectMgr.AddGuild (guild);
return true;
}
@ -3260,7 +3260,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args)
return false;
std::string glName = guildStr;
Guild* targetGuild = objmgr.GetGuildByName (glName);
Guild* targetGuild = sObjectMgr.GetGuildByName (glName);
if (!targetGuild)
return false;
@ -3282,7 +3282,7 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args)
if (!glId)
return false;
Guild* targetGuild = objmgr.GetGuildById (glId);
Guild* targetGuild = sObjectMgr.GetGuildById (glId);
if (!targetGuild)
return false;
@ -3308,7 +3308,7 @@ bool ChatHandler::HandleGuildRankCommand(const char *args)
if (!glId)
return false;
Guild* targetGuild = objmgr.GetGuildById (glId);
Guild* targetGuild = sObjectMgr.GetGuildById (glId);
if (!targetGuild)
return false;
@ -3331,7 +3331,7 @@ bool ChatHandler::HandleGuildDeleteCommand(const char* args)
std::string gld = guildStr;
Guild* targetGuild = objmgr.GetGuildByName (gld);
Guild* targetGuild = sObjectMgr.GetGuildByName (gld);
if (!targetGuild)
return false;
@ -3515,7 +3515,7 @@ bool ChatHandler::HandleReviveCommand(const char* args)
}
else
// will resurrected at login without corpse
ObjectAccessor::Instance().ConvertCorpseForPlayer(target_guid);
sObjectAccessor.ConvertCorpseForPlayer(target_guid);
return true;
}
@ -3626,7 +3626,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char* args)
return false;
}
if(objmgr.AddGraveYardLink(g_id,zoneId,g_team))
if(sObjectMgr.AddGraveYardLink(g_id,zoneId,g_team))
PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId);
else
PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id,zoneId);
@ -3652,14 +3652,14 @@ bool ChatHandler::HandleNearGraveCommand(const char* args)
Player* player = m_session->GetPlayer();
uint32 zone_id = player->GetZoneId();
WorldSafeLocsEntry const* graveyard = objmgr.GetClosestGraveYard(
WorldSafeLocsEntry const* graveyard = sObjectMgr.GetClosestGraveYard(
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(),player->GetMapId(),g_team);
if(graveyard)
{
uint32 g_id = graveyard->ID;
GraveYardData const* data = objmgr.FindGraveYardData(g_id,zone_id);
GraveYardData const* data = sObjectMgr.FindGraveYardData(g_id,zone_id);
if (!data)
{
PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR,g_id);
@ -3836,7 +3836,7 @@ bool ChatHandler::HandleNpcAddWeaponCommand(const char* /*args*/)
uint32 ItemID = atoi(pItemID);
uint32 SlotID = atoi(pSlotID);
ItemPrototype* tmpItem = objmgr.GetItemPrototype(ItemID);
ItemPrototype* tmpItem = ObjectMgr::GetItemPrototype(ItemID);
bool added = false;
if(tmpItem)
@ -4164,7 +4164,7 @@ bool ChatHandler::HandleTeleAddCommand(const char * args)
std::string name = args;
if(objmgr.GetGameTele(name))
if(sObjectMgr.GetGameTele(name))
{
SendSysMessage(LANG_COMMAND_TP_ALREADYEXIST);
SetSentErrorMessage(true);
@ -4179,7 +4179,7 @@ bool ChatHandler::HandleTeleAddCommand(const char * args)
tele.mapId = player->GetMapId();
tele.name = name;
if(objmgr.AddGameTele(tele))
if(sObjectMgr.AddGameTele(tele))
{
SendSysMessage(LANG_COMMAND_TP_ADDED);
}
@ -4200,7 +4200,7 @@ bool ChatHandler::HandleTeleDelCommand(const char * args)
std::string name = args;
if(!objmgr.DeleteGameTele(name))
if(!sObjectMgr.DeleteGameTele(name))
{
SendSysMessage(LANG_COMMAND_TELE_NOTFOUND);
SetSentErrorMessage(true);
@ -4517,7 +4517,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
}
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin);
HashMapHolder<Player>::MapType const& plist = ObjectAccessor::Instance().GetPlayers();
HashMapHolder<Player>::MapType const& plist = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
itr->second->SetAtLoginFlag(atLogin);
@ -4688,7 +4688,7 @@ bool ChatHandler::HandleQuestAdd(const char* args)
uint32 entry = atol(cId);
Quest const* pQuest = objmgr.GetQuestTemplate(entry);
Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
if(!pQuest)
{
@ -4742,7 +4742,7 @@ bool ChatHandler::HandleQuestRemove(const char* args)
uint32 entry = atol(cId);
Quest const* pQuest = objmgr.GetQuestTemplate(entry);
Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
if(!pQuest)
{
@ -4792,7 +4792,7 @@ bool ChatHandler::HandleQuestComplete(const char* args)
uint32 entry = atol(cId);
Quest const* pQuest = objmgr.GetQuestTemplate(entry);
Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
// If player doesn't have the quest
if(!pQuest || player->GetQuestStatus(entry) == QUEST_STATUS_NONE)
@ -4834,7 +4834,7 @@ bool ChatHandler::HandleQuestComplete(const char* args)
}
else if(creature > 0)
{
if(CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creature))
if(CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(creature))
for(uint16 z = 0; z < creaturecount; ++z)
player->KilledMonster(cInfo,0);
}
@ -5044,7 +5044,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char* args)
if (!extractPlayerTarget((char*)args,&target,&target_guid))
return false;
uint32 accountid = target ? target->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(target_guid);
uint32 accountid = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);
std::string accountname;
if (!accmgr.GetName(accountid,accountname))
@ -5456,7 +5456,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
return false;
}
if (objmgr.GetPlayerAccountIdByGUID(guid))
if (sObjectMgr.GetPlayerAccountIdByGUID(guid))
{
PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid);
SetSentErrorMessage(true);
@ -5515,10 +5515,10 @@ bool ChatHandler::HandlePDumpWriteCommand(const char *args)
return false;
}
guid = objmgr.GetPlayerGUIDByName(name);
guid = sObjectMgr.GetPlayerGUIDByName(name);
}
if(!objmgr.GetPlayerAccountIdByGUID(guid))
if(!sObjectMgr.GetPlayerAccountIdByGUID(guid))
{
PSendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@ -6014,11 +6014,11 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char* args)
bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/)
{
PSendSysMessage("instances loaded: %d", MapManager::Instance().GetNumInstances());
PSendSysMessage("players in instances: %d", MapManager::Instance().GetNumPlayersInInstances());
PSendSysMessage("instance saves: %d", sInstanceSaveManager.GetNumInstanceSaves());
PSendSysMessage("players bound: %d", sInstanceSaveManager.GetNumBoundPlayersTotal());
PSendSysMessage("groups bound: %d", sInstanceSaveManager.GetNumBoundGroupsTotal());
PSendSysMessage("instances loaded: %d", sMapMgr.GetNumInstances());
PSendSysMessage("players in instances: %d", sMapMgr.GetNumPlayersInInstances());
PSendSysMessage("instance saves: %d", sInstanceSaveMgr.GetNumInstanceSaves());
PSendSysMessage("players bound: %d", sInstanceSaveMgr.GetNumBoundPlayersTotal());
PSendSysMessage("groups bound: %d", sInstanceSaveMgr.GetNumBoundGroupsTotal());
return true;
}
@ -6192,7 +6192,7 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
if(!item_id)
return false;
ItemPrototype const* item_proto = objmgr.GetItemPrototype(item_id);
ItemPrototype const* item_proto = ObjectMgr::GetItemPrototype(item_id);
if(!item_proto)
{
PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id);
@ -6227,7 +6227,7 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
// from console show not existed sender
MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
uint32 itemTextId = !text.empty() ? objmgr.CreateItemText( text ) : 0;
uint32 itemTextId = !text.empty() ? sObjectMgr.CreateItemText( text ) : 0;
// fill mail
MailDraft draft(subject, itemTextId);
@ -6287,7 +6287,7 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args)
// from console show not existed sender
MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
uint32 itemTextId = !text.empty() ? objmgr.CreateItemText( text ) : 0;
uint32 itemTextId = !text.empty() ? sObjectMgr.CreateItemText( text ) : 0;
MailDraft(subject, itemTextId)
.AddMoney(money)
@ -6349,7 +6349,7 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
return false;
}
PlayerInfo const* info = objmgr.GetPlayerInfo(player->getRace(), player->getClass());
PlayerInfo const* info = sObjectMgr.GetPlayerInfo(player->getRace(), player->getClass());
if(!info)
return false;

View file

@ -133,7 +133,7 @@ void LootStore::LoadLootTable()
}
// (condition + cond_value1/2) are converted into single conditionId
uint16 conditionId = objmgr.GetConditionId(condition, cond_value1, cond_value2);
uint16 conditionId = sObjectMgr.GetConditionId(condition, cond_value1, cond_value2);
LootStoreItem storeitem = LootStoreItem(item, chanceOrQuestChance, group, conditionId, mincountOrRef, maxcount);
@ -245,7 +245,7 @@ bool LootStoreItem::Roll(bool rate) const
if(mincountOrRef < 0) // reference case
return roll_chance_f(chance* (rate ? sWorld.getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f));
ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid);
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid);
float qualityModifier = pProto && rate ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f;
@ -269,7 +269,7 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
if( mincountOrRef > 0 ) // item (quest or non-quest) entry, maybe grouped
{
ItemPrototype const *proto = objmgr.GetItemPrototype(itemid);
ItemPrototype const *proto = ObjectMgr::GetItemPrototype(itemid);
if(!proto)
{
sLog.outErrorDb("Table '%s' entry %d item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid);
@ -319,7 +319,7 @@ LootItem::LootItem(LootStoreItem const& li)
itemid = li.itemid;
conditionId = li.conditionId;
ItemPrototype const* proto = objmgr.GetItemPrototype(itemid);
ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemid);
freeforall = proto && (proto->Flags & ITEM_FLAGS_PARTY_LOOT);
needs_quest = li.needs_quest;
@ -337,7 +337,7 @@ LootItem::LootItem(LootStoreItem const& li)
bool LootItem::AllowedForPlayer(Player const * player) const
{
// DB conditions check
if ( !objmgr.IsPlayerMeetToCondition(player,conditionId) )
if ( !sObjectMgr.IsPlayerMeetToCondition(player,conditionId) )
return false;
if ( needs_quest )
@ -349,7 +349,7 @@ bool LootItem::AllowedForPlayer(Player const * player) const
else
{
// Not quest only drop (check quest starting items for already accepted non-repeatable quests)
ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid);
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid);
if (pProto && pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid))
return false;
}
@ -378,7 +378,7 @@ void Loot::AddItem(LootStoreItem const & item)
// non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot()
if( !item.conditionId )
{
ItemPrototype const* proto = objmgr.GetItemPrototype(item.itemid);
ItemPrototype const* proto = ObjectMgr::GetItemPrototype(item.itemid);
if( !proto || (proto->Flags & ITEM_FLAGS_PARTY_LOOT)==0 )
++unlootedCount;
}
@ -676,7 +676,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li)
{
b << uint32(li.itemid);
b << uint32(li.count); // nr of items of this type
b << uint32(objmgr.GetItemPrototype(li.itemid)->DisplayInfoID);
b << uint32(ObjectMgr::GetItemPrototype(li.itemid)->DisplayInfoID);
b << uint32(li.randomSuffix);
b << uint32(li.randomPropertyId);
//b << uint8(0); // slot type - will send after this function call

View file

@ -91,7 +91,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
uint64 rc = 0;
if (normalizePlayerName(receiver))
rc = objmgr.GetPlayerGUIDByName(receiver);
rc = sObjectMgr.GetPlayerGUIDByName(receiver);
if (!rc)
{
@ -119,7 +119,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
return;
}
Player *receive = objmgr.GetPlayer(rc);
Player *receive = sObjectMgr.GetPlayer(rc);
uint32 rc_team = 0;
uint8 mails_count = 0; // do not allow to send to one player more than 100 mails
@ -131,7 +131,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
}
else
{
rc_team = objmgr.GetPlayerTeamByGUID(rc);
rc_team = sObjectMgr.GetPlayerTeamByGUID(rc);
if (QueryResult* result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", GUID_LOPART(rc)))
{
Field *fields = result->Fetch();
@ -156,7 +156,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
uint32 rc_account = receive
? receive->GetSession()->GetAccountId()
: objmgr.GetPlayerAccountIdByGUID(rc);
: sObjectMgr.GetPlayerAccountIdByGUID(rc);
Item* items[MAX_MAIL_ITEMS];
@ -206,7 +206,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
pl->SendMailResult(0, MAIL_SEND, MAIL_OK);
uint32 itemTextId = !body.empty() ? objmgr.CreateItemText( body ) : 0;
uint32 itemTextId = !body.empty() ? sObjectMgr.CreateItemText( body ) : 0;
pl->ModifyMoney( -int32(reqmoney) );
pl->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost);
@ -415,7 +415,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
if (m->COD > 0) // if there is COD, take COD money from player and send them to sender by mail
{
uint64 sender_guid = MAKE_NEW_GUID(m->sender, 0, HIGHGUID_PLAYER);
Player *receive = objmgr.GetPlayer(sender_guid);
Player *receive = sObjectMgr.GetPlayer(sender_guid);
uint32 sender_accId = 0;
@ -430,16 +430,16 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
else
{
// can be calculated early
sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid);
sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid);
if(!objmgr.GetPlayerNameByGUID(sender_guid, sender_name))
sender_name = objmgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
if(!sObjectMgr.GetPlayerNameByGUID(sender_guid, sender_name))
sender_name = sObjectMgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
}
sLog.outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)",
GetPlayerName(), GetAccountId(), it->GetProto()->Name1, it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId);
}
else if(!receive)
sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid);
sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid);
// check player existence
if(receive || sender_accId)
@ -650,7 +650,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket & recv_data )
WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10));// guess size
data << itemTextId;
data << objmgr.GetItemText( itemTextId );
data << sObjectMgr.GetItemText( itemTextId );
SendPacket(&data);
}
@ -688,11 +688,11 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data )
return;
}
itemTextId = objmgr.CreateItemText(mailTemplateEntry->content[GetSessionDbcLocale()]);
itemTextId = sObjectMgr.CreateItemText(mailTemplateEntry->content[GetSessionDbcLocale()]);
}
Item *bodyItem = new Item; // This is not bag and then can be used new Item.
if(!bodyItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, pl))
if(!bodyItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, pl))
{
delete bodyItem;
return;
@ -871,11 +871,11 @@ void MailDraft::deleteIncludedItems( bool inDB /*= false*/ )
void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32 receiver_guid )
{
Player *receiver = objmgr.GetPlayer(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER));
Player *receiver = sObjectMgr.GetPlayer(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER));
uint32 rc_account = 0;
if(!receiver)
rc_account = objmgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER));
rc_account = sObjectMgr.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER));
if(!receiver && !rc_account) // sender not exist
{
@ -918,7 +918,7 @@ void MailDraft::SendMailTo(MailReceiver const& receiver, MailSender const& sende
prepareItems(pReceiver); // generate mail template items
uint32 mailId = objmgr.GenerateMailID();
uint32 mailId = sObjectMgr.GenerateMailID();
time_t deliver_time = time(NULL) + deliver_delay;

View file

@ -148,8 +148,8 @@ libmangosgame_a_SOURCES = \
GuildHandler.cpp \
HomeMovementGenerator.cpp \
HomeMovementGenerator.h \
HostilRefManager.cpp \
HostilRefManager.h \
HostileRefManager.cpp \
HostileRefManager.h \
IdleMovementGenerator.cpp \
IdleMovementGenerator.h \
InstanceData.cpp \
@ -218,8 +218,8 @@ libmangosgame_a_SOURCES = \
PlayerDump.h \
PointMovementGenerator.cpp \
PointMovementGenerator.h \
PoolHandler.cpp \
PoolHandler.h \
PoolManager.cpp \
PoolManager.h \
QueryHandler.cpp \
QuestDef.cpp \
QuestDef.h \
@ -283,8 +283,6 @@ libmangosgame_a_SOURCES = \
Weather.h \
World.cpp \
World.h \
WorldLog.cpp \
WorldLog.h \
WorldSession.cpp \
WorldSession.h \
WorldSocket.cpp \

View file

@ -223,7 +223,7 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode, Map* _par
void Map::InitVisibilityDistance()
{
//init visibility for continents
m_VisibleDistance = sWorld.GetMaxVisibleDistanceOnContinents();
m_VisibleDistance = World::GetMaxVisibleDistanceOnContinents();
}
// Template specialization of utility methods
@ -323,7 +323,7 @@ void Map::DeleteFromWorld(T* obj)
template<>
void Map::DeleteFromWorld(Player* pl)
{
ObjectAccessor::Instance().RemoveObject(pl);
sObjectAccessor.RemoveObject(pl);
delete pl;
}
@ -411,7 +411,7 @@ bool Map::EnsureGridLoaded(const Cell &cell)
loader.LoadN();
// Add resurrectable corpses to world object list in grid
ObjectAccessor::Instance().AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this);
sObjectAccessor.AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this);
setGridObjectDataLoaded(true,cell.GridX(), cell.GridY());
return true;
@ -2059,7 +2059,7 @@ void Map::SendInitSelf( Player * player )
void Map::SendInitTransports( Player * player )
{
// Hack to send out transports
MapManager::TransportMap& tmap = MapManager::Instance().m_TransportsByMap;
MapManager::TransportMap& tmap = sMapMgr.m_TransportsByMap;
// no transports at map
if (tmap.find(player->GetMapId()) == tmap.end())
@ -2086,7 +2086,7 @@ void Map::SendInitTransports( Player * player )
void Map::SendRemoveTransports( Player * player )
{
// Hack to send out transports
MapManager::TransportMap& tmap = MapManager::Instance().m_TransportsByMap;
MapManager::TransportMap& tmap = sMapMgr.m_TransportsByMap;
// no transports at map
if (tmap.find(player->GetMapId()) == tmap.end())
@ -2306,7 +2306,7 @@ InstanceMap::~InstanceMap()
void InstanceMap::InitVisibilityDistance()
{
//init visibility distance for instances
m_VisibleDistance = sWorld.GetMaxVisibleDistanceInInstances();
m_VisibleDistance = World::GetMaxVisibleDistanceInInstances();
}
/*
@ -2359,11 +2359,11 @@ bool InstanceMap::Add(Player *player)
if(IsDungeon())
{
// get or create an instance save for the map
InstanceSave *mapSave = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
InstanceSave *mapSave = sInstanceSaveMgr.GetInstanceSave(GetInstanceId());
if(!mapSave)
{
sLog.outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
mapSave = sInstanceSaveManager.AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
mapSave = sInstanceSaveMgr.AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
}
// check for existing instance binds
@ -2473,7 +2473,7 @@ void InstanceMap::CreateInstanceData(bool load)
if(i_data != NULL)
return;
InstanceTemplate const* mInstance = objmgr.GetInstanceTemplate(GetId());
InstanceTemplate const* mInstance = ObjectMgr::GetInstanceTemplate(GetId());
if (mInstance)
{
i_script_id = mInstance->script_id;
@ -2493,7 +2493,7 @@ void InstanceMap::CreateInstanceData(bool load)
const char* data = fields[0].GetString();
if(data)
{
sLog.outDebug("Loading instance data for `%s` with id %u", objmgr.GetScriptName(i_script_id), i_InstanceId);
sLog.outDebug("Loading instance data for `%s` with id %u", sObjectMgr.GetScriptName(i_script_id), i_InstanceId);
i_data->Load(data);
}
delete result;
@ -2501,7 +2501,7 @@ void InstanceMap::CreateInstanceData(bool load)
}
else
{
sLog.outDebug("New instance data, \"%s\" ,initialized!", objmgr.GetScriptName(i_script_id));
sLog.outDebug("New instance data, \"%s\" ,initialized!", sObjectMgr.GetScriptName(i_script_id));
i_data->Initialize();
}
}
@ -2552,7 +2552,7 @@ void InstanceMap::PermBindAllPlayers(Player *player)
if(!IsDungeon())
return;
InstanceSave *save = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(GetInstanceId());
if(!save)
{
sLog.outError("Cannot bind players, no instance save available for map!");
@ -2594,7 +2594,7 @@ void InstanceMap::UnloadAll(bool pForce)
}
if(m_resetAfterUnload == true)
objmgr.DeleteRespawnTimeForInstance(GetInstanceId());
sObjectMgr.DeleteRespawnTimeForInstance(GetInstanceId());
Map::UnloadAll(pForce);
}
@ -2612,15 +2612,15 @@ void InstanceMap::SetResetSchedule(bool on)
// it is assumed that the reset time will rarely (if ever) change while the reset is scheduled
if(IsDungeon() && !HavePlayers() && !IsRaid() && !IsHeroic())
{
InstanceSave *save = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(GetInstanceId());
if(!save) sLog.outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId());
else sInstanceSaveManager.ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), GetInstanceId()));
else sInstanceSaveMgr.ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), GetInstanceId()));
}
}
uint32 InstanceMap::GetMaxPlayers() const
{
InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId());
InstanceTemplate const* iTemplate = ObjectMgr::GetInstanceTemplate(GetId());
if(!iTemplate)
return 0;
return IsHeroic() ? iTemplate->maxPlayersHeroic : iTemplate->maxPlayers;
@ -2642,7 +2642,7 @@ BattleGroundMap::~BattleGroundMap()
void BattleGroundMap::InitVisibilityDistance()
{
//init visibility distance for BG/Arenas
m_VisibleDistance = sWorld.GetMaxVisibleDistanceInBGArenas();
m_VisibleDistance = World::GetMaxVisibleDistanceInBGArenas();
}
bool BattleGroundMap::CanEnter(Player * player)

View file

@ -166,7 +166,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player)
{
// if no instanceId via group members or instance saves is found
// the instance will be created for the first time
NewInstanceId = MapManager::Instance().GenerateInstanceId();
NewInstanceId = sMapMgr.GenerateInstanceId();
Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid());
map = CreateInstance(NewInstanceId, NULL, diff);
@ -187,7 +187,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save,
sLog.outError("CreateInstance: no entry for map %d", GetId());
assert(false);
}
if (!objmgr.GetInstanceTemplate(GetId()))
if (!ObjectMgr::GetInstanceTemplate(GetId()))
{
sLog.outError("CreateInstance: no instance template for map %d", GetId());
assert(false);

View file

@ -205,7 +205,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
if(instance_map==mapid)
break;
InstanceTemplate const* instance = objmgr.GetInstanceTemplate(instance_map);
InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(instance_map);
instance_map = instance ? instance->parent : 0;
}
while (instance_map);
@ -292,7 +292,7 @@ bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y)
bool MapManager::IsValidMAP(uint32 mapid)
{
MapEntry const* mEntry = sMapStore.LookupEntry(mapid);
return mEntry && (!mEntry->IsDungeon() || objmgr.GetInstanceTemplate(mapid));
return mEntry && (!mEntry->IsDungeon() || ObjectMgr::GetInstanceTemplate(mapid));
// TODO: add check for battleground template
}

View file

@ -154,4 +154,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
uint32 i_MaxInstanceId;
};
#define sMapMgr MapManager::Instance()
#endif

View file

@ -142,7 +142,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
data << clientcount; // clientcount place holder
//TODO: Guard Player map
HashMapHolder<Player>::MapType& m = ObjectAccessor::Instance().GetPlayers();
HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
if (security == SEC_PLAYER)
@ -204,7 +204,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
if (!(wplayer_name.empty() || wpname.find(wplayer_name) != std::wstring::npos))
continue;
std::string gname = objmgr.GetGuildNameById(itr->second->GetGuildId());
std::string gname = sObjectMgr.GetGuildNameById(itr->second->GetGuildId());
std::wstring wgname;
if(!Utf8toWStr(gname,wgname))
continue;
@ -754,10 +754,10 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
if(Script->scriptAreaTrigger(GetPlayer(), atEntry))
return;
uint32 quest_id = objmgr.GetQuestForAreaTrigger( Trigger_ID );
uint32 quest_id = sObjectMgr.GetQuestForAreaTrigger( Trigger_ID );
if( quest_id && GetPlayer()->isAlive() && GetPlayer()->IsActiveQuest(quest_id) )
{
Quest const* pQuest = objmgr.GetQuestTemplate(quest_id);
Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id);
if( pQuest )
{
if(GetPlayer()->GetQuestStatus(quest_id) == QUEST_STATUS_INCOMPLETE)
@ -765,7 +765,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
}
}
if(objmgr.IsTavernAreaTrigger(Trigger_ID))
if(sObjectMgr.IsTavernAreaTrigger(Trigger_ID))
{
// set resting flag we are in the inn
GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
@ -787,7 +787,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
}
// NULL if all values default (non teleport trigger)
AreaTrigger const* at = objmgr.GetAreaTrigger(Trigger_ID);
AreaTrigger const* at = sObjectMgr.GetAreaTrigger(Trigger_ID);
if(!at)
return;
@ -845,7 +845,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
{
// TODO: all this is probably wrong
if(missingItem)
SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1);
SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, ObjectMgr::GetItemPrototype(missingItem)->Name1);
else if(missingKey)
GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, isNormalTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC);
else if(missingQuest)
@ -1129,7 +1129,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
_player->SetSelection(guid);
Player *plr = objmgr.GetPlayer(guid);
Player *plr = sObjectMgr.GetPlayer(guid);
if(!plr) // wrong player
return;
@ -1157,7 +1157,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
uint64 guid;
recv_data >> guid;
Player *player = objmgr.GetPlayer(guid);
Player *player = sObjectMgr.GetPlayer(guid);
if(!player)
{
@ -1181,14 +1181,6 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
// Received opcode CMSG_WORLD_TELEPORT
// Time is ***, map=469, x=452.000000, y=6454.000000, z=2536.000000, orient=3.141593
//sLog.outDebug("Received opcode CMSG_WORLD_TELEPORT");
if(GetPlayer()->isInFlight())
{
sLog.outDebug("Player '%s' (GUID: %u) in flight, ignore worldport command.",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow());
return;
}
uint32 time;
uint32 mapid;
float PositionX;
@ -1202,6 +1194,15 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
recv_data >> PositionY;
recv_data >> PositionZ;
recv_data >> Orientation; // o (3.141593 = 180 degrees)
//sLog.outDebug("Received opcode CMSG_WORLD_TELEPORT");
if(GetPlayer()->isInFlight())
{
sLog.outDebug("Player '%s' (GUID: %u) in flight, ignore worldport command.",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow());
return;
}
DEBUG_LOG("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time/1000, mapid, PositionX, PositionY, PositionZ, Orientation);
if (GetSecurity() >= SEC_ADMINISTRATOR)
@ -1229,7 +1230,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
return;
}
Player *plr = objmgr.GetPlayer(charname.c_str());
Player *plr = sObjectMgr.GetPlayer(charname.c_str());
if(!plr)
{
@ -1554,7 +1555,7 @@ void WorldSession::HandleQueryInspectAchievements( WorldPacket & recv_data )
if(!recv_data.readPackGUID(guid))
return;
if(Player *player = objmgr.GetPlayer(guid))
if(Player *player = sObjectMgr.GetPlayer(guid))
player->GetAchievementMgr().SendRespondInspectAchievements(_player);
}

View file

@ -56,7 +56,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// get the destination map entry, not the current one, this will fix homebind and reset greeting
MapEntry const* mEntry = sMapStore.LookupEntry(loc.mapid);
InstanceTemplate const* mInstance = objmgr.GetInstanceTemplate(loc.mapid);
InstanceTemplate const* mInstance = ObjectMgr::GetInstanceTemplate(loc.mapid);
// reset instance validity, except if going to an instance inside an instance
if(GetPlayer()->m_InstanceValid == false && !mInstance)
@ -65,7 +65,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
GetPlayer()->SetSemaphoreTeleportFar(false);
// relocate the player to the teleport destination
GetPlayer()->SetMap(MapManager::Instance().CreateMap(loc.mapid, GetPlayer()));
GetPlayer()->SetMap(sMapMgr.CreateMap(loc.mapid, GetPlayer()));
GetPlayer()->Relocate(loc.coord_x, loc.coord_y, loc.coord_z, loc.orientation);
GetPlayer()->SendInitialPacketsBeforeAddToMap();
@ -141,14 +141,14 @@ void WorldSession::HandleMoveWorldportAckOpcode()
{
if(mEntry->IsRaid())
{
uint32 timeleft = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
uint32 timeleft = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetRaidDifficulty(), timeleft);
}
else if(mEntry->IsNonRaidDungeon() && GetPlayer()->GetDungeonDifficulty() > DUNGEON_DIFFICULTY_NORMAL)
{
if(MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID,GetPlayer()->GetDungeonDifficulty()))
{
uint32 timeleft = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
uint32 timeleft = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDungeonDifficulty(), timeleft);
}
}
@ -274,7 +274,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
if (plMover && !plMover->m_transport)
{
// elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list
for (MapManager::TransportSet::const_iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter)
for (MapManager::TransportSet::const_iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter)
{
if ((*iter)->GetGUID() == movementInfo.t_guid)
{

View file

@ -157,8 +157,8 @@ void WorldSession::SendTrainerList( uint64 guid, const std::string& strTitle )
if(!_player->IsSpellFitByClassAndRace(tSpell->learnedSpell))
continue;
bool primary_prof_first_rank = spellmgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell);
SpellChainNode const* chain_node = spellmgr.GetSpellChainNode(tSpell->learnedSpell);
bool primary_prof_first_rank = sSpellMgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell);
SpellChainNode const* chain_node = sSpellMgr.GetSpellChainNode(tSpell->learnedSpell);
TrainerSpellState state = _player->GetTrainerSpellState(tSpell);
data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case)
@ -356,7 +356,7 @@ void WorldSession::SendSpiritResurrect()
WorldSafeLocsEntry const *corpseGrave = NULL;
Corpse *corpse = _player->GetCorpse();
if(corpse)
corpseGrave = objmgr.GetClosestGraveYard(
corpseGrave = sObjectMgr.GetClosestGraveYard(
corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetMapId(), _player->GetTeam() );
// now can spawn bones
@ -365,7 +365,7 @@ void WorldSession::SendSpiritResurrect()
// teleport to nearest from corpse graveyard, if different from nearest to player ghost
if(corpseGrave)
{
WorldSafeLocsEntry const *ghostGrave = objmgr.GetClosestGraveYard(
WorldSafeLocsEntry const *ghostGrave = sObjectMgr.GetClosestGraveYard(
_player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetMapId(), _player->GetTeam() );
if(corpseGrave != ghostGrave)
@ -633,7 +633,7 @@ void WorldSession::HandleUnstablePet( WorldPacket & recv_data )
return;
}
CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(creature_id);
CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(creature_id);
if(!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets()))
{
WorldPacket data(SMSG_STABLE_RESULT, 1);
@ -760,7 +760,7 @@ void WorldSession::HandleStableSwapPet( WorldPacket & recv_data )
return;
}
CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(creature_id);
CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(creature_id);
if(!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets()))
{
WorldPacket data(SMSG_STABLE_RESULT, 1);
@ -829,7 +829,7 @@ void WorldSession::HandleRepairItemOpcode( WorldPacket & recv_data )
uint32 GuildId = _player->GetGuildId();
if (!GuildId)
return;
Guild *pGuild = objmgr.GetGuildById(GuildId);
Guild *pGuild = sObjectMgr.GetGuildById(GuildId);
if (!pGuild)
return;
pGuild->LogBankEvent(GUILD_BANK_LOG_REPAIR_MONEY, 0, _player->GetGUIDLow(), TotalCost);

View file

@ -277,7 +277,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2)
if(((Player*)this)->isInFlight())
{
WPAssert(((Player*)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
ASSERT(((Player*)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
flags2 = (MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_SPLINE2);
}
}
@ -384,7 +384,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2)
return;
}
WPAssert(((Player*)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
ASSERT(((Player*)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
FlightPathMovementGenerator *fmg = (FlightPathMovementGenerator*)(((Player*)this)->GetMotionMaster()->top());
@ -616,7 +616,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *
}
}
WPAssert(updateMask && updateMask->GetCount() == m_valuesCount);
ASSERT(updateMask && updateMask->GetCount() == m_valuesCount);
*data << (uint8)updateMask->GetBlockCount();
data->append( updateMask->GetMask(), updateMask->GetLength() );
@ -1457,7 +1457,7 @@ void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsB
void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper)
{
Player *player = objmgr.GetPlayer(receiver);
Player *player = sObjectMgr.GetPlayer(receiver);
if(!player || !player->GetSession())
return;
@ -1476,7 +1476,7 @@ namespace MaNGOS
: i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language), i_targetGUID(targetGUID) {}
void operator()(WorldPacket& data, int32 loc_idx)
{
char const* text = objmgr.GetMangosString(i_textId,loc_idx);
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
// TODO: i_object.GetName() also must be localized?
i_object.BuildMonsterChat(&data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID);
@ -1554,12 +1554,12 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE
void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper)
{
Player *player = objmgr.GetPlayer(receiver);
Player *player = sObjectMgr.GetPlayer(receiver);
if(!player || !player->GetSession())
return;
uint32 loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
char const* text = objmgr.GetMangosString(textId,loc_idx);
char const* text = sObjectMgr.GetMangosString(textId,loc_idx);
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetNameForLocaleIdx(loc_idx),receiver);
@ -1589,7 +1589,7 @@ void WorldObject::BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const*
void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/)
{
//if object is in world, map for it already created!
Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId());
if(_map)
_map->MessageBroadcast(this, data);
}
@ -1597,7 +1597,7 @@ void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/)
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/)
{
//if object is in world, map for it already created!
Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId());
if(_map)
_map->MessageDistBroadcast(this, data, dist);
}
@ -1637,7 +1637,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
if (GetTypeId()==TYPEID_PLAYER)
team = ((Player*)this)->GetTeam();
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), GetMap(), GetPhaseMask(), id, team))
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), GetMap(), GetPhaseMask(), id, team))
{
delete pCreature;
return NULL;

View file

@ -186,7 +186,7 @@ ObjectAccessor::RemoveCorpse(Corpse *corpse)
CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
objmgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID());
sObjectMgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID());
corpse->RemoveFromWorld();
i_player2corpse.erase(iter);
@ -205,7 +205,7 @@ ObjectAccessor::AddCorpse(Corpse *corpse)
CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
objmgr.AddCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID(), corpse->GetInstanceId());
sObjectMgr.AddCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID(), corpse->GetInstanceId());
}
void
@ -249,7 +249,7 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
// remove resurrectable corpse from grid object registry (loaded state checked into call)
// do not load the map if it's not loaded
Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId());
Map *map = sMapMgr.FindMap(corpse->GetMapId(), corpse->GetInstanceId());
if(map)
map->Remove(corpse, false);

View file

@ -168,4 +168,6 @@ inline Unit* ObjectAccessor::GetUnitInWorld(WorldObject const& obj, uint64 guid)
return GetCreatureInWorld(guid);
}
#define sObjectAccessor ObjectAccessor::Instance()
#endif

View file

@ -147,7 +147,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType
uint32 player_guid = itr->first;
Corpse *obj = ObjectAccessor::Instance().GetCorpseForPlayerGUID(player_guid);
Corpse *obj = sObjectAccessor.GetCorpseForPlayerGUID(player_guid);
if(!obj)
continue;
@ -171,7 +171,7 @@ ObjectGridLoader::Visit(GameObjectMapType &m)
CellPair cell_pair(x,y);
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
CellObjectGuids const& cell_guids = objmgr.GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id);
CellObjectGuids const& cell_guids = sObjectMgr.GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id);
LoadHelper(cell_guids.gameobjects, cell_pair, m, i_gameObjects, i_map);
}
@ -184,7 +184,7 @@ ObjectGridLoader::Visit(CreatureMapType &m)
CellPair cell_pair(x,y);
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
CellObjectGuids const& cell_guids = objmgr.GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id);
CellObjectGuids const& cell_guids = sObjectMgr.GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id);
LoadHelper(cell_guids.creatures, cell_pair, m, i_creatures, i_map);
}
@ -198,7 +198,7 @@ ObjectWorldLoader::Visit(CorpseMapType &m)
uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
// corpses are always added to spawn mode 0 and they are spawned by their instance id
CellObjectGuids const& cell_guids = objmgr.GetCellObjectGuids(i_map->GetId(), 0, cell_id);
CellObjectGuids const& cell_guids = sObjectMgr.GetCellObjectGuids(i_map->GetId(), 0, cell_id);
LoadHelper(cell_guids.corpses, cell_pair, m, i_corpses, i_map);
}

View file

@ -461,7 +461,7 @@ struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{
dst = D(objmgr.GetScriptId(src));
dst = D(sObjectMgr.GetScriptId(src));
}
};
@ -1653,7 +1653,7 @@ struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader>
template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{
dst = D(objmgr.GetScriptId(src));
dst = D(sObjectMgr.GetScriptId(src));
}
};
@ -2124,7 +2124,7 @@ void ObjectMgr::LoadItemRequiredTarget()
if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE ||
pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE)
{
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(pSpellInfo->Id);
SpellScriptTargetBounds bounds = sSpellMgr.GetSpellScriptTargetBounds(pSpellInfo->Id);
if (bounds.first != bounds.second)
break;
@ -3224,7 +3224,7 @@ void ObjectMgr::LoadGroups()
diff = 0; // default for both difficaly types
}
InstanceSave *save = sInstanceSaveManager.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true);
InstanceSave *save = sInstanceSaveMgr.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true);
group->BindToInstance(save, fields[3].GetBool(), true);
}while( result->NextRow() );
delete result;
@ -4099,7 +4099,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
continue;
}
// if(!objmgr.GetMangosStringLocale(tmp.dataint)) will checked after db_script_string loading
// if(!GetMangosStringLocale(tmp.dataint)) will checked after db_script_string loading
break;
}
@ -4564,7 +4564,7 @@ struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader>
template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{
dst = D(objmgr.GetScriptId(src));
dst = D(sObjectMgr.GetScriptId(src));
}
};
@ -5111,11 +5111,11 @@ uint32 ObjectMgr::GetTaxiMountDisplayId( uint32 id, uint32 team, bool allowed_al
if (!mount_info)
return 0;
uint16 mount_id = objmgr.ChooseDisplayId(team,mount_info);
uint16 mount_id = ChooseDisplayId(team,mount_info);
if (!mount_id)
return 0;
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(mount_id);
CreatureModelInfo const *minfo = GetCreatureModelRandomGender(mount_id);
if (minfo)
mount_id = minfo->modelid;
@ -5232,7 +5232,7 @@ void ObjectMgr::LoadGraveyardZones()
WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team)
{
// search for zone associated closest graveyard
uint32 zoneId = MapManager::Instance().GetZoneId(MapId,x,y,z);
uint32 zoneId = sMapMgr.GetZoneId(MapId,x,y,z);
// Simulate std. algorithm:
// found some graveyard associated to (ghost_zone,ghost_map)
@ -5834,7 +5834,7 @@ struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{
dst = D(objmgr.GetScriptId(src));
dst = D(sObjectMgr.GetScriptId(src));
}
};
@ -6225,7 +6225,7 @@ void ObjectMgr::LoadCorpses()
continue;
}
ObjectAccessor::Instance().AddCorpse(corpse);
sObjectAccessor.AddCorpse(corpse);
++count;
}
@ -7246,7 +7246,7 @@ bool PlayerCondition::Meets(Player const * player) const
case CONDITION_NO_AURA:
return !player->HasAura(value1, value2);
case CONDITION_ACTIVE_EVENT:
return gameeventmgr.IsActiveEvent(value1);
return sGameEventMgr.IsActiveEvent(value1);
default:
return false;
}
@ -7279,7 +7279,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
}
case CONDITION_ITEM:
{
ItemPrototype const *proto = objmgr.GetItemPrototype(value1);
ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1);
if(!proto)
{
sLog.outErrorDb("Item condition requires to have non existing item (%u), skipped", value1);
@ -7289,7 +7289,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
}
case CONDITION_ITEM_EQUIPPED:
{
ItemPrototype const *proto = objmgr.GetItemPrototype(value1);
ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1);
if(!proto)
{
sLog.outErrorDb("ItemEquipped condition requires to have non existing item (%u) equipped, skipped", value1);
@ -7349,7 +7349,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
case CONDITION_QUESTREWARDED:
case CONDITION_QUESTTAKEN:
{
Quest const *Quest = objmgr.GetQuestTemplate(value1);
Quest const *Quest = sObjectMgr.GetQuestTemplate(value1);
if (!Quest)
{
sLog.outErrorDb("Quest condition specifies non-existing quest (%u), skipped", value1);
@ -7383,7 +7383,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
}
case CONDITION_ACTIVE_EVENT:
{
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
if(value1 >=events.size() || !events[value1].isValid())
{
sLog.outErrorDb("Active event condition requires existed event id (%u), skipped", value1);
@ -8060,7 +8060,7 @@ void ObjectMgr::CheckScripts(ScriptMapMap const& scripts,std::set<int32>& ids)
case SCRIPT_COMMAND_TALK:
{
if(!GetMangosStringLocale (itrM->second.dataint))
sLog.outErrorDb( "Table `db_script_string` not has string id %u used db script (ID: %u)", itrM->second.dataint, itrMM->first);
sLog.outErrorDb( "Table `db_script_string` is missing string id %u, used in database script id %u.", itrM->second.dataint, itrMM->first);
if(ids.count(itrM->second.dataint))
ids.erase(itrM->second.dataint);
@ -8086,7 +8086,7 @@ void ObjectMgr::LoadDbScriptStrings()
CheckScripts(sGameObjectScripts,ids);
CheckScripts(sEventScripts,ids);
WaypointMgr.CheckTextsExistance(ids);
sWaypointMgr.CheckTextsExistance(ids);
for(std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr)
sLog.outErrorDb( "Table `db_script_string` has unused string id %u", *itr);
@ -8095,7 +8095,7 @@ void ObjectMgr::LoadDbScriptStrings()
// Functions for scripting access
uint32 GetAreaTriggerScriptId(uint32 trigger_id)
{
return objmgr.GetAreaTriggerScriptId(trigger_id);
return sObjectMgr.GetAreaTriggerScriptId(trigger_id);
}
bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value, int32 end_value)
@ -8108,17 +8108,17 @@ bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value, in
return false;
}
return objmgr.LoadMangosStrings(db,table,start_value,end_value);
return sObjectMgr.LoadMangosStrings(db,table,start_value,end_value);
}
uint32 MANGOS_DLL_SPEC GetScriptId(const char *name)
{
return objmgr.GetScriptId(name);
return sObjectMgr.GetScriptId(name);
}
ObjectMgr::ScriptNameMap & GetScriptNames()
{
return objmgr.GetScriptNames();
return sObjectMgr.GetScriptNames();
}
CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
@ -8128,5 +8128,5 @@ CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
Quest const* GetQuestTemplateStore(uint32 entry)
{
return objmgr.GetQuestTemplate(entry);
return sObjectMgr.GetQuestTemplate(entry);
}

View file

@ -339,7 +339,7 @@ class ObjectMgr
typedef std::vector<std::string> ScriptNameMap;
Player* GetPlayer(const char* name) const { return ObjectAccessor::Instance().FindPlayerByName(name);}
Player* GetPlayer(const char* name) const { return ObjectAccessor::FindPlayerByName(name);}
Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); }
static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry<GameObjectInfo>(id); }
@ -920,7 +920,7 @@ class ObjectMgr
CacheTrainerSpellMap m_mCacheTrainerSpellMap;
};
#define objmgr MaNGOS::Singleton<ObjectMgr>::Instance()
#define sObjectMgr MaNGOS::Singleton<ObjectMgr>::Instance()
// scripting access functions
MANGOS_DLL_SPEC bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());

View file

@ -138,7 +138,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
PetType pet_type = PetType(fields[18].GetUInt8());
if(pet_type==HUNTER_PET)
{
CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(petentry);
CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(petentry);
if(!creatureInfo || !creatureInfo->isTameable(owner->CanTameExoticPets()))
{
delete result;
@ -627,7 +627,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
if(IsPassiveSpell(spellid))
return true;
chainstartstore[0] = spellmgr.GetFirstSpellInChain(spellid);
chainstartstore[0] = sSpellMgr.GetFirstSpellInChain(spellid);
for (PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
{
@ -637,7 +637,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
if(IsPassiveSpell(itr->first))
continue;
uint32 chainstart = spellmgr.GetFirstSpellInChain(itr->first);
uint32 chainstart = sSpellMgr.GetFirstSpellInChain(itr->first);
uint8 x;
@ -711,7 +711,7 @@ void Pet::GivePetXP(uint32 xp)
newXP -= nextLvlXP;
GivePetLevel(level+1);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(level+1)/4);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(level+1)/4);
level = getLevel();
nextLvlXP = GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP);
@ -741,7 +741,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
uint32 guid = creature->GetMap()->GenerateLocalLowGuid(HIGHGUID_PET);
sLog.outBasic("Create pet");
uint32 pet_number = objmgr.GeneratePetNumber();
uint32 pet_number = sObjectMgr.GeneratePetNumber();
if(!Create(guid, creature->GetMap(), creature->GetPhaseMask(), creature->GetEntry(), pet_number))
return false;
@ -773,13 +773,13 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
setPowerType(POWER_FOCUS);
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(creature->getLevel())/4);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(creature->getLevel())/4);
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
if(CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);
else
SetName(creature->GetNameForLocaleIdx(objmgr.GetDBCLocaleIndex()));
SetName(creature->GetNameForLocaleIdx(sObjectMgr.GetDBCLocaleIndex()));
if(cinfo->type == CREATURE_TYPE_BEAST)
{
@ -886,7 +886,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
//SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower));
PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel);
PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel);
if(pInfo) // exist in DB
{
SetCreateHealth(pInfo->health);
@ -918,7 +918,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
}
case HUNTER_PET:
{
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(petlevel)/4);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(petlevel)/4);
//these formula may not be correct; however, it is designed to be close to what it should be
//this makes dps 0.5 of pets level
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)) );
@ -927,7 +927,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
//damage is increased afterwards as strength and pet scaling modify attack power
//stored standard pet stats are entry 1 in pet_levelinfo
PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel);
PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel);
if(pInfo) // exist in DB
{
SetCreateHealth(pInfo->health);
@ -1337,16 +1337,16 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
}
}
}
else if(spellmgr.GetSpellRank(spell_id)!=0)
else if(sSpellMgr.GetSpellRank(spell_id)!=0)
{
for (PetSpellMap::const_iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2)
{
if(itr2->second.state == PETSPELL_REMOVED) continue;
if( spellmgr.IsRankSpellDueToSpell(spellInfo,itr2->first) )
if( sSpellMgr.IsRankSpellDueToSpell(spellInfo,itr2->first) )
{
// replace by new high rank
if(spellmgr.IsHighRankOfSpell(spell_id,itr2->first))
if(sSpellMgr.IsHighRankOfSpell(spell_id,itr2->first))
{
newspell.active = itr2->second.active;
@ -1358,7 +1358,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
break;
}
// ignore new lesser rank
else if(spellmgr.IsHighRankOfSpell(itr2->first,spell_id))
else if(sSpellMgr.IsHighRankOfSpell(itr2->first,spell_id))
return false;
}
}
@ -1411,7 +1411,7 @@ void Pet::InitLevelupSpellsForLevel()
{
uint32 level = getLevel();
if(PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? spellmgr.GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
if(PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? sSpellMgr.GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
{
// PetLevelupSpellSet ordered by levels, process in reversed order
for(PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
@ -1428,7 +1428,7 @@ void Pet::InitLevelupSpellsForLevel()
int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry();
// default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game)
if(PetDefaultSpellsEntry const *defSpells = spellmgr.GetPetDefaultSpellsEntry(petSpellsId))
if(PetDefaultSpellsEntry const *defSpells = sSpellMgr.GetPetDefaultSpellsEntry(petSpellsId))
{
for(int i = 0; i < MAX_CREATURE_SPELL_DATA_SLOT; ++i)
{
@ -1497,7 +1497,7 @@ bool Pet::removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
if (learn_prev)
{
if (uint32 prev_id = spellmgr.GetPrevSpellInChain (spell_id))
if (uint32 prev_id = sSpellMgr.GetPrevSpellInChain (spell_id))
learnSpell(prev_id);
else
learn_prev = false;
@ -1605,10 +1605,10 @@ bool Pet::resetTalents(bool no_cost)
continue;
}
// remove learned spells (all ranks)
uint32 itrFirstId = spellmgr.GetFirstSpellInChain(itr->first);
uint32 itrFirstId = sSpellMgr.GetFirstSpellInChain(itr->first);
// unlearn if first rank is talent or learned by talent
if (itrFirstId == talentInfo->RankID[j] || spellmgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
if (itrFirstId == talentInfo->RankID[j] || sSpellMgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
{
removeSpell(itr->first,false);
itr = m_spells.begin();
@ -1924,7 +1924,7 @@ void Pet::learnSpellHighRank(uint32 spellid)
learnSpell(spellid);
DoPetLearnSpell worker(*this);
spellmgr.doForHighRanks(spellid,worker);
sSpellMgr.doForHighRanks(spellid,worker);
}
void Pet::SynchronizeLevelWithOwner()
@ -1944,7 +1944,7 @@ void Pet::SynchronizeLevelWithOwner()
if(getLevel() > owner->getLevel())
{
GivePetLevel(owner->getLevel());
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel())/4);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(owner->getLevel())/4);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP)-1);
}
break;

View file

@ -394,7 +394,7 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
return;
}
if(objmgr.IsReservedName(name))
if(sObjectMgr.IsReservedName(name))
{
SendPetNameInvalid(PET_NAME_RESERVED, name, NULL);
return;

View file

@ -145,12 +145,12 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
if(type == 9)
{
if(objmgr.GetGuildByName(name))
if(sObjectMgr.GetGuildByName(name))
{
SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_EXISTS);
return;
}
if(objmgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
if(sObjectMgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
{
SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_INVALID);
return;
@ -158,19 +158,19 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
}
else
{
if(objmgr.GetArenaTeamByName(name))
if(sObjectMgr.GetArenaTeamByName(name))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
return;
}
if(objmgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
if(sObjectMgr.IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_INVALID);
return;
}
}
ItemPrototype const *pProto = objmgr.GetItemPrototype(charterid);
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(charterid);
if(!pProto)
{
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, charterid, 0);
@ -401,12 +401,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
if(type == 9)
{
if(objmgr.GetGuildByName(newname))
if(sObjectMgr.GetGuildByName(newname))
{
SendGuildCommandResult(GUILD_CREATE_S, newname, GUILD_NAME_EXISTS);
return;
}
if(objmgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname))
if(sObjectMgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname))
{
SendGuildCommandResult(GUILD_CREATE_S, newname, GUILD_NAME_INVALID);
return;
@ -414,12 +414,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
}
else
{
if(objmgr.GetArenaTeamByName(newname))
if(sObjectMgr.GetArenaTeamByName(newname))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newname, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
return;
}
if(objmgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname))
if(sObjectMgr.IsReservedName(newname) || !ObjectMgr::IsValidCharterName(newname))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newname, "", ERR_ARENA_TEAM_NAME_INVALID);
return;
@ -473,7 +473,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
return;
// not let enemies sign guild charter
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != objmgr.GetPlayerTeamByGUID(ownerguid))
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(ownerguid))
{
if(type != 9)
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
@ -539,7 +539,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
SendPacket(&data);
// update for owner if online
if(Player *owner = objmgr.GetPlayer(ownerguid))
if(Player *owner = sObjectMgr.GetPlayer(ownerguid))
owner->GetSession()->SendPacket(&data);
return;
}
@ -562,7 +562,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
// item->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1+1, signs);
// update for owner if online
if(Player *owner = objmgr.GetPlayer(ownerguid))
if(Player *owner = sObjectMgr.GetPlayer(ownerguid))
owner->GetSession()->SendPacket(&data);
}
@ -584,7 +584,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data)
ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
delete result;
Player *owner = objmgr.GetPlayer(ownerguid);
Player *owner = sObjectMgr.GetPlayer(ownerguid);
if(owner) // petition owner online
{
WorldPacket data(MSG_PETITION_DECLINE, 8);
@ -782,7 +782,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
if(type == 9)
{
if(objmgr.GetGuildByName(name))
if(sObjectMgr.GetGuildByName(name))
{
SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_EXISTS);
delete result;
@ -791,7 +791,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
}
else
{
if(objmgr.GetArenaTeamByName(name))
if(sObjectMgr.GetArenaTeamByName(name))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
delete result;
@ -823,7 +823,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
}
// register guild and add guildmaster
objmgr.AddGuild(guild);
sObjectMgr.AddGuild(guild);
// add members
for(uint8 i = 0; i < signs; ++i)
@ -850,7 +850,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
at->SetEmblem(backgroud, icon, iconcolor, border, bordercolor);
// register team and add captain
objmgr.AddArenaTeam(at);
sObjectMgr.AddArenaTeam(at);
sLog.outDebug("PetitonsHandler: arena team added to objmrg");
// add members

File diff suppressed because it is too large Load diff

View file

@ -413,18 +413,18 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
// make sure the same guid doesn't already exist and is safe to use
bool incHighest = true;
if (guid != 0 && guid < objmgr.m_hiCharGuid)
if (guid != 0 && guid < sObjectMgr.m_hiCharGuid)
{
result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE guid = '%d'", guid);
if (result)
{
guid = objmgr.m_hiCharGuid; // use first free if exists
guid = sObjectMgr.m_hiCharGuid; // use first free if exists
delete result;
}
else incHighest = false;
}
else
guid = objmgr.m_hiCharGuid;
guid = sObjectMgr.m_hiCharGuid;
// normalize the name if specified and check if it exists
if (!normalizePlayerName(name))
@ -447,7 +447,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
snprintf(newguid, 20, "%d", guid);
snprintf(chraccount, 20, "%d", account);
snprintf(newpetid, 20, "%d", objmgr.GeneratePetNumber());
snprintf(newpetid, 20, "%d", sObjectMgr.GeneratePetNumber());
snprintf(lastpetid, 20, "%s", "");
std::map<uint32,uint32> items;
@ -533,7 +533,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
if(!changetoknth(vals, OBJECT_FIELD_GUID+1, newguid))
ROLLBACK(DUMP_FILE_BROKEN);
for(uint16 field = PLAYER_FIELD_INV_SLOT_HEAD; field < PLAYER_FARSIGHT; field++)
if(!changetokGuid(vals, field+1, items, objmgr.m_hiItemGuid, true))
if(!changetokGuid(vals, field+1, items, sObjectMgr.m_hiItemGuid, true))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 3, vals.c_str()))
ROLLBACK(DUMP_FILE_BROKEN);
@ -563,25 +563,25 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
ROLLBACK(DUMP_FILE_BROKEN);
// bag, item
if(!changeGuid(line, 2, items, objmgr.m_hiItemGuid, true))
if(!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid, true))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changeGuid(line, 4, items, objmgr.m_hiItemGuid))
if(!changeGuid(line, 4, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN);
break;
}
case DTT_ITEM: // item_instance t.
{
// item, owner, data field:item, owner guid
if(!changeGuid(line, 1, items, objmgr.m_hiItemGuid))
if(!changeGuid(line, 1, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 2, newguid))
ROLLBACK(DUMP_FILE_BROKEN);
std::string vals = getnth(line,3);
if(!changetokGuid(vals, OBJECT_FIELD_GUID+1, items, objmgr.m_hiItemGuid))
if(!changetokGuid(vals, OBJECT_FIELD_GUID+1, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changetoknth(vals, ITEM_FIELD_OWNER+1, newguid))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changetokGuid(vals, ITEM_FIELD_ITEM_TEXT_ID+1, itemTexts, objmgr.m_ItemTextId,true))
if(!changetokGuid(vals, ITEM_FIELD_ITEM_TEXT_ID+1, itemTexts, sObjectMgr.m_ItemTextId,true))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 3, vals.c_str()))
ROLLBACK(DUMP_FILE_BROKEN);
@ -592,7 +592,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
// guid,item_guid,
if(!changenth(line, 1, newguid))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changeGuid(line, 2, items, objmgr.m_hiItemGuid))
if(!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN);
break;
}
@ -603,7 +603,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
if(strlen(lastpetid)==0) snprintf(lastpetid, 20, "%s", currpetid);
if(strcmp(lastpetid,currpetid)!=0)
{
snprintf(newpetid, 20, "%d", objmgr.GeneratePetNumber());
snprintf(newpetid, 20, "%d", sObjectMgr.GeneratePetNumber());
snprintf(lastpetid, 20, "%s", currpetid);
}
@ -641,20 +641,20 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
case DTT_MAIL: // mail
{
// id,messageType,stationery,mailtemplate,sender,receiver,subject,itemText
if(!changeGuid(line, 1, mails, objmgr.m_mailid))
if(!changeGuid(line, 1, mails, sObjectMgr.m_mailid))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 6, newguid))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changeGuid(line, 8, itemTexts, objmgr.m_ItemTextId))
if(!changeGuid(line, 8, itemTexts, sObjectMgr.m_ItemTextId))
ROLLBACK(DUMP_FILE_BROKEN);
break;
}
case DTT_MAIL_ITEM: // mail_items
{
// mail_id,item_guid,item_template,receiver
if(!changeGuid(line, 1, mails, objmgr.m_mailid))
if(!changeGuid(line, 1, mails, sObjectMgr.m_mailid))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changeGuid(line, 2, items, objmgr.m_hiItemGuid))
if(!changeGuid(line, 2, items, sObjectMgr.m_hiItemGuid))
ROLLBACK(DUMP_FILE_BROKEN);
if(!changenth(line, 4, newguid))
ROLLBACK(DUMP_FILE_BROKEN);
@ -663,13 +663,13 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
case DTT_ITEM_TEXT: // item_text
{
// id
if(!changeGuid(line, 1, itemTexts, objmgr.m_ItemTextId))
if(!changeGuid(line, 1, itemTexts, sObjectMgr.m_ItemTextId))
ROLLBACK(DUMP_FILE_BROKEN);
// add it to cache
uint32 id= atoi(getnth(line,1).c_str());
std::string text = getnth(line,2);
objmgr.AddItemText(id,text);
sObjectMgr.AddItemText(id,text);
break;
}
default:
@ -683,12 +683,12 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
CharacterDatabase.CommitTransaction();
objmgr.m_hiItemGuid += items.size();
objmgr.m_mailid += mails.size();
objmgr.m_ItemTextId += itemTexts.size();
sObjectMgr.m_hiItemGuid += items.size();
sObjectMgr.m_mailid += mails.size();
sObjectMgr.m_ItemTextId += itemTexts.size();
if(incHighest)
++objmgr.m_hiCharGuid;
++sObjectMgr.m_hiCharGuid;
fclose(fin);

View file

@ -16,14 +16,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "PoolHandler.h"
#include "PoolManager.h"
#include "ObjectMgr.h"
#include "ProgressBar.h"
#include "Log.h"
#include "MapManager.h"
#include "Policies/SingletonImp.h"
INSTANTIATE_SINGLETON_1(PoolHandler);
INSTANTIATE_SINGLETON_1(PoolManager);
////////////////////////////////////////////////////////////
// Methods of template class PoolGroup
@ -143,9 +143,9 @@ void PoolGroup<T>::DespawnObject(uint32 guid)
template<>
void PoolGroup<Creature>::Despawn1Object(uint32 guid)
{
if (CreatureData const* data = objmgr.GetCreatureData(guid))
if (CreatureData const* data = sObjectMgr.GetCreatureData(guid))
{
objmgr.RemoveCreatureFromGrid(guid, data);
sObjectMgr.RemoveCreatureFromGrid(guid, data);
if (Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT)))
pCreature->AddObjectToRemoveList();
@ -156,9 +156,9 @@ void PoolGroup<Creature>::Despawn1Object(uint32 guid)
template<>
void PoolGroup<GameObject>::Despawn1Object(uint32 guid)
{
if (GameObjectData const* data = objmgr.GetGOData(guid))
if (GameObjectData const* data = sObjectMgr.GetGOData(guid))
{
objmgr.RemoveGameobjectFromGrid(guid, data);
sObjectMgr.RemoveGameobjectFromGrid(guid, data);
if (GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT)))
pGameobject->AddObjectToRemoveList();
@ -169,7 +169,7 @@ void PoolGroup<GameObject>::Despawn1Object(uint32 guid)
template<>
void PoolGroup<Pool>::Despawn1Object(uint32 child_pool_id)
{
poolhandler.DespawnPool(child_pool_id);
sPoolMgr.DespawnPool(child_pool_id);
}
// Method for a pool only to remove any found record causing a circular dependency loop
@ -243,12 +243,12 @@ void PoolGroup<T>::SpawnObject(uint32 limit, uint32 triggerFrom)
template <>
bool PoolGroup<Creature>::Spawn1Object(uint32 guid)
{
if (CreatureData const* data = objmgr.GetCreatureData(guid))
if (CreatureData const* data = sObjectMgr.GetCreatureData(guid))
{
objmgr.AddCreatureToGrid(guid, data);
sObjectMgr.AddCreatureToGrid(guid, data);
// Spawn if necessary (loaded grids only)
Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(data->mapid));
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
// We use spawn coords to spawn
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
@ -271,12 +271,12 @@ bool PoolGroup<Creature>::Spawn1Object(uint32 guid)
template <>
bool PoolGroup<GameObject>::Spawn1Object(uint32 guid)
{
if (GameObjectData const* data = objmgr.GetGOData(guid))
if (GameObjectData const* data = sObjectMgr.GetGOData(guid))
{
objmgr.AddGameobjectToGrid(guid, data);
sObjectMgr.AddGameobjectToGrid(guid, data);
// Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existed
Map* map = const_cast<Map*>(MapManager::Instance().CreateBaseMap(data->mapid));
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
// We use current coords to unspawn, not spawn coords since creature can have changed grid
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
@ -302,9 +302,9 @@ bool PoolGroup<GameObject>::Spawn1Object(uint32 guid)
template <>
bool PoolGroup<Pool>::Spawn1Object(uint32 child_pool_id)
{
poolhandler.SpawnPool(child_pool_id, 0, 0);
poolhandler.SpawnPool(child_pool_id, 0, TYPEID_GAMEOBJECT);
poolhandler.SpawnPool(child_pool_id, 0, TYPEID_UNIT);
sPoolMgr.SpawnPool(child_pool_id, 0, 0);
sPoolMgr.SpawnPool(child_pool_id, 0, TYPEID_GAMEOBJECT);
sPoolMgr.SpawnPool(child_pool_id, 0, TYPEID_UNIT);
return true;
}
@ -312,7 +312,7 @@ bool PoolGroup<Pool>::Spawn1Object(uint32 child_pool_id)
template <>
bool PoolGroup<Creature>::ReSpawn1Object(uint32 guid)
{
if (CreatureData const* data = objmgr.GetCreatureData(guid))
if (CreatureData const* data = sObjectMgr.GetCreatureData(guid))
{
if (Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT)))
pCreature->GetMap()->Add(pCreature);
@ -325,7 +325,7 @@ bool PoolGroup<Creature>::ReSpawn1Object(uint32 guid)
template <>
bool PoolGroup<GameObject>::ReSpawn1Object(uint32 guid)
{
if (GameObjectData const* data = objmgr.GetGOData(guid))
if (GameObjectData const* data = sObjectMgr.GetGOData(guid))
{
if (GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT)))
pGameobject->GetMap()->Add(pGameobject);
@ -343,14 +343,14 @@ bool PoolGroup<Pool>::ReSpawn1Object(uint32 /*guid*/)
////////////////////////////////////////////////////////////
// Methods of class PoolHandler
// Methods of class PoolManager
PoolHandler::PoolHandler()
PoolManager::PoolManager()
{
m_IsPoolSystemStarted = false;
}
void PoolHandler::LoadFromDB()
void PoolManager::LoadFromDB()
{
QueryResult *result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template");
if (!result)
@ -428,7 +428,7 @@ void PoolHandler::LoadFromDB()
uint16 pool_id = fields[1].GetUInt16();
float chance = fields[2].GetFloat();
CreatureData const* data = objmgr.GetCreatureData(guid);
CreatureData const* data = sObjectMgr.GetCreatureData(guid);
if (!data)
{
sLog.outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id );
@ -489,13 +489,13 @@ void PoolHandler::LoadFromDB()
uint16 pool_id = fields[1].GetUInt16();
float chance = fields[2].GetFloat();
GameObjectData const* data = objmgr.GetGOData(guid);
GameObjectData const* data = sObjectMgr.GetGOData(guid);
if (!data)
{
sLog.outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id );
continue;
}
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(data->id);
GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(data->id);
if (goinfo->type != GAMEOBJECT_TYPE_CHEST &&
goinfo->type != GAMEOBJECT_TYPE_GOOBER &&
goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE)
@ -619,7 +619,7 @@ void PoolHandler::LoadFromDB()
}
// The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks
void PoolHandler::Initialize()
void PoolManager::Initialize()
{
QueryResult *result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry FROM pool_template LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL AND pool_pool.pool_id IS NULL");
uint32 count=0;
@ -648,7 +648,7 @@ void PoolHandler::Initialize()
// Call to spawn a pool, if cache if true the method will spawn only if cached entry is different
// If it's same, the gameobject/creature is respawned only (added back to map)
void PoolHandler::SpawnPool(uint16 pool_id, uint32 guid, uint32 type)
void PoolManager::SpawnPool(uint16 pool_id, uint32 guid, uint32 type)
{
switch (type)
{
@ -667,7 +667,7 @@ void PoolHandler::SpawnPool(uint16 pool_id, uint32 guid, uint32 type)
}
// Call to despawn a pool, all gameobjects/creatures in this pool are removed
void PoolHandler::DespawnPool(uint16 pool_id)
void PoolManager::DespawnPool(uint16 pool_id)
{
if (!mPoolCreatureGroups[pool_id].isEmpty())
mPoolCreatureGroups[pool_id].DespawnObject();
@ -682,7 +682,7 @@ void PoolHandler::DespawnPool(uint16 pool_id)
// Call to update the pool when a gameobject/creature part of pool [pool_id] is ready to respawn
// Here we cache only the creature/gameobject whose guid is passed as parameter
// Then the spawn pool call will use this cache to decide
void PoolHandler::UpdatePool(uint16 pool_id, uint32 guid, uint32 type)
void PoolManager::UpdatePool(uint16 pool_id, uint32 guid, uint32 type)
{
if (uint16 motherpoolid = IsPartOfAPool(pool_id, 0))
SpawnPool(motherpoolid, 0, 0);
@ -691,7 +691,7 @@ void PoolHandler::UpdatePool(uint16 pool_id, uint32 guid, uint32 type)
}
// Method that tell if the gameobject/creature is part of a pool and return the pool id if yes
uint16 PoolHandler::IsPartOfAPool(uint32 guid, uint32 type)
uint16 PoolManager::IsPartOfAPool(uint32 guid, uint32 type)
{
if (type == 0) // pool of pool
{
@ -715,7 +715,7 @@ uint16 PoolHandler::IsPartOfAPool(uint32 guid, uint32 type)
}
// Method that check chance integrity of the creatures and gameobjects in this pool
bool PoolHandler::CheckPool(uint16 pool_id)
bool PoolManager::CheckPool(uint16 pool_id)
{
return pool_id <= max_pool_id &&
mPoolGameobjectGroups[pool_id].CheckPool() &&
@ -724,7 +724,7 @@ bool PoolHandler::CheckPool(uint16 pool_id)
}
// Method that tell if a creature or gameobject in pool_id is spawned currently
bool PoolHandler::IsSpawnedObject(uint16 pool_id, uint32 guid, uint32 type)
bool PoolManager::IsSpawnedObject(uint16 pool_id, uint32 guid, uint32 type)
{
if (pool_id > max_pool_id)
return false;

View file

@ -65,11 +65,11 @@ class Pool // for Pool of Pool
{
};
class PoolHandler
class PoolManager
{
public:
PoolHandler();
~PoolHandler() {};
PoolManager();
~PoolManager() {};
void LoadFromDB();
uint16 IsPartOfAPool(uint32 guid, uint32 type);
bool IsSpawnedObject(uint16 pool_id, uint32 guid, uint32 type);
@ -99,5 +99,5 @@ class PoolHandler
};
#define poolhandler MaNGOS::Singleton<PoolHandler>::Instance()
#define sPoolMgr MaNGOS::Singleton<PoolManager>::Instance()
#endif

View file

@ -129,7 +129,7 @@ void WorldSession::HandleNameQueryOpcode( WorldPacket & recv_data )
recv_data >> guid;
Player *pChar = objmgr.GetPlayer(guid);
Player *pChar = sObjectMgr.GetPlayer(guid);
if (pChar)
SendNameQueryOpcode(pChar);
@ -153,7 +153,7 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
uint64 guid;
recv_data >> guid;
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
CreatureInfo const *ci = ObjectMgr::GetCreatureTemplate(entry);
if (ci)
{
std::string Name, SubName;
@ -163,7 +163,7 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
CreatureLocale const *cl = objmgr.GetCreatureLocale(entry);
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(entry);
if (cl)
{
if (cl->Name.size() > size_t(loc_idx) && !cl->Name[loc_idx].empty())
@ -218,7 +218,7 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data )
uint64 guid;
recv_data >> guid;
const GameObjectInfo *info = objmgr.GetGameObjectInfo(entryID);
const GameObjectInfo *info = ObjectMgr::GetGameObjectInfo(entryID);
if(info)
{
std::string Name;
@ -232,7 +232,7 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
GameObjectLocale const *gl = objmgr.GetGameObjectLocale(entryID);
GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(entryID);
if (gl)
{
if (gl->Name.size() > size_t(loc_idx) && !gl->Name[loc_idx].empty())
@ -298,7 +298,7 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
if(corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0)
{
// if corpse map have entrance
if(Map const* entranceMap = MapManager::Instance().CreateBaseMap(corpseMapEntry->entrance_map))
if(Map const* entranceMap = sMapMgr.CreateBaseMap(corpseMapEntry->entrance_map))
{
mapid = corpseMapEntry->entrance_map;
x = corpseMapEntry->entrance_x;
@ -331,7 +331,7 @@ void WorldSession::HandleNpcTextQueryOpcode( WorldPacket & recv_data )
recv_data >> guid;
_player->SetTargetGUID(guid);
GossipText const* pGossip = objmgr.GetGossipText(textID);
GossipText const* pGossip = sObjectMgr.GetGossipText(textID);
WorldPacket data( SMSG_NPC_TEXT_UPDATE, 100 ); // guess size
data << textID;
@ -364,7 +364,7 @@ void WorldSession::HandleNpcTextQueryOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
NpcTextLocale const *nl = objmgr.GetNpcTextLocale(textID);
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID);
if (nl)
{
for (int i = 0; i < 8; ++i)
@ -435,7 +435,7 @@ void WorldSession::HandlePageTextQueryOpcode( WorldPacket & recv_data )
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
PageTextLocale const *pl = objmgr.GetPageTextLocale(pageID);
PageTextLocale const *pl = sObjectMgr.GetPageTextLocale(pageID);
if (pl)
{
if (pl->Text.size() > size_t(loc_idx) && !pl->Text[loc_idx].empty())

View file

@ -129,7 +129,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
return;
}
Quest const* qInfo = objmgr.GetQuestTemplate(quest);
Quest const* qInfo = sObjectMgr.GetQuestTemplate(quest);
if ( qInfo )
{
// prevent cheating
@ -239,7 +239,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode( WorldPacket & recv_data )
return;
}
Quest const* pQuest = objmgr.GetQuestTemplate(quest);
Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest);
if ( pQuest )
{
_player->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, pObject->GetGUID(), true);
@ -252,7 +252,7 @@ void WorldSession::HandleQuestQueryOpcode( WorldPacket & recv_data )
recv_data >> quest;
sLog.outDebug( "WORLD: Received CMSG_QUEST_QUERY quest = %u",quest );
Quest const *pQuest = objmgr.GetQuestTemplate(quest);
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest);
if ( pQuest )
{
_player->PlayerTalkClass->SendQuestQueryResponse( pQuest );
@ -283,7 +283,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data )
if(!pObject->hasInvolvedQuest(quest))
return;
Quest const *pQuest = objmgr.GetQuestTemplate(quest);
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest);
if( pQuest )
{
if( _player->CanRewardQuest( pQuest, reward, true ) )
@ -336,7 +336,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode( WorldPacket & recv_data
if( _player->GetQuestStatus( quest ) != QUEST_STATUS_COMPLETE )
return;
if(Quest const *pQuest = objmgr.GetQuestTemplate(quest))
if(Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest))
_player->PlayerTalkClass->SendQuestGiverOfferReward( pQuest, guid, true );
}
@ -374,7 +374,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
if(!_player->TakeQuestSourceItem( quest, true ))
return; // can't un-equip some items, reject quest cancel
if (const Quest *pQuest = objmgr.GetQuestTemplate(quest))
if (const Quest *pQuest = sObjectMgr.GetQuestTemplate(quest))
{
if (pQuest->HasFlag(QUEST_MANGOS_FLAGS_TIMED))
_player->RemoveTimedQuest(quest);
@ -396,7 +396,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
sLog.outDebug("WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest);
if (const Quest* pQuest = objmgr.GetQuestTemplate(quest))
if (const Quest* pQuest = sObjectMgr.GetQuestTemplate(quest))
{
if (!pQuest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
return;
@ -435,7 +435,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data)
sLog.outDebug( "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest );
Quest const *pQuest = objmgr.GetQuestTemplate(quest);
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest);
if( pQuest )
{
if( _player->GetQuestStatus( quest ) != QUEST_STATUS_COMPLETE )
@ -467,7 +467,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
sLog.outDebug("WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId);
if (Quest const *pQuest = objmgr.GetQuestTemplate(questId))
if (Quest const *pQuest = sObjectMgr.GetQuestTemplate(questId))
{
if (Group* pGroup = _player->GetGroup())
{
@ -550,14 +550,14 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
{
case TYPEID_GAMEOBJECT:
{
qir = &objmgr.mGOQuestInvolvedRelations;
qr = &objmgr.mGOQuestRelations;
qir = &sObjectMgr.mGOQuestInvolvedRelations;
qr = &sObjectMgr.mGOQuestRelations;
break;
}
case TYPEID_UNIT:
{
qir = &objmgr.mCreatureQuestInvolvedRelations;
qr = &objmgr.mCreatureQuestRelations;
qir = &sObjectMgr.mCreatureQuestInvolvedRelations;
qr = &sObjectMgr.mCreatureQuestRelations;
break;
}
default:
@ -570,7 +570,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
{
uint32 result2 = 0;
uint32 quest_id = i->second;
Quest const *pQuest = objmgr.GetQuestTemplate(quest_id);
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest_id);
if ( !pQuest ) continue;
QuestStatus status = pPlayer->GetQuestStatus( quest_id );
@ -593,7 +593,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
{
uint32 result2 = 0;
uint32 quest_id = i->second;
Quest const *pQuest = objmgr.GetQuestTemplate(quest_id);
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest_id);
if ( !pQuest )
continue;

View file

@ -94,7 +94,7 @@ bool LoadScriptingModule(char const* libName)
UnloadScriptingModule();
Script=testScript;
Script->ScriptsInit(objmgr.GetScriptNames());
Script->ScriptsInit(sObjectMgr.GetScriptNames());
sWorld.SetScriptsVersion(Script->ScriptsVersion());

View file

@ -116,7 +116,7 @@ void LoadSkillDiscoveryTable()
}
else if (reqSkillOrSpell == 0) // skill case
{
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellId);
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellId);
if (bounds.first==bounds.second)
{
@ -167,7 +167,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
if (tab == SkillDiscoveryStore.end())
return 0;
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellId);
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellId);
uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : 0;
float full_chance = 0;

View file

@ -120,7 +120,7 @@ void PlayerSocial::SetFriendNote(uint32 friend_guid, std::string note)
void PlayerSocial::SendSocialList()
{
Player *plr = objmgr.GetPlayer(GetPlayerGUID());
Player *plr = sObjectMgr.GetPlayer(GetPlayerGUID());
if(!plr)
return;

View file

@ -1991,7 +1991,7 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
}
case TARGET_TABLE_X_Y_Z_COORDINATES:
{
SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id);
SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id);
if(st)
{
if (st->target_mapId == m_caster->GetMapId())
@ -2187,7 +2187,7 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
case SPELL_EFFECT_SUMMON_PLAYER:
if (m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->GetSelection())
{
Player* target = objmgr.GetPlayer(((Player*)m_caster)->GetSelection());
Player* target = sObjectMgr.GetPlayer(((Player*)m_caster)->GetSelection());
if(target)
TagUnitMap.push_back(target);
}
@ -3192,7 +3192,7 @@ void Spell::WriteAmmoToPacket( WorldPacket * data )
uint32 ammoID = ((Player*)m_caster)->GetUInt32Value(PLAYER_AMMO_ID);
if(ammoID)
{
ItemPrototype const *pProto = objmgr.GetItemPrototype( ammoID );
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( ammoID );
if(pProto)
{
ammoDisplayID = pProto->DisplayInfoID;
@ -3765,14 +3765,14 @@ void Spell::HandleThreatSpells(uint32 spellId)
if(!m_targets.getUnitTarget()->CanHaveThreatList())
return;
uint16 threat = spellmgr.GetSpellThreat(spellId);
uint16 threat = sSpellMgr.GetSpellThreat(spellId);
if(!threat)
return;
m_targets.getUnitTarget()->AddThreat(m_caster, float(threat), false, GetSpellSchoolMask(m_spellInfo), m_spellInfo);
DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threat);
DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr.GetSpellRank(spellId), threat);
}
void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i, float DamageMultiplier)
@ -4093,7 +4093,7 @@ SpellCastResult Spell::CheckCast(bool strict)
uint32 zone, area;
m_caster->GetZoneAndAreaId(zone, area);
SpellCastResult locRes= spellmgr.GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area,
SpellCastResult locRes= sSpellMgr.GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area,
m_caster->GetCharmerOrOwnerPlayerOrPlayerItself());
if (locRes != SPELL_CAST_OK)
return locRes;
@ -4103,7 +4103,7 @@ SpellCastResult Spell::CheckCast(bool strict)
!IsPassiveSpell(m_spellInfo->Id) && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_MOUNTED))
{
if (m_caster->isInFlight())
return SPELL_FAILED_NOT_FLYING;
return SPELL_FAILED_NOT_ON_TAXI;
else
return SPELL_FAILED_NOT_MOUNTED;
}
@ -4128,7 +4128,7 @@ SpellCastResult Spell::CheckCast(bool strict)
m_spellInfo->EffectImplicitTargetA[j] == TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT)
{
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(m_spellInfo->Id);
SpellScriptTargetBounds bounds = sSpellMgr.GetSpellScriptTargetBounds(m_spellInfo->Id);
if(bounds.first==bounds.second)
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = TARGET_SCRIPT or TARGET_SCRIPT_COORDINATES, but does not have record in `spell_script_target`",m_spellInfo->Id);
@ -4609,7 +4609,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if(!((Player*)m_caster)->GetSelection())
return SPELL_FAILED_BAD_TARGETS;
Player* target = objmgr.GetPlayer(((Player*)m_caster)->GetSelection());
Player* target = sObjectMgr.GetPlayer(((Player*)m_caster)->GetSelection());
if( !target || ((Player*)m_caster) == target || !target->IsInSameRaidWith((Player*)m_caster) )
return SPELL_FAILED_BAD_TARGETS;
@ -5539,7 +5539,7 @@ SpellCastResult Spell::CheckItems()
return SPELL_FAILED_NO_AMMO;
}
ItemPrototype const *ammoProto = objmgr.GetItemPrototype( ammo );
ItemPrototype const *ammoProto = ObjectMgr::GetItemPrototype( ammo );
if(!ammoProto)
return SPELL_FAILED_NO_AMMO;
@ -5690,7 +5690,7 @@ void Spell::UpdatePointers()
bool Spell::IsAffectedByAura(Aura *aura)
{
return spellmgr.IsAffectedByMod(m_spellInfo, aura->getAuraSpellMod());
return sSpellMgr.IsAffectedByMod(m_spellInfo, aura->getAuraSpellMod());
}
bool Spell::CheckTargetCreatureType(Unit* target) const

View file

@ -828,7 +828,7 @@ void AreaAura::Update(uint32 diff)
if(!apply)
continue;
if(SpellEntry const *actualSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(GetSpellProto(), (*tIter)->getLevel()))
if(SpellEntry const *actualSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(GetSpellProto(), (*tIter)->getLevel()))
{
int32 actualBasePoints = m_currentBasePoints;
// recalculate basepoints for lower rank (all AreaAura spell not use custom basepoints?)
@ -2682,7 +2682,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
}
// pet auras
if(PetAura const* petSpell = spellmgr.GetPetAura(GetId(), m_effIndex))
if(PetAura const* petSpell = sSpellMgr.GetPetAura(GetId(), m_effIndex))
{
if(apply)
m_target->AddPetAura(petSpell);
@ -2693,7 +2693,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if(GetEffIndex()==0 && m_target->GetTypeId()==TYPEID_PLAYER)
{
SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId());
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if(saBounds.first != saBounds.second)
{
uint32 zone, area;
@ -2723,7 +2723,7 @@ void Aura::HandleAuraMounted(bool apply, bool Real)
if(apply)
{
CreatureInfo const* ci = objmgr.GetCreatureTemplate(m_modifier.m_miscvalue);
CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(m_modifier.m_miscvalue);
if(!ci)
{
sLog.outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need it modelid)", m_modifier.m_miscvalue);
@ -2734,8 +2734,8 @@ void Aura::HandleAuraMounted(bool apply, bool Real)
if (m_target->GetTypeId()==TYPEID_PLAYER)
team = ((Player*)m_target)->GetTeam();
uint32 display_id = objmgr.ChooseDisplayId(team,ci);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
@ -3131,7 +3131,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
{
uint32 model_id;
CreatureInfo const * ci = objmgr.GetCreatureTemplate(m_modifier.m_miscvalue);
CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(m_modifier.m_miscvalue);
if (!ci)
{
model_id = 16358; // pig pink ^_^
@ -3200,14 +3200,14 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
if (!m_target->GetAurasByType(SPELL_AURA_MOUNTED).empty())
{
uint32 cr_id = m_target->GetAurasByType(SPELL_AURA_MOUNTED).front()->GetModifier()->m_miscvalue;
if (CreatureInfo const* ci = objmgr.GetCreatureTemplate(cr_id))
if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(cr_id))
{
uint32 team = 0;
if (m_target->GetTypeId() == TYPEID_PLAYER)
team = ((Player*)m_target)->GetTeam();
uint32 display_id = objmgr.ChooseDisplayId(team, ci);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
uint32 display_id = sObjectMgr.ChooseDisplayId(team, ci);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
@ -3522,7 +3522,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
}
//just to enable stat window
charmInfo->SetPetNumber(objmgr.GeneratePetNumber(), true);
charmInfo->SetPetNumber(sObjectMgr.GeneratePetNumber(), true);
//if charmed two demons the same session, the 2nd gets the 1st one's name
m_target->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
}
@ -3669,7 +3669,7 @@ void Aura::HandleAuraModStun(bool apply, bool Real)
if(GetId() == 39837)
{
GameObject* pObj = new GameObject;
if(pObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 185584, m_target->GetMap(), m_target->GetPhaseMask(),
if(pObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 185584, m_target->GetMap(), m_target->GetPhaseMask(),
m_target->GetPositionX(), m_target->GetPositionY(), m_target->GetPositionZ(), m_target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{
pObj->SetRespawnTime(GetAuraDuration()/IN_MILISECONDS);
@ -5905,7 +5905,7 @@ void Aura::HandleAuraEmpathy(bool apply, bool /*Real*/)
if(m_target->GetTypeId() != TYPEID_UNIT)
return;
CreatureInfo const * ci = objmgr.GetCreatureTemplate(m_target->GetEntry());
CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(m_target->GetEntry());
if(ci && ci->type == CREATURE_TYPE_BEAST)
m_target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply);
}
@ -6231,7 +6231,7 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
case 0:
{
// energize caster
int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + spellmgr.GetSpellRank(vSpell->Id));
int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + sSpellMgr.GetSpellRank(vSpell->Id));
int32 basepoints0 = caster->GetMaxPower(POWER_MANA) * manapct1000 / 1000;
caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true);
break;
@ -7355,7 +7355,7 @@ void Aura::HandlePhase(bool apply, bool Real)
if(GetEffIndex()==0)
{
SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId());
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if(saBounds.first != saBounds.second)
{
uint32 zone, area;

View file

@ -889,7 +889,7 @@ void Spell::EffectDummy(uint32 i)
Map *map = creatureTarget->GetMap();
// create before death for get proper coordinates
if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 179644, map, m_caster->GetPhaseMask(),
if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 179644, map, m_caster->GetPhaseMask(),
creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(),
creatureTarget->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY) )
{
@ -1934,7 +1934,7 @@ void Spell::EffectDummy(uint32 i)
}
// pet auras
if (PetAura const* petSpell = spellmgr.GetPetAura(m_spellInfo->Id, i))
if (PetAura const* petSpell = sSpellMgr.GetPetAura(m_spellInfo->Id, i))
{
m_caster->AddPetAura(petSpell);
return;
@ -2260,7 +2260,7 @@ void Spell::EffectTeleportUnits(uint32 i)
case TARGET_AREAEFFECT_INSTANT: // in all cases first TARGET_TABLE_X_Y_Z_COORDINATES
case TARGET_TABLE_X_Y_Z_COORDINATES:
{
SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id);
SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id);
if(!st)
{
sLog.outError( "Spell::EffectTeleportUnits - unknown Teleport coordinates for spell ID %u", m_spellInfo->Id );
@ -2713,7 +2713,7 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype)
Player* player = (Player*)unitTarget;
uint32 newitemid = itemtype;
ItemPrototype const *pProto = objmgr.GetItemPrototype( newitemid );
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( newitemid );
if(!pProto)
{
player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL );
@ -2953,7 +2953,7 @@ void Spell::EffectEnergize(uint32 i)
for(Unit::AuraMap::iterator itr = Auras.begin(); itr != Auras.end(); ++itr)
{
uint32 spell_id = itr->second->GetId();
if(uint32 mask = spellmgr.GetSpellElixirMask(spell_id))
if(uint32 mask = sSpellMgr.GetSpellElixirMask(spell_id))
elixir_mask |= mask;
}
@ -2962,7 +2962,7 @@ void Spell::EffectEnergize(uint32 i)
// get all available elixirs by mask and spell level
std::vector<uint32> elixirs;
SpellElixirMap const& m_spellElixirs = spellmgr.GetSpellElixirMap();
SpellElixirMap const& m_spellElixirs = sSpellMgr.GetSpellElixirMap();
for(SpellElixirMap::const_iterator itr = m_spellElixirs.begin(); itr != m_spellElixirs.end(); ++itr)
{
if (itr->second & elixir_mask)
@ -3395,7 +3395,7 @@ void Spell::EffectSummon(uint32 i)
}
Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
uint32 pet_number = sObjectMgr.GeneratePetNumber();
if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
m_spellInfo->EffectMiscValue[i], pet_number))
{
@ -3810,7 +3810,7 @@ void Spell::EffectSummonGuardian(uint32 i)
Pet* spawnCreature = new Pet(GUARDIAN_PET);
Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
uint32 pet_number = sObjectMgr.GeneratePetNumber();
if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map,m_caster->GetPhaseMask(),
m_spellInfo->EffectMiscValue[i], pet_number))
{
@ -4279,7 +4279,7 @@ void Spell::EffectSummonPet(uint32 i)
}
Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
uint32 pet_number = sObjectMgr.GeneratePetNumber();
if(!NewSummon->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
petentry, pet_number))
{
@ -4354,7 +4354,7 @@ void Spell::EffectSummonPet(uint32 i)
}
// generate new name for summon pet
std::string new_name=objmgr.GeneratePetName(petentry);
std::string new_name=sObjectMgr.GeneratePetName(petentry);
if(!new_name.empty())
NewSummon->SetName(new_name);
}
@ -4798,7 +4798,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
Map *map = target->GetMap();
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map,
if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map,
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{
delete pGameObj;
@ -4847,7 +4847,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
if(uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
{
GameObject* linkedGO = new GameObject;
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
if(linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
@ -5613,7 +5613,7 @@ void Spell::EffectDuel(uint32 i)
uint32 gameobject_id = m_spellInfo->EffectMiscValue[i];
Map *map = m_caster->GetMap();
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id,
if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id,
map, m_caster->GetPhaseMask(),
m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2 ,
m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2 ,
@ -5798,7 +5798,7 @@ void Spell::EffectSummonTotem(uint32 i)
Totem* pTotem = new Totem;
if(!pTotem->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), m_caster->GetMap(), m_caster->GetPhaseMask(),
if(!pTotem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), m_caster->GetMap(), m_caster->GetPhaseMask(),
m_spellInfo->EffectMiscValue[i], team ))
{
delete pTotem;
@ -6006,7 +6006,7 @@ void Spell::EffectSummonObject(uint32 i)
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
Map *map = m_caster->GetMap();
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map,
if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map,
m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
{
delete pGameObj;
@ -6300,7 +6300,7 @@ void Spell::EffectSummonCritter(uint32 i)
Pet* critter = new Pet(MINI_PET);
Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
uint32 pet_number = sObjectMgr.GeneratePetNumber();
if(!critter->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
pet_entry, pet_number))
{
@ -6516,7 +6516,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
{
uint32 name_id = m_spellInfo->EffectMiscValue[effIndex];
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(name_id);
GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(name_id);
if (!goinfo)
{
@ -6569,7 +6569,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
GameObject* pGameObj = new GameObject;
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap,
if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap,
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{
delete pGameObj;
@ -6630,7 +6630,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
if(uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
{
GameObject* linkedGO = new GameObject;
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
if(linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);

View file

@ -357,7 +357,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
// auto-selection buff level base at target level (in spellInfo)
if(targets.getUnitTarget())
{
SpellEntry const *actualSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(spellInfo,targets.getUnitTarget()->getLevel());
SpellEntry const *actualSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(spellInfo,targets.getUnitTarget()->getLevel());
// if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message
if(actualSpellInfo)
@ -554,7 +554,7 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
if (!unit || unit->isInCombat()) // client prevent click and set different icon at combat state
return;
SpellClickInfoMapBounds clickPair = objmgr.GetSpellClickInfoMapBounds(unit->GetEntry());
SpellClickInfoMapBounds clickPair = sObjectMgr.GetSpellClickInfoMapBounds(unit->GetEntry());
for(SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
{
if (itr->second.IsFitToRequirements(_player))

View file

@ -312,7 +312,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
}
case SPELLFAMILY_POTION:
return spellmgr.GetSpellElixirSpecific(spellInfo->Id);
return sSpellMgr.GetSpellElixirSpecific(spellInfo->Id);
case SPELLFAMILY_DEATHKNIGHT:
if (spellInfo->Category == 47)
@ -321,7 +321,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
}
// elixirs can have different families, but potion most ofc.
if(SpellSpecific sp = spellmgr.GetSpellElixirSpecific(spellInfo->Id))
if(SpellSpecific sp = sSpellMgr.GetSpellElixirSpecific(spellInfo->Id))
return sp;
return SPELL_NORMAL;
@ -845,7 +845,7 @@ bool SpellMgr::IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod)
struct DoSpellProcEvent
{
DoSpellProcEvent(SpellProcEventEntry const& _spe) : spe(_spe) {}
void operator() (uint32 spell_id) { spellmgr.mSpellProcEventMap[spell_id] = spe; }
void operator() (uint32 spell_id) { sSpellMgr.mSpellProcEventMap[spell_id] = spe; }
SpellProcEventEntry const& spe;
};
@ -934,7 +934,7 @@ void SpellMgr::LoadSpellProcEvents()
struct DoSpellProcItemEnchant
{
DoSpellProcItemEnchant(float _ppm) : ppm(_ppm) {}
void operator() (uint32 spell_id) { spellmgr.mSpellProcItemEnchantMap[spell_id] = ppm; }
void operator() (uint32 spell_id) { sSpellMgr.mSpellProcItemEnchantMap[spell_id] = ppm; }
float ppm;
};
@ -1004,7 +1004,7 @@ void SpellMgr::LoadSpellProcItemEnchant()
struct DoSpellBonusess
{
DoSpellBonusess(SpellBonusEntry const& _spellBonus) : spellBonus(_spellBonus) {}
void operator() (uint32 spell_id) { spellmgr.mSpellBonusMap[spell_id] = spellBonus; }
void operator() (uint32 spell_id) { sSpellMgr.mSpellBonusMap[spell_id] = spellBonus; }
SpellBonusEntry const& spellBonus;
};
@ -1251,7 +1251,7 @@ bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo)
if(IsProfessionOrRidingSpell(spellInfo->Id))
return false;
if(spellmgr.IsSkillBonusSpell(spellInfo->Id))
if(sSpellMgr.IsSkillBonusSpell(spellInfo->Id))
return false;
// All stance spells. if any better way, change it.
@ -2260,8 +2260,8 @@ void SpellMgr::LoadSpellScriptTarget()
{
if( spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT || spellInfo->EffectImplicitTargetA[j] != TARGET_SELF && spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT )
{
SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(spellInfo->Id);
SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(spellInfo->Id);
SpellScriptTarget::const_iterator lower = GetBeginSpellScriptTarget(spellInfo->Id);
SpellScriptTarget::const_iterator upper = GetEndSpellScriptTarget(spellInfo->Id);
if(lower==upper)
{
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = %u (TARGET_SCRIPT), but does not have record in `spell_script_target`",spellInfo->Id,TARGET_SCRIPT);
@ -2408,7 +2408,7 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr
return false;
// remove duplicates with levelupSpells if any
if(PetLevelupSpellSet const *levelupSpells = cInfo->family ? spellmgr.GetPetLevelupSpellList(cInfo->family) : NULL)
if(PetLevelupSpellSet const *levelupSpells = cInfo->family ? sSpellMgr.GetPetLevelupSpellList(cInfo->family) : NULL)
{
for(int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
{
@ -2680,7 +2680,7 @@ void SpellMgr::LoadSpellAreas()
continue;
}
if(spellArea.questStart && !objmgr.GetQuestTemplate(spellArea.questStart))
if(spellArea.questStart && !sObjectMgr.GetQuestTemplate(spellArea.questStart))
{
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart);
continue;
@ -2688,7 +2688,7 @@ void SpellMgr::LoadSpellAreas()
if(spellArea.questEnd)
{
if(!objmgr.GetQuestTemplate(spellArea.questEnd))
if(!sObjectMgr.GetQuestTemplate(spellArea.questEnd))
{
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd);
continue;
@ -2849,7 +2849,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
}
// DB base check (if non empty then must fit at least single for allow)
SpellAreaMapBounds saBounds = spellmgr.GetSpellAreaMapBounds(spellInfo->Id);
SpellAreaMapBounds saBounds = GetSpellAreaMapBounds(spellInfo->Id);
if (saBounds.first != saBounds.second)
{
for(SpellAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)

View file

@ -1035,5 +1035,5 @@ class SpellMgr
SpellAreaForAreaMap mSpellAreaForAreaMap;
};
#define spellmgr SpellMgr::Instance()
#define sSpellMgr SpellMgr::Instance()
#endif

View file

@ -49,7 +49,7 @@ void WorldSession::SendTaxiStatus( uint64 guid )
return;
}
uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
// not found nearest
if(curloc == 0)
@ -94,7 +94,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data )
void WorldSession::SendTaxiMenu( Creature* unit )
{
// find current node
uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
if ( curloc == 0 )
return;
@ -129,7 +129,7 @@ void WorldSession::SendDoFlight( uint32 mountDisplayId, uint32 path, uint32 path
bool WorldSession::SendLearnNewTaxiNode( Creature* unit )
{
// find current node
uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
if ( curloc == 0 )
return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result.
@ -231,10 +231,10 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& /*recv_data*/)
sLog.outDebug( "WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode );
uint32 mountDisplayId = objmgr.GetTaxiMountDisplayId(sourcenode, GetPlayer()->GetTeam());
uint32 mountDisplayId = sObjectMgr.GetTaxiMountDisplayId(sourcenode, GetPlayer()->GetTeam());
uint32 path, cost;
objmgr.GetTaxiPath( sourcenode, destinationnode, path, cost);
sObjectMgr.GetTaxiPath( sourcenode, destinationnode, path, cost);
if(path && mountDisplayId)
SendDoFlight( mountDisplayId, path, 1 ); // skip start fly node

View file

@ -59,8 +59,8 @@ void Totem::Summon(Unit* owner)
CreatureInfo const *cinfo = GetCreatureInfo();
if(owner->GetTypeId() == TYPEID_PLAYER && cinfo)
{
uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(), cinfo);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
uint32 display_id = sObjectMgr.ChooseDisplayId(((Player*)owner)->GetTeam(), cinfo);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
SetDisplayId(display_id);

View file

@ -57,7 +57,7 @@ void MapManager::LoadTransports()
std::string name = fields[1].GetCppString();
t->m_period = fields[2].GetUInt32();
const GameObjectInfo *goinfo = objmgr.GetGameObjectInfo(entry);
const GameObjectInfo *goinfo = ObjectMgr::GetGameObjectInfo(entry);
if(!goinfo)
{
@ -102,7 +102,7 @@ void MapManager::LoadTransports()
m_TransportsByMap[*i].insert(t);
//If we someday decide to use the grid to track transports, here:
t->SetMap(MapManager::Instance().CreateMap(mapid, t));
t->SetMap(sMapMgr.CreateMap(mapid, t));
//t->GetMap()->Add<GameObject>((GameObject *)t);
++count;
@ -150,7 +150,7 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z,
Object::_Create(guidlow, 0, HIGHGUID_MO_TRANSPORT);
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(guidlow);
GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(guidlow);
if (!goinfo)
{
@ -205,7 +205,7 @@ struct keyFrame
bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
{
TransportPath path;
objmgr.GetTransportPathNodes(pathid, path);
sObjectMgr.GetTransportPathNodes(pathid, path);
if (path.Empty())
return false;
@ -459,7 +459,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
//we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference...
//player far teleport would try to create same instance, but we need it NOW for transport...
//correct me if I'm wrong O.o
Map * newMap = MapManager::Instance().CreateMap(newMapid, this);
Map * newMap = sMapMgr.CreateMap(newMapid, this);
SetMap(newMap);
if(oldMap != newMap)

View file

@ -464,7 +464,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
// some critters required for quests (need normal entry instead possible heroic in any cases)
if(GetTypeId() == TYPEID_PLAYER)
if(CreatureInfo const* normalInfo = objmgr.GetCreatureTemplate(pVictim->GetEntry()))
if(CreatureInfo const* normalInfo = ObjectMgr::GetCreatureTemplate(pVictim->GetEntry()))
((Player*)this)->KilledMonster(normalInfo,pVictim->GetGUID());
return damage;
@ -691,7 +691,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
// the reset time is set but not added to the scheduler
// until the players leave the instance
time_t resettime = cVictim->GetRespawnTimeEx() + 2 * HOUR;
if(InstanceSave *save = sInstanceSaveManager.GetInstanceSave(cVictim->GetInstanceId()))
if(InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(cVictim->GetInstanceId()))
if(save->GetResetTime() < resettime) save->SetResetTime(resettime);
}
}
@ -3617,7 +3617,7 @@ void Unit::RemoveRankAurasDueToSpell(uint32 spellId)
uint32 i_spellId = (*i).second->GetId();
if((*i).second && i_spellId && i_spellId != spellId)
{
if(spellmgr.IsRankSpellDueToSpell(spellInfo,i_spellId))
if(sSpellMgr.IsRankSpellDueToSpell(spellInfo,i_spellId))
{
RemoveAurasDueToSpell(i_spellId);
@ -3673,7 +3673,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
continue;
// passive non-stackable spells not stackable only with another rank of same spell
if (!spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId))
if (!sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId))
continue;
}
@ -3703,7 +3703,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
if( is_spellSpecPerTarget || is_spellSpecPerTargetPerCaster && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() )
{
// cannot remove higher rank
if (spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId))
if (sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId))
if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
return false;
@ -3726,7 +3726,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
// spell with spell specific that allow single ranks for spell from diff caster
// same caster case processed or early or later
bool is_spellPerTarget = IsSingleFromSpellSpecificSpellRanksPerTarget(spellId_spec,i_spellId_spec);
if ( is_spellPerTarget && Aur->GetCasterGUID() != (*i).second->GetCasterGUID() && spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId))
if ( is_spellPerTarget && Aur->GetCasterGUID() != (*i).second->GetCasterGUID() && sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId))
{
// cannot remove higher rank
if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
@ -3749,7 +3749,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
}
// non single (per caster) per target spell specific (possible single spell per target at caster)
if( !is_spellSpecPerTargetPerCaster && !is_spellSpecPerTarget && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
if( !is_spellSpecPerTargetPerCaster && !is_spellSpecPerTarget && sSpellMgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
{
// Its a parent aura (create this aura in ApplyModifier)
if ((*i).second->IsInUse())
@ -7175,7 +7175,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
{
// have rank dependent proc chance, ignore too often cases
// PPM = 2.5 * (rank of talent),
uint32 rank = spellmgr.GetSpellRank(auraSpellInfo->Id);
uint32 rank = sSpellMgr.GetSpellRank(auraSpellInfo->Id);
// 5 rank -> 100% 4 rank -> 80% and etc from full rate
if(!roll_chance_i(20*rank))
return false;
@ -8463,7 +8463,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
SpellModSpellDamage /= 100.0f;
// Check for table values
if (SpellBonusEntry const* bonus = spellmgr.GetSpellBonusData(spellProto->Id))
if (SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spellProto->Id))
{
float coeff;
if (damagetype == DOT)
@ -8911,7 +8911,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
SpellModSpellDamage /= 100.0f;
// Check for table values
SpellBonusEntry const* bonus = spellmgr.GetSpellBonusData(spellProto->Id);
SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spellProto->Id);
if (bonus)
{
float coeff;
@ -9377,7 +9377,7 @@ uint32 Unit::MeleeDamageBonus(Unit *pVictim, uint32 pdamage,WeaponAttackType att
float LvlPenalty = CalculateLevelPenalty(spellProto);
// Check for table values
if (SpellBonusEntry const* bonus = spellmgr.GetSpellBonusData(spellProto->Id))
if (SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spellProto->Id))
{
float coeff;
if (damagetype == DOT)
@ -11219,14 +11219,14 @@ void CharmInfo::InitCharmCreateSpells()
bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate)
{
uint32 first_id = spellmgr.GetFirstSpellInChain(spell_id);
uint32 first_id = sSpellMgr.GetFirstSpellInChain(spell_id);
// new spell rank can be already listed
for(uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
{
if (uint32 action = PetActionBar[i].GetAction())
{
if (PetActionBar[i].IsActionBarForSpell() && spellmgr.GetFirstSpellInChain(action) == first_id)
if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr.GetFirstSpellInChain(action) == first_id)
{
PetActionBar[i].SetAction(spell_id);
return true;
@ -11248,13 +11248,13 @@ bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate)
bool CharmInfo::RemoveSpellFromActionBar(uint32 spell_id)
{
uint32 first_id = spellmgr.GetFirstSpellInChain(spell_id);
uint32 first_id = sSpellMgr.GetFirstSpellInChain(spell_id);
for(uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
{
if (uint32 action = PetActionBar[i].GetAction())
{
if (PetActionBar[i].IsActionBarForSpell() && spellmgr.GetFirstSpellInChain(action) == first_id)
if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr.GetFirstSpellInChain(action) == first_id)
{
SetActionBar(i,0,ACT_DISABLED);
return true;
@ -11981,7 +11981,7 @@ void Unit::ClearComboPointHolders()
{
uint32 lowguid = *m_ComboPointHolders.begin();
Player* plr = objmgr.GetPlayer(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER));
Player* plr = sObjectMgr.GetPlayer(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER));
if(plr && plr->GetComboTarget()==GetGUID()) // recheck for safe
plr->ClearComboPoints(); // remove also guid from m_ComboPointHolders;
else
@ -12341,7 +12341,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
return NULL;
}
pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true);
pet->GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true);
// this enables pet details window (Shift+P)
pet->AIM_Initialize();
pet->InitPetCreateSpells();
@ -12357,7 +12357,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con
SpellEntry const* spellProto = aura->GetSpellProto ();
// Get proc Event Entry
spellProcEvent = spellmgr.GetSpellProcEvent(spellProto->Id);
spellProcEvent = sSpellMgr.GetSpellProcEvent(spellProto->Id);
// Aura info stored here
Modifier *mod = aura->GetModifier();

View file

@ -26,7 +26,7 @@
#include "UpdateFields.h"
#include "SharedDefines.h"
#include "ThreatManager.h"
#include "HostilRefManager.h"
#include "HostileRefManager.h"
#include "FollowerReference.h"
#include "FollowerRefManager.h"
#include "Utilities/EventProcessor.h"

View file

@ -331,7 +331,7 @@ void WaypointManager::CheckTextsExistance(std::set<int32>& ids)
}
else
{
if (!objmgr.GetMangosStringLocale(be->textid[j]))
if (!sObjectMgr.GetMangosStringLocale(be->textid[j]))
{
sLog.outErrorDb("Some waypoint has textid%u with not existing %u text.", j, be->textid[j]);
be->textid[j] = 0;

View file

@ -87,6 +87,6 @@ class WaypointManager
WaypointPathMap m_pathMap;
};
#define WaypointMgr MaNGOS::Singleton<WaypointManager>::Instance()
#define sWaypointMgr MaNGOS::Singleton<WaypointManager>::Instance()
#endif

View file

@ -47,7 +47,7 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature &c)
{
sLog.outDetail("LoadPath: loading waypoint path for creature %d,%d", c.GetGUIDLow(), c.GetDBTableGUIDLow());
i_path = WaypointMgr.GetPath(c.GetDBTableGUIDLow());
i_path = sWaypointMgr.GetPath(c.GetDBTableGUIDLow());
if(!i_path)
{
sLog.outErrorDb("WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %d) doesn't have waypoint path",
@ -213,7 +213,7 @@ void WaypointMovementGenerator<Creature>::MovementInform(Creature &unit)
//----------------------------------------------------//
void FlightPathMovementGenerator::LoadPath(Player &)
{
objmgr.GetTaxiPathNodes(i_pathId, i_path,i_mapIds);
sObjectMgr.GetTaxiPathNodes(i_pathId, i_path,i_mapIds);
}
uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const

View file

@ -54,7 +54,7 @@
#include "VMapFactory.h"
#include "GlobalEvents.h"
#include "GameEventMgr.h"
#include "PoolHandler.h"
#include "PoolManager.h"
#include "Database/DatabaseImpl.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
@ -242,7 +242,7 @@ World::AddSession_ (WorldSession* s)
s->SendAddonsInfo();
WorldPacket pkt(SMSG_CLIENTCACHE_VERSION, 4);
pkt << uint32(sWorld.getConfig(CONFIG_CLIENTCACHE_VERSION));
pkt << uint32(getConfig(CONFIG_CLIENTCACHE_VERSION));
s->SendPacket(&pkt);
s->SendAccountDataTimes(GLOBAL_CACHE_MASK);
@ -329,7 +329,7 @@ bool World::RemoveQueuedPlayer(WorldSession* sess)
pop_sess->SendAddonsInfo();
WorldPacket pkt(SMSG_CLIENTCACHE_VERSION, 4);
pkt << uint32(sWorld.getConfig(CONFIG_CLIENTCACHE_VERSION));
pkt << uint32(getConfig(CONFIG_CLIENTCACHE_VERSION));
pop_sess->SendPacket(&pkt);
pop_sess->SendAccountDataTimes(GLOBAL_CACHE_MASK);
@ -377,7 +377,7 @@ void World::RemoveWeather(uint32 id)
/// Add a Weather object to the list
Weather* World::AddWeather(uint32 zone_id)
{
WeatherZoneChances const* weatherChances = objmgr.GetWeatherChances(zone_id);
WeatherZoneChances const* weatherChances = sObjectMgr.GetWeatherChances(zone_id);
// zone not have weather, ignore
if(!weatherChances)
@ -569,7 +569,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY;
}
if(reload)
MapManager::Instance().SetGridCleanUpDelay(m_configs[CONFIG_INTERVAL_GRIDCLEAN]);
sMapMgr.SetGridCleanUpDelay(m_configs[CONFIG_INTERVAL_GRIDCLEAN]);
m_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig.GetIntDefault("MapUpdateInterval", 100);
if(m_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY)
@ -578,7 +578,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY;
}
if(reload)
MapManager::Instance().SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]);
sMapMgr.SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]);
m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILISECONDS);
@ -1016,10 +1016,10 @@ void World::LoadConfigSettings(bool reload)
//visibility on continents
m_MaxVisibleDistanceOnContinents = sConfig.GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE);
if(m_MaxVisibleDistanceOnContinents < 45*sWorld.getRate(RATE_CREATURE_AGGRO))
if(m_MaxVisibleDistanceOnContinents < 45*getRate(RATE_CREATURE_AGGRO))
{
sLog.outError("Visibility.Distance.Continents can't be less max aggro radius %f", 45*sWorld.getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceOnContinents = 45*sWorld.getRate(RATE_CREATURE_AGGRO);
sLog.outError("Visibility.Distance.Continents can't be less max aggro radius %f", 45*getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceOnContinents = 45*getRate(RATE_CREATURE_AGGRO);
}
else if(m_MaxVisibleDistanceOnContinents + m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE)
{
@ -1029,10 +1029,10 @@ void World::LoadConfigSettings(bool reload)
//visibility in instances
m_MaxVisibleDistanceInInctances = sConfig.GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE);
if(m_MaxVisibleDistanceInInctances < 45*sWorld.getRate(RATE_CREATURE_AGGRO))
if(m_MaxVisibleDistanceInInctances < 45*getRate(RATE_CREATURE_AGGRO))
{
sLog.outError("Visibility.Distance.Instances can't be less max aggro radius %f",45*sWorld.getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceInInctances = 45*sWorld.getRate(RATE_CREATURE_AGGRO);
sLog.outError("Visibility.Distance.Instances can't be less max aggro radius %f",45*getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceInInctances = 45*getRate(RATE_CREATURE_AGGRO);
}
else if(m_MaxVisibleDistanceInInctances + m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE)
{
@ -1042,10 +1042,10 @@ void World::LoadConfigSettings(bool reload)
//visibility in BG/Arenas
m_MaxVisibleDistanceInBGArenas = sConfig.GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS);
if(m_MaxVisibleDistanceInBGArenas < 45*sWorld.getRate(RATE_CREATURE_AGGRO))
if(m_MaxVisibleDistanceInBGArenas < 45*getRate(RATE_CREATURE_AGGRO))
{
sLog.outError("Visibility.Distance.BGArenas can't be less max aggro radius %f",45*sWorld.getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceInBGArenas = 45*sWorld.getRate(RATE_CREATURE_AGGRO);
sLog.outError("Visibility.Distance.BGArenas can't be less max aggro radius %f",45*getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceInBGArenas = 45*getRate(RATE_CREATURE_AGGRO);
}
else if(m_MaxVisibleDistanceInBGArenas + m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE)
{
@ -1113,7 +1113,7 @@ void World::SetInitialWorldSettings()
LoadConfigSettings();
///- Init highest guids before any table loading to prevent using not initialized guids in some code.
objmgr.SetHighestGuids();
sObjectMgr.SetHighestGuids();
///- Check the existence of the map files for all races' startup areas.
if( !MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f)
@ -1133,7 +1133,7 @@ void World::SetInitialWorldSettings()
///- Loading strings. Getting no records means core load has to be canceled because no error message can be output.
sLog.outString();
sLog.outString("Loading MaNGOS strings...");
if (!objmgr.LoadMangosStrings())
if (!sObjectMgr.LoadMangosStrings())
exit(1); // Error message displayed in function already
///- Update the realm entry in the database with the realm type from the config file
@ -1153,193 +1153,193 @@ void World::SetInitialWorldSettings()
DetectDBCLang();
sLog.outString( "Loading Script Names...");
objmgr.LoadScriptNames();
sObjectMgr.LoadScriptNames();
sLog.outString( "Loading InstanceTemplate..." );
objmgr.LoadInstanceTemplate();
sObjectMgr.LoadInstanceTemplate();
sLog.outString( "Loading SkillLineAbilityMultiMap Data..." );
spellmgr.LoadSkillLineAbilityMap();
sSpellMgr.LoadSkillLineAbilityMap();
///- Clean up and pack instances
sLog.outString( "Cleaning up instances..." );
sInstanceSaveManager.CleanupInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables
sInstanceSaveMgr.CleanupInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables
sLog.outString( "Packing instances..." );
sInstanceSaveManager.PackInstances();
sInstanceSaveMgr.PackInstances();
sLog.outString();
sLog.outString( "Loading Localization strings..." );
objmgr.LoadCreatureLocales();
objmgr.LoadGameObjectLocales();
objmgr.LoadItemLocales();
objmgr.LoadQuestLocales();
objmgr.LoadNpcTextLocales();
objmgr.LoadPageTextLocales();
objmgr.LoadNpcOptionLocales();
objmgr.LoadPointOfInterestLocales();
objmgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
sObjectMgr.LoadCreatureLocales();
sObjectMgr.LoadGameObjectLocales();
sObjectMgr.LoadItemLocales();
sObjectMgr.LoadQuestLocales();
sObjectMgr.LoadNpcTextLocales();
sObjectMgr.LoadPageTextLocales();
sObjectMgr.LoadNpcOptionLocales();
sObjectMgr.LoadPointOfInterestLocales();
sObjectMgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
sLog.outString( ">>> Localization strings loaded" );
sLog.outString();
sLog.outString( "Loading Page Texts..." );
objmgr.LoadPageTexts();
sObjectMgr.LoadPageTexts();
sLog.outString( "Loading Game Object Templates..." ); // must be after LoadPageTexts
objmgr.LoadGameobjectInfo();
sObjectMgr.LoadGameobjectInfo();
sLog.outString( "Loading Spell Chain Data..." );
spellmgr.LoadSpellChains();
sSpellMgr.LoadSpellChains();
sLog.outString( "Loading Spell Elixir types..." );
spellmgr.LoadSpellElixirs();
sSpellMgr.LoadSpellElixirs();
sLog.outString( "Loading Spell Learn Skills..." );
spellmgr.LoadSpellLearnSkills(); // must be after LoadSpellChains
sSpellMgr.LoadSpellLearnSkills(); // must be after LoadSpellChains
sLog.outString( "Loading Spell Learn Spells..." );
spellmgr.LoadSpellLearnSpells();
sSpellMgr.LoadSpellLearnSpells();
sLog.outString( "Loading Spell Proc Event conditions..." );
spellmgr.LoadSpellProcEvents();
sSpellMgr.LoadSpellProcEvents();
sLog.outString( "Loading Spell Bonus Data..." );
spellmgr.LoadSpellBonusess();
sSpellMgr.LoadSpellBonusess();
sLog.outString( "Loading Spell Proc Item Enchant..." );
spellmgr.LoadSpellProcItemEnchant(); // must be after LoadSpellChains
sSpellMgr.LoadSpellProcItemEnchant(); // must be after LoadSpellChains
sLog.outString( "Loading Aggro Spells Definitions...");
spellmgr.LoadSpellThreats();
sSpellMgr.LoadSpellThreats();
sLog.outString( "Loading NPC Texts..." );
objmgr.LoadGossipText();
sObjectMgr.LoadGossipText();
sLog.outString( "Loading Item Random Enchantments Table..." );
LoadRandomEnchantmentsTable();
sLog.outString( "Loading Items..." ); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
objmgr.LoadItemPrototypes();
sObjectMgr.LoadItemPrototypes();
sLog.outString( "Loading Item Texts..." );
objmgr.LoadItemTexts();
sObjectMgr.LoadItemTexts();
sLog.outString( "Loading Creature Model Based Info Data..." );
objmgr.LoadCreatureModelInfo();
sObjectMgr.LoadCreatureModelInfo();
sLog.outString( "Loading Equipment templates...");
objmgr.LoadEquipmentTemplates();
sObjectMgr.LoadEquipmentTemplates();
sLog.outString( "Loading Creature templates..." );
objmgr.LoadCreatureTemplates();
sObjectMgr.LoadCreatureTemplates();
sLog.outString( "Loading SpellsScriptTarget...");
spellmgr.LoadSpellScriptTarget(); // must be after LoadCreatureTemplates and LoadGameobjectInfo
sSpellMgr.LoadSpellScriptTarget(); // must be after LoadCreatureTemplates and LoadGameobjectInfo
sLog.outString( "Loading ItemRequiredTarget...");
objmgr.LoadItemRequiredTarget();
sObjectMgr.LoadItemRequiredTarget();
sLog.outString( "Loading Creature Reputation OnKill Data..." );
objmgr.LoadReputationOnKill();
sObjectMgr.LoadReputationOnKill();
sLog.outString( "Loading Points Of Interest Data..." );
objmgr.LoadPointsOfInterest();
sObjectMgr.LoadPointsOfInterest();
sLog.outString( "Loading Creature Data..." );
objmgr.LoadCreatures();
sObjectMgr.LoadCreatures();
sLog.outString( "Loading pet levelup spells..." );
spellmgr.LoadPetLevelupSpellMap();
sSpellMgr.LoadPetLevelupSpellMap();
sLog.outString( "Loading pet default spell additional to levelup spells..." );
spellmgr.LoadPetDefaultSpells();
sSpellMgr.LoadPetDefaultSpells();
sLog.outString( "Loading Creature Addon Data..." );
sLog.outString();
objmgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
sObjectMgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
sLog.outString( ">>> Creature Addon Data loaded" );
sLog.outString();
sLog.outString( "Loading Creature Respawn Data..." ); // must be after PackInstances()
objmgr.LoadCreatureRespawnTimes();
sObjectMgr.LoadCreatureRespawnTimes();
sLog.outString( "Loading Gameobject Data..." );
objmgr.LoadGameobjects();
sObjectMgr.LoadGameobjects();
sLog.outString( "Loading Gameobject Respawn Data..." ); // must be after PackInstances()
objmgr.LoadGameobjectRespawnTimes();
sObjectMgr.LoadGameobjectRespawnTimes();
sLog.outString( "Loading Objects Pooling Data...");
poolhandler.LoadFromDB();
sPoolMgr.LoadFromDB();
sLog.outString( "Loading Game Event Data...");
sLog.outString();
gameeventmgr.LoadFromDB();
sGameEventMgr.LoadFromDB();
sLog.outString( ">>> Game Event Data loaded" );
sLog.outString();
sLog.outString( "Loading Weather Data..." );
objmgr.LoadWeatherZoneChances();
sObjectMgr.LoadWeatherZoneChances();
sLog.outString( "Loading Quests..." );
objmgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
sObjectMgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
sLog.outString( "Loading Quests Relations..." );
sLog.outString();
objmgr.LoadQuestRelations(); // must be after quest load
sObjectMgr.LoadQuestRelations(); // must be after quest load
sLog.outString( ">>> Quests Relations loaded" );
sLog.outString();
sLog.outString( "Loading UNIT_NPC_FLAG_SPELLCLICK Data..." );
objmgr.LoadNPCSpellClickSpells();
sObjectMgr.LoadNPCSpellClickSpells();
sLog.outString( "Loading SpellArea Data..." ); // must be after quest load
spellmgr.LoadSpellAreas();
sSpellMgr.LoadSpellAreas();
sLog.outString( "Loading AreaTrigger definitions..." );
objmgr.LoadAreaTriggerTeleports(); // must be after item template load
sObjectMgr.LoadAreaTriggerTeleports(); // must be after item template load
sLog.outString( "Loading Quest Area Triggers..." );
objmgr.LoadQuestAreaTriggers(); // must be after LoadQuests
sObjectMgr.LoadQuestAreaTriggers(); // must be after LoadQuests
sLog.outString( "Loading Tavern Area Triggers..." );
objmgr.LoadTavernAreaTriggers();
sObjectMgr.LoadTavernAreaTriggers();
sLog.outString( "Loading AreaTrigger script names..." );
objmgr.LoadAreaTriggerScripts();
sObjectMgr.LoadAreaTriggerScripts();
sLog.outString( "Loading Graveyard-zone links...");
objmgr.LoadGraveyardZones();
sObjectMgr.LoadGraveyardZones();
sLog.outString( "Loading Spell target coordinates..." );
spellmgr.LoadSpellTargetPositions();
sSpellMgr.LoadSpellTargetPositions();
sLog.outString( "Loading spell pet auras..." );
spellmgr.LoadSpellPetAuras();
sSpellMgr.LoadSpellPetAuras();
sLog.outString( "Loading Player Create Info & Level Stats..." );
sLog.outString();
objmgr.LoadPlayerInfo();
sObjectMgr.LoadPlayerInfo();
sLog.outString( ">>> Player Create Info & Level Stats loaded" );
sLog.outString();
sLog.outString( "Loading Exploration BaseXP Data..." );
objmgr.LoadExplorationBaseXP();
sObjectMgr.LoadExplorationBaseXP();
sLog.outString( "Loading Pet Name Parts..." );
objmgr.LoadPetNames();
sObjectMgr.LoadPetNames();
sLog.outString( "Loading the max pet number..." );
objmgr.LoadPetNumber();
sObjectMgr.LoadPetNumber();
sLog.outString( "Loading pet level stats..." );
objmgr.LoadPetLevelInfo();
sObjectMgr.LoadPetLevelInfo();
sLog.outString( "Loading Player Corpses..." );
objmgr.LoadCorpses();
sObjectMgr.LoadCorpses();
sLog.outString( "Loading Player level dependent mail rewards..." );
objmgr.LoadMailLevelRewards();
sObjectMgr.LoadMailLevelRewards();
sLog.outString( "Loading Loot Tables..." );
sLog.outString();
@ -1354,41 +1354,41 @@ void World::SetInitialWorldSettings()
LoadSkillExtraItemTable();
sLog.outString( "Loading Skill Fishing base level requirements..." );
objmgr.LoadFishingBaseSkillLevel();
sObjectMgr.LoadFishingBaseSkillLevel();
sLog.outString( "Loading Achievements..." );
sLog.outString();
achievementmgr.LoadAchievementReferenceList();
achievementmgr.LoadAchievementCriteriaList();
achievementmgr.LoadAchievementCriteriaRequirements();
achievementmgr.LoadRewards();
achievementmgr.LoadRewardLocales();
achievementmgr.LoadCompletedAchievements();
sAchievementMgr.LoadAchievementReferenceList();
sAchievementMgr.LoadAchievementCriteriaList();
sAchievementMgr.LoadAchievementCriteriaRequirements();
sAchievementMgr.LoadRewards();
sAchievementMgr.LoadRewardLocales();
sAchievementMgr.LoadCompletedAchievements();
sLog.outString( ">>> Achievements loaded" );
sLog.outString();
///- Load dynamic data tables from the database
sLog.outString( "Loading Auctions..." );
sLog.outString();
auctionmgr.LoadAuctionItems();
auctionmgr.LoadAuctions();
sAuctionMgr.LoadAuctionItems();
sAuctionMgr.LoadAuctions();
sLog.outString( ">>> Auctions loaded" );
sLog.outString();
sLog.outString( "Loading Guilds..." );
objmgr.LoadGuilds();
sObjectMgr.LoadGuilds();
sLog.outString( "Loading ArenaTeams..." );
objmgr.LoadArenaTeams();
sObjectMgr.LoadArenaTeams();
sLog.outString( "Loading Groups..." );
objmgr.LoadGroups();
sObjectMgr.LoadGroups();
sLog.outString( "Loading ReservedNames..." );
objmgr.LoadReservedPlayersNames();
sObjectMgr.LoadReservedPlayersNames();
sLog.outString( "Loading GameObjects for quests..." );
objmgr.LoadGameObjectForQuests();
sObjectMgr.LoadGameObjectForQuests();
sLog.outString( "Loading BattleMasters..." );
sBattleGroundMgr.LoadBattleMastersEntry();
@ -1397,53 +1397,53 @@ void World::SetInitialWorldSettings()
sBattleGroundMgr.LoadBattleEventIndexes();
sLog.outString( "Loading GameTeleports..." );
objmgr.LoadGameTele();
sObjectMgr.LoadGameTele();
sLog.outString( "Loading Npc Text Id..." );
objmgr.LoadNpcTextId(); // must be after load Creature and NpcText
sObjectMgr.LoadNpcTextId(); // must be after load Creature and NpcText
sLog.outString( "Loading Npc Options..." );
objmgr.LoadNpcOptions();
sObjectMgr.LoadNpcOptions();
sLog.outString( "Loading Vendors..." );
objmgr.LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
sObjectMgr.LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
sLog.outString( "Loading Trainers..." );
objmgr.LoadTrainerSpell(); // must be after load CreatureTemplate
sObjectMgr.LoadTrainerSpell(); // must be after load CreatureTemplate
sLog.outString( "Loading Waypoints..." );
sLog.outString();
WaypointMgr.Load();
sWaypointMgr.Load();
sLog.outString( "Loading GM tickets...");
ticketmgr.LoadGMTickets();
sTicketMgr.LoadGMTickets();
///- Handle outdated emails (delete/return)
sLog.outString( "Returning old mails..." );
objmgr.ReturnOrDeleteOldMails(false);
sObjectMgr.ReturnOrDeleteOldMails(false);
///- Load and initialize scripts
sLog.outString( "Loading Scripts..." );
sLog.outString();
objmgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
objmgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
objmgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
sObjectMgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
sObjectMgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
sLog.outString( ">>> Scripts loaded" );
sLog.outString();
sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls
objmgr.LoadDbScriptStrings();
sObjectMgr.LoadDbScriptStrings();
sLog.outString( "Loading CreatureEventAI Texts...");
CreatureEAI_Mgr.LoadCreatureEventAI_Texts(false); // false, will checked in LoadCreatureEventAI_Scripts
sEventAIMgr.LoadCreatureEventAI_Texts(false); // false, will checked in LoadCreatureEventAI_Scripts
sLog.outString( "Loading CreatureEventAI Summons...");
CreatureEAI_Mgr.LoadCreatureEventAI_Summons(false); // false, will checked in LoadCreatureEventAI_Scripts
sEventAIMgr.LoadCreatureEventAI_Summons(false); // false, will checked in LoadCreatureEventAI_Scripts
sLog.outString( "Loading CreatureEventAI Scripts...");
CreatureEAI_Mgr.LoadCreatureEventAI_Scripts();
sEventAIMgr.LoadCreatureEventAI_Scripts();
sLog.outString( "Initializing Scripts..." );
if(!LoadScriptingModule())
@ -1489,7 +1489,7 @@ void World::SetInitialWorldSettings()
///- Initialize MapManager
sLog.outString( "Starting Map System" );
MapManager::Instance().Initialize();
sMapMgr.Initialize();
///- Initialize Battlegrounds
sLog.outString( "Starting BattleGround System" );
@ -1498,7 +1498,7 @@ void World::SetInitialWorldSettings()
//Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager
sLog.outString( "Loading Transports..." );
MapManager::Instance().LoadTransports();
sMapMgr.LoadTransports();
sLog.outString("Deleting expired bans..." );
loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
@ -1507,10 +1507,10 @@ void World::SetInitialWorldSettings()
InitDailyQuestResetTime();
sLog.outString("Starting objects Pooling system..." );
poolhandler.Initialize();
sPoolMgr.Initialize();
sLog.outString("Starting Game Event system..." );
uint32 nextGameEvent = gameeventmgr.Initialize();
uint32 nextGameEvent = sGameEventMgr.Initialize();
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
sLog.outString( "WORLD: World initialized" );
@ -1592,11 +1592,11 @@ void World::Update(uint32 diff)
if (++mail_timer > mail_timer_expires)
{
mail_timer = 0;
objmgr.ReturnOrDeleteOldMails(true);
sObjectMgr.ReturnOrDeleteOldMails(true);
}
///- Handle expired auctions
auctionmgr.Update();
sAuctionMgr.Update();
}
/// <li> Handle session updates when the timer has passed
@ -1643,7 +1643,7 @@ void World::Update(uint32 diff)
{
m_timers[WUPDATE_OBJECTS].Reset();
///- Update objects when the timer has passed (maps, transport, creatures,...)
MapManager::Instance().Update(diff); // As interval = 0
sMapMgr.Update(diff); // As interval = 0
sBattleGroundMgr.Update(diff);
}
@ -1663,17 +1663,17 @@ void World::Update(uint32 diff)
if (m_timers[WUPDATE_EVENTS].Passed())
{
m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
uint32 nextGameEvent = gameeventmgr.Update();
uint32 nextGameEvent = sGameEventMgr.Update();
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
m_timers[WUPDATE_EVENTS].Reset();
}
/// </ul>
///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove"
MapManager::Instance().DoDelayedMovesAndRemoves();
sMapMgr.DoDelayedMovesAndRemoves();
// update the instance reset times
sInstanceSaveManager.Update();
sInstanceSaveMgr.Update();
// And last, but not least handle the issued cli commands
ProcessCliCommands();
@ -1705,7 +1705,7 @@ namespace MaNGOS
explicit WorldWorldTextBuilder(int32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) {}
void operator()(WorldPacketList& data_list, int32 loc_idx)
{
char const* text = objmgr.GetMangosString(i_textId,loc_idx);
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
if(i_args)
{
@ -1911,7 +1911,7 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP)
if (mode == BAN_ACCOUNT)
account = accmgr.GetId (nameOrIP);
else if (mode == BAN_CHARACTER)
account = objmgr.GetPlayerAccountIdByPlayerName (nameOrIP);
account = sObjectMgr.GetPlayerAccountIdByPlayerName (nameOrIP);
if (!account)
return false;

View file

@ -1,49 +0,0 @@
/*
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/** \file
\ingroup u2w
*/
#include "WorldLog.h"
#include "Policies/SingletonImp.h"
#include "Config/ConfigEnv.h"
#define CLASS_LOCK MaNGOS::ClassLevelLockable<WorldLog, ACE_Thread_Mutex>
INSTANTIATE_SINGLETON_2(WorldLog, CLASS_LOCK);
INSTANTIATE_CLASS_MUTEX(WorldLog, ACE_Thread_Mutex);
/// Open the log file (if specified so in the configuration file)
void WorldLog::Initialize()
{
std::string logsDir = sConfig.GetStringDefault("LogsDir","");
if(!logsDir.empty())
{
if((logsDir.at(logsDir.length()-1)!='/') && (logsDir.at(logsDir.length()-1)!='\\'))
logsDir.append("/");
}
std::string logname = sConfig.GetStringDefault("WorldLogFile", "");
if(!logname.empty())
{
i_file = fopen((logsDir+logname).c_str(), "w");
}
}
#define sWorldLog WorldLog::Instance()

View file

@ -1,76 +0,0 @@
/*
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/// \addtogroup u2w
/// @{
/// \file
#ifndef MANGOS_WORLDLOG_H
#define MANGOS_WORLDLOG_H
#include "Common.h"
#include "Policies/Singleton.h"
#include "Errors.h"
#include <stdarg.h>
/// %Log packets to a file
class MANGOS_DLL_DECL WorldLog : public MaNGOS::Singleton<WorldLog, MaNGOS::ClassLevelLockable<WorldLog, ACE_Thread_Mutex> >
{
friend class MaNGOS::OperatorNew<WorldLog>;
WorldLog() : i_file(NULL) { Initialize(); }
WorldLog(const WorldLog &);
WorldLog& operator=(const WorldLog &);
typedef MaNGOS::ClassLevelLockable<WorldLog, ACE_Thread_Mutex>::Lock Guard;
/// Close the file in destructor
~WorldLog()
{
if( i_file != NULL )
fclose(i_file);
i_file = NULL;
}
public:
void Initialize();
/// Is the world logger active?
bool LogWorld(void) const { return (i_file != NULL); }
/// %Log to the file
void Log(char const *fmt, ...)
{
if( LogWorld() )
{
Guard guard(*this);
ASSERT(i_file);
va_list args;
va_start(args, fmt);
vfprintf(i_file, fmt, args);
va_end(args);
fflush(i_file);
}
}
private:
FILE *i_file;
};
#define sWorldLog WorldLog::Instance()
#endif
/// @}

View file

@ -41,7 +41,7 @@
WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale) :
LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time),
_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion),
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(objmgr.GetIndexForLocale(locale)),
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(sObjectMgr.GetIndexForLocale(locale)),
_logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false),
m_latency(0), m_TutorialsChanged(false)
{
@ -378,7 +378,7 @@ void WorldSession::LogoutPlayer(bool Save)
loginDatabase.PExecute("UPDATE account SET active_realm_id = 0 WHERE id = '%u'", GetAccountId());
///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members
Guild *guild = objmgr.GetGuildById(_player->GetGuildId());
Guild *guild = sObjectMgr.GetGuildById(_player->GetGuildId());
if(guild)
{
guild->SetMemberStats(_player->GetGUID());
@ -523,7 +523,7 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift)
const char * WorldSession::GetMangosString( int32 entry ) const
{
return objmgr.GetMangosString(entry,GetSessionDbLocaleIndex());
return sObjectMgr.GetMangosString(entry,GetSessionDbLocaleIndex());
}
void WorldSession::Handle_NULL( WorldPacket& recvPacket )

View file

@ -42,7 +42,6 @@
#include "WorldSession.h"
#include "WorldSocketMgr.h"
#include "Log.h"
#include "WorldLog.h"
#if defined( __GNUC__ )
#pragma pack(1)
@ -166,25 +165,7 @@ int WorldSocket::SendPacket (const WorldPacket& pct)
return -1;
// Dump outgoing packet.
if (sWorldLog.LogWorld ())
{
sWorldLog.Log ("SERVER:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n",
(uint32) get_handle (),
pct.size (),
LookupOpcodeName (pct.GetOpcode ()),
pct.GetOpcode ());
uint32 p = 0;
while (p < pct.size ())
{
for (uint32 j = 0; j < 16 && p < pct.size (); j++)
sWorldLog.Log ("%.2X ", const_cast<WorldPacket&>(pct)[p++]);
sWorldLog.Log ("\n");
}
sWorldLog.Log ("\n\n");
}
sLog.outWorldPacketDump(uint32(get_handle()), pct.GetOpcode(), LookupOpcodeName(pct.GetOpcode()), &pct, false);
ServerPktHeader header(pct.size()+2, pct.GetOpcode());
m_Crypt.EncryptSend ((uint8*)header.header, header.getHeaderLength());
@ -682,25 +663,10 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
return -1;
// Dump received packet.
if (sWorldLog.LogWorld ())
sLog.outWorldPacketDump(uint32(get_handle()), new_pct->GetOpcode(), LookupOpcodeName(new_pct->GetOpcode()), new_pct, true);
try
{
sWorldLog.Log ("CLIENT:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n",
(uint32) get_handle (),
new_pct->size (),
LookupOpcodeName (new_pct->GetOpcode ()),
new_pct->GetOpcode ());
uint32 p = 0;
while (p < new_pct->size ())
{
for (uint32 j = 0; j < 16 && p < new_pct->size (); j++)
sWorldLog.Log ("%.2X ", (*new_pct)[p++]);
sWorldLog.Log ("\n");
}
sWorldLog.Log ("\n\n");
}
try {
switch(opcode)
{
case CMSG_PING:
@ -738,13 +704,13 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
}
}
}
catch(ByteBufferException &)
catch (ByteBufferException &)
{
sLog.outError("WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.",
opcode, GetRemoteAddress().c_str(), m_Session?m_Session->GetAccountId():-1);
if(sLog.IsOutDebug())
{
sLog.outDebug("Dumping error causing packet:");
sLog.outDebug("Dumping error-causing packet:");
new_pct->hexlike();
}

View file

@ -614,7 +614,7 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
uint32 entry = (uint32)atoi(e);
uint32 id = (uint32)atoi(i);
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
CreatureInfo const *ci = ObjectMgr::GetCreatureTemplate(entry);
if (!ci)
return false;
@ -653,7 +653,7 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
bool ChatHandler::HandleDebugSpellCheckCommand(const char* /*args*/)
{
sLog.outString( "Check expected in code spell properties base at table 'spell_check' content...");
spellmgr.CheckUsedSpells("spell_check");
sSpellMgr.CheckUsedSpells("spell_check");
return true;
}

View file

@ -124,7 +124,7 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
uint64 character_guid;
uint32 account_id;
Player *player = objmgr.GetPlayer(character_name.c_str());
Player *player = sObjectMgr.GetPlayer(character_name.c_str());
if(player)
{
character_guid = player->GetGUID();
@ -133,7 +133,7 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
}
else
{
character_guid = objmgr.GetPlayerGUIDByName(character_name);
character_guid = sObjectMgr.GetPlayerGUIDByName(character_name);
if(!character_guid)
{
PSendSysMessage(LANG_NO_PLAYER,character_name.c_str());
@ -141,7 +141,7 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
return false;
}
account_id = objmgr.GetPlayerAccountIdByGUID(character_guid);
account_id = sObjectMgr.GetPlayerAccountIdByGUID(character_guid);
}
std::string account_name;

Some files were not shown because too many files have changed in this diff Show more