mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Tickets
* Fixed .ticket complete command not marking tickets as completed * Fixed "Need more help" button functionality after ticket has been answered by a GM Closes #9383
This commit is contained in:
@@ -41,10 +41,15 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
GMTicketResponse response = GMTICKET_RESPONSE_CREATE_ERROR;
|
||||
GmTicket* ticket = sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID());
|
||||
|
||||
if (ticket && ticket->IsCompleted())
|
||||
sTicketMgr->CloseTicket(ticket->GetId(), GetPlayer()->GetGUID());;
|
||||
|
||||
// Player must not have ticket
|
||||
if (!sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID()))
|
||||
if (!ticket || ticket->IsClosed())
|
||||
{
|
||||
GmTicket* ticket = new GmTicket(GetPlayer(), recvData);
|
||||
ticket = new GmTicket(GetPlayer(), recvData);
|
||||
|
||||
uint32 count;
|
||||
std::list<uint32> times;
|
||||
|
||||
@@ -239,7 +239,10 @@ void GmTicket::SetChatLog(std::list<uint32> time, std::string const& log)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Ticket manager
|
||||
TicketMgr::TicketMgr() : _status(true), _lastTicketId(0), _lastSurveyId(0), _openTicketCount(0), _lastChange(time(NULL)) { }
|
||||
TicketMgr::TicketMgr() : _status(true), _lastTicketId(0), _lastSurveyId(0), _openTicketCount(0),
|
||||
_lastChange(time(NULL))
|
||||
{
|
||||
}
|
||||
|
||||
TicketMgr::~TicketMgr()
|
||||
{
|
||||
@@ -247,7 +250,10 @@ TicketMgr::~TicketMgr()
|
||||
delete itr->second;
|
||||
}
|
||||
|
||||
void TicketMgr::Initialize() { SetStatus(sWorld->getBoolConfig(CONFIG_ALLOW_TICKETS)); }
|
||||
void TicketMgr::Initialize()
|
||||
{
|
||||
SetStatus(sWorld->getBoolConfig(CONFIG_ALLOW_TICKETS));
|
||||
}
|
||||
|
||||
void TicketMgr::ResetTickets()
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ class GmTicket
|
||||
{
|
||||
public:
|
||||
GmTicket();
|
||||
explicit GmTicket(Player* player, WorldPacket& recvData);
|
||||
GmTicket(Player* player, WorldPacket& recvData);
|
||||
~GmTicket();
|
||||
|
||||
bool IsClosed() const { return _closedBy; }
|
||||
@@ -119,7 +119,8 @@ public:
|
||||
else if (_escalatedStatus == TICKET_UNASSIGNED)
|
||||
_escalatedStatus = TICKET_ASSIGNED;
|
||||
}
|
||||
void SetClosedBy(const int64& value) { _closedBy = value; }
|
||||
void SetClosedBy(int64 value) { _closedBy = value; }
|
||||
void SetCompleted() { _completed = true; }
|
||||
void SetMessage(std::string const& message)
|
||||
{
|
||||
_message = message;
|
||||
|
||||
@@ -235,6 +235,10 @@ public:
|
||||
if (player->IsInWorld())
|
||||
ticket->SendResponse(player->GetSession());
|
||||
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
ticket->SetCompleted();
|
||||
ticket->SaveToDB(trans);
|
||||
|
||||
sTicketMgr->UpdateLastChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user