aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorSpp- <spp@jorge.gr>2011-09-08 10:49:58 +0200
committerSpp- <spp@jorge.gr>2011-09-08 10:49:58 +0200
commiteddcb8ffbf3f7f8ae74ce7ef7972626303f0de3c (patch)
treea10cc725fbaad02c8330c640224c8a0820774e94 /src/server/scripts
parente67a33eaaa5e1c1f46ba268e02254a087b0f2ec3 (diff)
AccountMgr singleton converted to namespace with free functions as it has no internal state
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_account.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 17bc0daec5b..c8510f7fc03 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -99,11 +99,11 @@ public:
if (!szAcc || !szPassword)
return false;
- // normalized in sAccountMgr->CreateAccount
+ // normalized in AccountMgr::CreateAccount
std::string account_name = szAcc;
std::string password = szPassword;
- AccountOpResult result = sAccountMgr->CreateAccount(account_name, password);
+ AccountOpResult result = AccountMgr::CreateAccount(account_name, password);
switch(result)
{
case AOR_OK:
@@ -150,7 +150,7 @@ public:
return false;
}
- uint32 account_id = sAccountMgr->GetId(account_name);
+ uint32 account_id = AccountMgr::GetId(account_name);
if (!account_id)
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
@@ -164,7 +164,7 @@ public:
if (handler->HasLowerSecurityAccount (NULL, account_id, true))
return false;
- AccountOpResult result = sAccountMgr->DeleteAccount(account_id);
+ AccountOpResult result = AccountMgr::DeleteAccount(account_id);
switch(result)
{
case AOR_OK:
@@ -282,7 +282,7 @@ public:
return false;
}
- if (!sAccountMgr->CheckPassword(handler->GetSession()->GetAccountId(), std::string(old_pass)))
+ if (!AccountMgr::CheckPassword(handler->GetSession()->GetAccountId(), std::string(old_pass)))
{
handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD);
handler->SetSentErrorMessage(true);
@@ -296,7 +296,7 @@ public:
return false;
}
- AccountOpResult result = sAccountMgr->ChangePassword(handler->GetSession()->GetAccountId(), std::string(new_pass));
+ AccountOpResult result = AccountMgr::ChangePassword(handler->GetSession()->GetAccountId(), std::string(new_pass));
switch(result)
{
case AOR_OK:
@@ -342,7 +342,7 @@ public:
return false;
account_id = player->GetSession()->GetAccountId();
- sAccountMgr->GetName(account_id, account_name);
+ AccountMgr::GetName(account_id, account_name);
szExp = szAcc;
}
else
@@ -356,7 +356,7 @@ public:
return false;
}
- account_id = sAccountMgr->GetId(account_name);
+ account_id = AccountMgr::GetId(account_name);
if (!account_id)
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
@@ -429,17 +429,17 @@ public:
}
// handler->getSession() == NULL only for console
- targetAccountId = (isAccountNameGiven) ? sAccountMgr->GetId(targetAccountName) : handler->getSelectedPlayer()->GetSession()->GetAccountId();
+ targetAccountId = (isAccountNameGiven) ? AccountMgr::GetId(targetAccountName) : handler->getSelectedPlayer()->GetSession()->GetAccountId();
int32 gmRealmID = (isAccountNameGiven) ? atoi(arg3) : atoi(arg2);
uint32 plSecurity;
if (handler->GetSession())
- plSecurity = sAccountMgr->GetSecurity(handler->GetSession()->GetAccountId(), gmRealmID);
+ plSecurity = AccountMgr::GetSecurity(handler->GetSession()->GetAccountId(), gmRealmID);
else
plSecurity = SEC_CONSOLE;
// can set security level only for target with less security and to less security that we have
// This is also reject self apply in fact
- targetSecurity = sAccountMgr->GetSecurity(targetAccountId, gmRealmID);
+ targetSecurity = AccountMgr::GetSecurity(targetAccountId, gmRealmID);
if (targetSecurity >= plSecurity || gm >= plSecurity)
{
handler->SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
@@ -501,7 +501,7 @@ public:
return false;
}
- uint32 targetAccountId = sAccountMgr->GetId(account_name);
+ uint32 targetAccountId = AccountMgr::GetId(account_name);
if (!targetAccountId)
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
@@ -521,7 +521,7 @@ public:
return false;
}
- AccountOpResult result = sAccountMgr->ChangePassword(targetAccountId, szPassword1);
+ AccountOpResult result = AccountMgr::ChangePassword(targetAccountId, szPassword1);
switch (result)
{