mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[8337] Fixed typo in function name. Other cleanups.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
6b25da27dd
commit
d7b091793c
7 changed files with 36 additions and 36 deletions
|
|
@ -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);
|
||||
|
|
@ -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);
|
||||
|
|
@ -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))
|
||||
|
|
@ -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());
|
||||
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -4043,7 +4043,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);
|
||||
|
|
|
|||
|
|
@ -853,7 +853,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);
|
||||
|
|
@ -919,7 +919,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);
|
||||
|
|
@ -4906,7 +4906,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);
|
||||
|
|
@ -4986,7 +4986,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);
|
||||
|
|
@ -5021,11 +5021,11 @@ 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);
|
||||
|
|
@ -5033,7 +5033,7 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char* args)
|
|||
}
|
||||
|
||||
uint32 accountid = accmgr.GetId(account_name);
|
||||
if(!accountid)
|
||||
if (!accountid)
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
return true;
|
||||
|
|
@ -5046,13 +5046,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;
|
||||
|
|
@ -5390,15 +5390,15 @@ 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);
|
||||
|
|
@ -5406,10 +5406,10 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
@ -5417,7 +5417,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
@ -6074,10 +6074,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();
|
||||
|
|
@ -6088,7 +6088,7 @@ 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);
|
||||
|
|
@ -6096,7 +6096,7 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
|
|||
}
|
||||
|
||||
account_id = accmgr.GetId(account_name);
|
||||
if(!account_id)
|
||||
if (!account_id)
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -64,7 +64,7 @@ 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);
|
||||
|
|
@ -72,7 +72,7 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args)
|
|||
}
|
||||
|
||||
uint32 account_id = accmgr.GetId(account_name);
|
||||
if(!account_id)
|
||||
if (!account_id)
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8336"
|
||||
#define REVISION_NR "8337"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue