Core/Commands: Add missing message for .ticket complete (#79)
Do not allow the completion of a ticket with or without response if the handler isn't the assignee Let players know when their ticket has been closed or they received a response.
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
|
||||||
|
(1334, 'Your ticket has been closed.'),
|
||||||
|
(1335, 'You received a ticket response.');
|
||||||
@@ -1045,7 +1045,11 @@ enum TrinityStrings
|
|||||||
LANG_BG_AV_H_CAPTAIN_DEAD = 1331,
|
LANG_BG_AV_H_CAPTAIN_DEAD = 1331,
|
||||||
LANG_BG_AV_A_CAPTAIN_DEAD = 1332,
|
LANG_BG_AV_A_CAPTAIN_DEAD = 1332,
|
||||||
LANG_BG_AV_START_TWO_MINUTES = 1333,
|
LANG_BG_AV_START_TWO_MINUTES = 1333,
|
||||||
// FREE IDS 1334-1999
|
|
||||||
|
//Player Ticket Strings
|
||||||
|
LANG_TICKET_CLOSED = 1334,
|
||||||
|
LANG_TICKET_COMPLETED = 1335,
|
||||||
|
// FREE IDS 1336-1999
|
||||||
|
|
||||||
// Ticket Strings 2000-2030
|
// Ticket Strings 2000-2030
|
||||||
LANG_COMMAND_TICKETNEW = 2000,
|
LANG_COMMAND_TICKETNEW = 2000,
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ public:
|
|||||||
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
|
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
|
||||||
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
|
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
|
||||||
submitter->GetSession()->SendPacket(&data);
|
submitter->GetSession()->SendPacket(&data);
|
||||||
|
ChatHandler(submitter->GetSession()).SendSysMessage(LANG_TICKET_CLOSED);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -233,25 +234,29 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* response = strtok(NULL, "\n");
|
// Check if handler is not assignee in which case return
|
||||||
if (response)
|
Player* player = handler->GetSession() ? handler->GetSession()->GetPlayer() : NULL;
|
||||||
|
|
||||||
|
if (player && ticket->IsAssignedNotTo(player->GetGUID()))
|
||||||
{
|
{
|
||||||
// Cannot add response to ticket, assigned to someone else
|
handler->PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId());
|
||||||
//! Console excluded
|
return true;
|
||||||
Player* player = handler->GetSession() ? handler->GetSession()->GetPlayer() : NULL;
|
|
||||||
if (player && ticket->IsAssignedNotTo(player->GetGUID()))
|
|
||||||
{
|
|
||||||
handler->PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
ticket->AppendResponse(response);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Player* player = ticket->GetPlayer())
|
char* response = strtok(NULL, "\n");
|
||||||
ticket->SendResponse(player->GetSession());
|
if (response)
|
||||||
|
ticket->AppendResponse(response);
|
||||||
|
|
||||||
|
if (Player* player = ticket->GetPlayer())
|
||||||
|
{
|
||||||
|
ticket->SendResponse(player->GetSession());
|
||||||
|
ChatHandler(player->GetSession()).SendSysMessage(LANG_TICKET_COMPLETED);
|
||||||
|
}
|
||||||
Player* gm = handler->GetSession() ? handler->GetSession()->GetPlayer() : NULL;
|
Player* gm = handler->GetSession() ? handler->GetSession()->GetPlayer() : NULL;
|
||||||
|
|
||||||
|
std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, NULL);
|
||||||
|
msg += handler->PGetParseString(LANG_COMMAND_TICKETCOMPLETED, gm ? gm->GetName().c_str() : "Console");
|
||||||
|
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||||
|
|
||||||
SQLTransaction trans = SQLTransaction(NULL);
|
SQLTransaction trans = SQLTransaction(NULL);
|
||||||
ticket->SetCompleted();
|
ticket->SetCompleted();
|
||||||
|
|||||||
Reference in New Issue
Block a user