/** * Handles the '.character deleted list' command, which shows all deleted characters which matches the given search string * * @see HandleCharacterDeletedListHelper * @see HandleCharacterDeletedRestoreCommand * @see HandleCharacterDeletedDeleteCommand * @see DeletedInfoList * * @param args the search string which either contains a player GUID or a part fo the character-name */ static bool HandleCharacterDeletedListCommand(ChatHandler* handler, char const* args) { DeletedInfoList foundList; if (!GetDeletedCharacterInfoList(foundList, args)) return false; // if no characters have been found, output a warning if (foundList.empty()) { handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); return false; } HandleCharacterDeletedListHelper(foundList, handler); return true; }
/** * Handles the '.character deleted delete' command, which completely deletes all deleted characters which matches the given search string * * @see Player::GetDeletedCharacterGUIDs * @see Player::DeleteFromDB * @see ChatHandler::HandleCharacterDeletedListCommand * @see ChatHandler::HandleCharacterDeletedRestoreCommand * * @param args the search string which either contains a player GUID or a part fo the character-name */ bool ChatHandler::HandleCharacterDeletedDeleteCommand(const char* args) { // It is required to submit at least one argument if (!*args) return false; DeletedInfoList foundList; if (!GetDeletedCharacterInfoList(foundList, args)) return false; if (foundList.empty()) { SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); return false; } SendSysMessage(LANG_CHARACTER_DELETED_DELETE); HandleCharacterDeletedListHelper(foundList); // Call the appropriate function to delete them (current account for deleted characters is 0) for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) Player::DeleteFromDB(itr->lowguid, 0, false, true); return true; }