Core/Tickets: Ticket System updated

This commit is contained in:
Yehonal
2016-08-07 12:25:59 +02:00
parent 2ca258e179
commit 444012104b
10 changed files with 115 additions and 19 deletions

View File

@@ -84,6 +84,7 @@
#include "GameObjectAI.h"
#include "PoolMgr.h"
#include "SavingSystem.h"
#include "TicketMgr.h"
#define ZONE_UPDATE_INTERVAL (2*IN_MILLISECONDS)
@@ -4729,6 +4730,11 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
// remove from arena teams
LeaveAllArenaTeams(playerguid);
// close player ticket if any
GmTicket* ticket = sTicketMgr->GetTicketByPlayer(playerguid);
if (ticket)
ticket->SetClosedBy(playerguid);
// remove from group
if (uint32 groupId = GetGroupIdFromStorage(guid))
if (Group* group = sGroupMgr->GetGroupByGUID(groupId))
@@ -4923,9 +4929,18 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
stmt->setUInt32(0, guid);
trans->Append(stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_GM_TICKETS);
stmt->setUInt32(0, guid);
trans->Append(stmt);
if (sWorld->getBoolConfig(CONFIG_DELETE_CHARACTER_TICKET_TRACE))
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_GM_TICKETS_ON_CHAR_DELETION);
stmt->setUInt32(0, guid);
trans->Append(stmt);
}
else
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_GM_TICKETS);
stmt->setUInt32(0, guid);
trans->Append(stmt);
}
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE_BY_OWNER);
stmt->setUInt32(0, guid);