* Implement the ability to delete characters without them being removed from

* the DB, so they can be unerased
* Original patch by DasBlub
* Ported to Trinty by Az@zel

--HG--
branch : trunk
This commit is contained in:
Brian
2010-07-21 12:13:23 -06:00
parent 5995a8ec1d
commit 4320b10901
18 changed files with 677 additions and 146 deletions
+14
View File
@@ -61,6 +61,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid)
if (!result)
return AOR_NAME_NOT_EXIST; // account doesn't exist
// existed characters list
result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%d'",accid);
if (result)
{
@@ -214,6 +215,19 @@ bool AccountMgr::CheckPassword(uint32 accid, std::string passwd)
return false;
}
uint32 AccountMgr::GetCharactersCount(uint32 acc_id)
{
uint32 charcount = 0;
// check character count
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", acc_id);
if (result)
{
Field *fields=result->Fetch();
charcount = fields[0].GetUInt32();
}
return charcount;
}
bool AccountMgr::normalizeString(std::string& utf8str)
{
wchar_t wstr_buf[MAX_ACCOUNT_STR+1];
+1
View File
@@ -53,6 +53,7 @@ class AccountMgr
uint32 GetSecurity(uint32 acc_id);
uint32 GetSecurity(uint32 acc_id, int32 realm_id);
bool GetName(uint32 acc_id, std::string &name);
uint32 GetCharactersCount(uint32 acc_id);
std::string CalculateShaPassHash(std::string& name, std::string& password);
static bool normalizeString(std::string& utf8str);