[8789] Rename several singleton macros to use more consistent names.

* objmgr -> sObjectMgr
 * spellmgr -> sSpellMgr
 * WaypointMgr -> sWaypointMgr
 * poolhandler -> sPoolMgr
 * objaccessor -> sObjectAccessor
 * mapmgr -> sMapMgr
 * sInstanceSaveManager -> sInstanceSaveMgr
 * ticketmgr -> sTicketMgr
 * CreatureEAI_Mgr -> sEventAIMgr
 * auctionmgr -> sAuctionMgr
 * achievementmgr -> sAchievementMgr
This commit is contained in:
XTZGZoReX 2009-11-08 12:11:18 +01:00
parent 539072fcbd
commit 0734adb746
84 changed files with 1113 additions and 1113 deletions

View file

@ -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;
@ -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) );
@ -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)
@ -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)
@ -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,13 +1134,13 @@ 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 = ObjectMgr::GetItemPrototype(itemId);
@ -1171,7 +1171,7 @@ 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);
@ -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;