[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:
DasBlub 2010-04-19 22:00:55 +04:00 committed by VladimirMangos
parent c9ac685f04
commit 492ce567d2
22 changed files with 701 additions and 151 deletions

View file

@ -22,6 +22,7 @@
#include "Database/SQLStorage.h"
#include "UpdateFields.h"
#include "ObjectMgr.h"
#include "AccountMgr.h"
// Character Dump tables
struct DumpTable
@ -394,19 +395,9 @@ DumpReturn PlayerDumpWriter::WriteDump(const std::string& file, uint32 guid)
DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, std::string name, uint32 guid)
{
// check character count
{
QueryResult *result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", account);
uint8 charcount = 0;
if (result)
{
Field *fields=result->Fetch();
charcount = fields[0].GetUInt8();
delete result;
if (charcount >= 10)
return DUMP_TOO_MANY_CHARS;
}
}
uint32 charcount = sAccountMgr.GetCharactersCount(account);
if (charcount >= 10)
return DUMP_TOO_MANY_CHARS;
FILE *fin = fopen(file.c_str(), "r");
if (!fin)