Jump to content

Notice: Singleton Names Changed


Guest XTZGZoReX

Recommended Posts

In revision [8789] almost all singleton names have been changed to a more consistent naming style. Most patches will need updating to reflect this.

The changes:

* objmgr -> sObjectMgr

* spellmgr -> sSpellMgr

* WaypointMgr -> sWaypointMgr

* poolhandler -> sPoolMgr

* objaccessor -> sObjectAccessor

* mapmgr -> sMapMgr

* sInstanceSaveManager -> sInstanceSaveMgr

* ticketmgr -> sTicketMgr

* CreatureEAI_Mgr -> sEventAIMgr

* auctionmgr -> sAuctionMgr

* achievementmgr -> sAchievementMgr

* gameeventmgr -> sGameEventMgr

* accmgr -> sAccountMgr

Thanks,

- Zor.

Link to comment
Share on other sites

Hmm, forgot accmgr singleton?

For [8799]. Compile works for me (on win). Used simple search & replace...

diff --git a/src/game/AccountMgr.h b/src/game/AccountMgr.h
index 9bbc358..be6cb16 100644
--- a/src/game/AccountMgr.h
+++ b/src/game/AccountMgr.h
@@ -55,5 +55,5 @@ class AccountMgr
        static bool normalizeString(std::string& utf8str);
};

-#define accmgr MaNGOS::Singleton<AccountMgr>::Instance()
+#define sAccountMgr MaNGOS::Singleton<AccountMgr>::Instance()
#endif
diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp
index f0c917e..83fe25e 100644
--- a/src/game/AuctionHouseMgr.cpp
+++ b/src/game/AuctionHouseMgr.cpp
@@ -97,7 +97,7 @@ void AuctionHouseMgr::SendAuctionWonMail( AuctionEntry *auction )
        else
        {
            bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
-            bidder_security = accmgr.GetSecurity(bidder_accId);
+            bidder_security = sAccountMgr.GetSecurity(bidder_accId);

            if(bidder_security > SEC_PLAYER )               // not do redundant DB requests
            {
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 20473b1..90c8831 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -725,7 +725,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
    if (target)
        target_sec = target->GetSecurity();
    else if (target_account)
-        target_sec = accmgr.GetSecurity(target_account);
+        target_sec = sAccountMgr.GetSecurity(target_account);
    else
        return true;                                        // caller must report error for (target==NULL && target_account==0)

diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp
index 937f1b9..792020f 100644
--- a/src/game/Level0.cpp
+++ b/src/game/Level0.cpp
@@ -200,14 +200,14 @@ bool ChatHandler::HandleAccountPasswordCommand(const char* args)
        return false;
    }

-    if (!accmgr.CheckPassword (m_session->GetAccountId(), password_old))
+    if (!sAccountMgr.CheckPassword(m_session->GetAccountId(), password_old))
    {
        SendSysMessage (LANG_COMMAND_WRONGOLDPASSWORD);
        SetSentErrorMessage (true);
        return false;
    }

-    AccountOpResult result = accmgr.ChangePassword(m_session->GetAccountId(), password_new);
+    AccountOpResult result = sAccountMgr.ChangePassword(m_session->GetAccountId(), password_new);

    switch(result)
    {
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 660e8e7..bd440e5 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -863,7 +863,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
        arg2 = arg1;

        targetAccountId = targetPlayer->GetSession()->GetAccountId();
-        accmgr.GetName(targetAccountId, targetAccountName);
+        sAccountMgr.GetName(targetAccountId, targetAccountName);
    }
    else
    {
@@ -879,7 +879,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
            return false;
        }

-        targetAccountId = accmgr.GetId(targetAccountName);
+        targetAccountId = sAccountMgr.GetId(targetAccountName);
        if(!targetAccountId)
        {
            PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,targetAccountName.c_str());
@@ -945,7 +945,7 @@ bool ChatHandler::HandleAccountSetPasswordCommand(const char* args)
        return false;
    }

-    uint32 targetAccountId = accmgr.GetId(account_name);
+    uint32 targetAccountId = sAccountMgr.GetId(account_name);
    if (!targetAccountId)
    {
        PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
@@ -965,7 +965,7 @@ bool ChatHandler::HandleAccountSetPasswordCommand(const char* args)
        return false;
    }

-    AccountOpResult result = accmgr.ChangePassword(targetAccountId, szPassword1);
+    AccountOpResult result = sAccountMgr.ChangePassword(targetAccountId, szPassword1);

    switch(result)
    {
@@ -5027,7 +5027,7 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char* args)
        return false;
    }

-    uint32 accountid = accmgr.GetId(account_name);
+    uint32 accountid = sAccountMgr.GetId(account_name);
    if (!accountid)
    {
        PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
@@ -5047,7 +5047,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char* args)
    uint32 accountid = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);

    std::string accountname;
-    if (!accmgr.GetName(accountid,accountname))
+    if (!sAccountMgr.GetName(accountid,accountname))
    {
        PSendSysMessage(LANG_BANINFO_NOCHARACTER);
        return true;
@@ -5206,7 +5206,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult* result)
                account_name = fields[1].GetCppString();
            // "character" case, name need extract from another DB
            else
-                accmgr.GetName (account_id,account_name);
+                sAccountMgr.GetName(account_id,account_name);

            // No SQL injection. id is uint32.
            QueryResult *banInfo = loginDatabase.PQuery("SELECT bandate,unbandate,bannedby,banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id);
@@ -5400,7 +5400,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
        return false;
    }

-    uint32 account_id = accmgr.GetId(account_name);
+    uint32 account_id = sAccountMgr.GetId(account_name);
    if (!account_id)
    {
        account_id = atoi(account);                             // use original string
@@ -5412,7 +5412,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
        }
    }

-    if (!accmgr.GetName(account_id,account_name))
+    if (!sAccountMgr.GetName(account_id,account_name))
    {
        PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
        SetSentErrorMessage(true);
@@ -6100,7 +6100,7 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
            return false;

        account_id = player->GetSession()->GetAccountId();
-        accmgr.GetName(account_id,account_name);
+        sAccountMgr.GetName(account_id,account_name);
        szExp = szAcc;
    }
    else
@@ -6114,7 +6114,7 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
            return false;
        }

-        account_id = accmgr.GetId(account_name);
+        account_id = sAccountMgr.GetId(account_name);
        if (!account_id)
        {
            PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 0616f46..fa8297d 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1909,7 +1909,7 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP)
    {
        uint32 account = 0;
        if (mode == BAN_ACCOUNT)
-            account = accmgr.GetId (nameOrIP);
+            account = sAccountMgr.GetId(nameOrIP);
        else if (mode == BAN_CHARACTER)
            account = sObjectMgr.GetPlayerAccountIdByPlayerName (nameOrIP);

diff --git a/src/mangosd/CliRunnable.cpp b/src/mangosd/CliRunnable.cpp
index 8c948e8..03bd574 100644
--- a/src/mangosd/CliRunnable.cpp
+++ b/src/mangosd/CliRunnable.cpp
@@ -71,7 +71,7 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args)
        return false;
    }

-    uint32 account_id = accmgr.GetId(account_name);
+    uint32 account_id = sAccountMgr.GetId(account_name);
    if (!account_id)
    {
        PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
@@ -85,7 +85,7 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args)
    if(HasLowerSecurityAccount (NULL,account_id,true))
        return false;

-    AccountOpResult result = accmgr.DeleteAccount(account_id);
+    AccountOpResult result = sAccountMgr.DeleteAccount(account_id);
    switch(result)
    {
        case AOR_OK:
@@ -145,7 +145,7 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
    }

    std::string account_name;
-    accmgr.GetName (account_id,account_name);
+    sAccountMgr.GetName(account_id,account_name);

    Player::DeleteFromDB(character_guid, account_id, true);
    PSendSysMessage(LANG_CHARACTER_DELETED,character_name.c_str(),GUID_LOPART(character_guid),account_name.c_str(), account_id);
@@ -219,11 +219,11 @@ bool ChatHandler::HandleAccountCreateCommand(const char* args)
    if(!szAcc || !szPassword)
        return false;

-    // normalized in accmgr.CreateAccount
+    // normalized in sAccountMgr.CreateAccount
    std::string account_name = szAcc;
    std::string password = szPassword;

-    AccountOpResult result = accmgr.CreateAccount(account_name, password);
+    AccountOpResult result = sAccountMgr.CreateAccount(account_name, password);
    switch(result)
    {
        case AOR_OK:

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use