mirror of
https://github.com/mangosfour/server.git
synced 2026-01-01 16:37:12 +00:00
[9767] Add the posibility to keep deleted characters in the database for a while and also add related commands.
Added commands: * .character deleted list [$guid|$name] * .character deleted restore $guid|$name [$newname] * .character deleted delete $guid|$name * .character deleted old [$keepdays] Command .character delete renamed to .character erase Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
c9ac685f04
commit
492ce567d2
22 changed files with 701 additions and 151 deletions
|
|
@ -62,6 +62,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid)
|
|||
return AOR_NAME_NOT_EXIST; // account doesn't exist
|
||||
delete result;
|
||||
|
||||
// existed chaarcters list
|
||||
result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%d'",accid);
|
||||
if (result)
|
||||
{
|
||||
|
|
@ -182,6 +183,21 @@ bool AccountMgr::GetName(uint32 acc_id, std::string &name)
|
|||
return false;
|
||||
}
|
||||
|
||||
uint32 AccountMgr::GetCharactersCount(uint32 acc_id)
|
||||
{
|
||||
// check character count
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", acc_id);
|
||||
if (result)
|
||||
{
|
||||
Field *fields=result->Fetch();
|
||||
uint32 charcount = fields[0].GetUInt32();
|
||||
delete result;
|
||||
return charcount;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AccountMgr::CheckPassword(uint32 accid, std::string passwd)
|
||||
{
|
||||
std::string username;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue