Skip to content

Commit

Permalink
Fixed typo in function name. Other cleanups.
Browse files Browse the repository at this point in the history
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

(backported from commit 44bf979)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
silviu2009 authored and VladimirMangos committed Aug 9, 2009
1 parent da8a9a2 commit 944f509
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 35 deletions.
14 changes: 7 additions & 7 deletions src/game/AccountMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass
if(utf8length(username) > MAX_ACCOUNT_STR)
return AOR_NAME_TOO_LONG; // username's too long

normilizeString(username);
normilizeString(password);
normalizeString(username);
normalizeString(password);

loginDatabase.escape_string(username);
loginDatabase.escape_string(password);
Expand Down Expand Up @@ -118,8 +118,8 @@ AccountOpResult AccountMgr::ChangeUsername(uint32 accid, std::string new_uname,
if(utf8length(new_passwd) > MAX_ACCOUNT_STR)
return AOR_PASS_TOO_LONG;

normilizeString(new_uname);
normilizeString(new_passwd);
normalizeString(new_uname);
normalizeString(new_passwd);

loginDatabase.escape_string(new_uname);
loginDatabase.escape_string(new_passwd);
Expand All @@ -139,7 +139,7 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accid, std::string new_passwd)
if (utf8length(new_passwd) > MAX_ACCOUNT_STR)
return AOR_PASS_TOO_LONG;

normilizeString(new_passwd);
normalizeString(new_passwd);

loginDatabase.escape_string(new_passwd);
if(!loginDatabase.PExecute("UPDATE account SET sha_pass_hash=SHA1("_CONCAT3_("username","':'","'%s'")") WHERE id='%d'", new_passwd.c_str(), accid))
Expand Down Expand Up @@ -190,7 +190,7 @@ bool AccountMgr::GetName(uint32 acc_id, std::string &name)

bool AccountMgr::CheckPassword(uint32 accid, std::string passwd)
{
normilizeString(passwd);
normalizeString(passwd);
loginDatabase.escape_string(passwd);

QueryResult *result = loginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d' AND sha_pass_hash=SHA1("_CONCAT3_("username","':'","'%s'")")", accid, passwd.c_str());
Expand All @@ -203,7 +203,7 @@ bool AccountMgr::CheckPassword(uint32 accid, std::string passwd)
return false;
}

bool AccountMgr::normilizeString(std::string& utf8str)
bool AccountMgr::normalizeString(std::string& utf8str)
{
wchar_t wstr_buf[MAX_ACCOUNT_STR+1];

Expand Down
2 changes: 1 addition & 1 deletion src/game/AccountMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AccountMgr
uint32 GetSecurity(uint32 acc_id);
bool GetName(uint32 acc_id, std::string &name);

static bool normilizeString(std::string& utf8str);
static bool normalizeString(std::string& utf8str);
};

#define accmgr MaNGOS::Singleton<AccountMgr>::Instance()
Expand Down
2 changes: 1 addition & 1 deletion src/game/Level2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3915,7 +3915,7 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
char* limit_str = strtok (NULL, " ");
int32 limit = limit_str ? atoi (limit_str) : -1;

if (!AccountMgr::normilizeString (account))
if (!AccountMgr::normalizeString (account))
return false;

loginDatabase.escape_string (account);
Expand Down
38 changes: 19 additions & 19 deletions src/game/Level3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
return false;

targetAccountName = arg1;
if(!AccountMgr::normilizeString(targetAccountName))
if (!AccountMgr::normalizeString(targetAccountName))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,targetAccountName.c_str());
SetSentErrorMessage(true);
Expand Down Expand Up @@ -831,7 +831,7 @@ bool ChatHandler::HandleAccountSetPasswordCommand(const char* args)
return false;

std::string account_name = szAccount;
if(!AccountMgr::normilizeString(account_name))
if (!AccountMgr::normalizeString(account_name))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
SetSentErrorMessage(true);
Expand Down Expand Up @@ -4721,7 +4721,7 @@ bool ChatHandler::HandleBanHelper(BanMode mode, const char* args)
switch(mode)
{
case BAN_ACCOUNT:
if(!AccountMgr::normilizeString(nameOrIP))
if (!AccountMgr::normalizeString(nameOrIP))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,nameOrIP.c_str());
SetSentErrorMessage(true);
Expand Down Expand Up @@ -4801,7 +4801,7 @@ bool ChatHandler::HandleUnBanHelper(BanMode mode, const char* args)
switch(mode)
{
case BAN_ACCOUNT:
if(!AccountMgr::normilizeString(nameOrIP))
if (!AccountMgr::normalizeString(nameOrIP))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,nameOrIP.c_str());
SetSentErrorMessage(true);
Expand Down Expand Up @@ -4836,19 +4836,19 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char* args)
return false;

char* cname = strtok((char*)args, "");
if(!cname)
if (!cname)
return false;

std::string account_name = cname;
if(!AccountMgr::normilizeString(account_name))
if (!AccountMgr::normalizeString(account_name))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
SetSentErrorMessage(true);
return false;
}

uint32 accountid = accmgr.GetId(account_name);
if(!accountid)
if (!accountid)
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
return true;
Expand All @@ -4861,13 +4861,13 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char* args)
{
Player* target;
uint64 target_guid;
if(!extractPlayerTarget((char*)args,&target,&target_guid))
if (!extractPlayerTarget((char*)args,&target,&target_guid))
return false;

uint32 accountid = target ? target->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(target_guid);

std::string accountname;
if(!accmgr.GetName(accountid,accountname))
if (!accmgr.GetName(accountid,accountname))
{
PSendSysMessage(LANG_BANINFO_NOCHARACTER);
return true;
Expand Down Expand Up @@ -5205,34 +5205,34 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
return false;

char * file = strtok((char*)args, " ");
if(!file)
if (!file)
return false;

char * account = strtok(NULL, " ");
if(!account)
if (!account)
return false;

std::string account_name = account;
if(!AccountMgr::normilizeString(account_name))
if (!AccountMgr::normalizeString(account_name))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
SetSentErrorMessage(true);
return false;
}

uint32 account_id = accmgr.GetId(account_name);
if(!account_id)
if (!account_id)
{
account_id = atoi(account); // use original string
if(!account_id)
if (!account_id)
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
SetSentErrorMessage(true);
return false;
}
}

if(!accmgr.GetName(account_id,account_name))
if (!accmgr.GetName(account_id,account_name))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
SetSentErrorMessage(true);
Expand Down Expand Up @@ -5889,10 +5889,10 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
std::string account_name;
uint32 account_id;

if(!szExp)
if (!szExp)
{
Player* player = getSelectedPlayer();
if(!player)
if (!player)
return false;

account_id = player->GetSession()->GetAccountId();
Expand All @@ -5903,15 +5903,15 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
{
///- Convert Account name to Upper Format
account_name = szAcc;
if(!AccountMgr::normilizeString(account_name))
if (!AccountMgr::normalizeString(account_name))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
SetSentErrorMessage(true);
return false;
}

account_id = accmgr.GetId(account_name);
if(!account_id)
if (!account_id)
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
SetSentErrorMessage(true);
Expand Down
8 changes: 4 additions & 4 deletions src/mangosd/CliRunnable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void utf8print(const char* str)
/// \todo This function has to be enhanced to respect the login/realm split (delete char, delete account chars in realm, delete account chars in realm then delete account
bool ChatHandler::HandleAccountDeleteCommand(const char* args)
{
if(!*args)
if (!*args)
return false;

///- Get the account name from the command line
Expand All @@ -64,15 +64,15 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args)
return false;

std::string account_name = account_name_str;
if(!AccountMgr::normilizeString(account_name))
if (!AccountMgr::normalizeString(account_name))
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
SetSentErrorMessage(true);
return false;
}

uint32 account_id = accmgr.GetId(account_name);
if(!account_id)
if (!account_id)
{
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
SetSentErrorMessage(true);
Expand Down Expand Up @@ -219,7 +219,7 @@ bool ChatHandler::HandleAccountCreateCommand(const char* args)
if(!szAcc || !szPassword)
return false;

// normilized in accmgr.CreateAccount
// normalized in accmgr.CreateAccount
std::string account_name = szAcc;
std::string password = szPassword;

Expand Down
6 changes: 3 additions & 3 deletions src/mangosd/RASocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void RASocket::OnRead()
std::string login = szLogin;

///- Convert Account name to Upper Format
AccountMgr::normilizeString(login);
AccountMgr::normalizeString(login);

///- Escape the Login to allow quotes in names
loginDatabase.escape_string(login);
Expand Down Expand Up @@ -189,8 +189,8 @@ void RASocket::OnRead()
std::string login = szLogin;
std::string pw = &buff[5];

AccountMgr::normilizeString(login);
AccountMgr::normilizeString(pw);
AccountMgr::normalizeString(login);
AccountMgr::normalizeString(pw);
loginDatabase.escape_string(login);
loginDatabase.escape_string(pw);

Expand Down

0 comments on commit 944f509

Please sign in to comment.