TrinityCore/TrinityCore — pull request #7095 by LordJZ (2012-07-14 03:18:35+00:00)
Title: Some TicketMgr fixes

Also, it may become useful to store response in the database. I wonder why it isn't implemented already.

Reference for the second fix:

void TicketMgr::SendTicket(WorldSession* session, GmTicket* ticket) const
{
uint32 status = GMTICKET_STATUS_DEFAULT;
std::string message;
if (ticket)
{
message = ticket->GetMessage();
status = GMTICKET_STATUS_HASTEXT;
}

WorldPacket data(SMSG_GMTICKET_GETTICKET, (4 + 4 + (ticket ? message.length() + 1 + 4 + 4 + 4 + 1 + 1 : 0)));
data << uint32(status); // standard 0x0A, 0x06 if text present
data << uint32(ticket ? ticket->GetId() : 0); // ticketID

if (ticket)
{
data << message.c_str(); // ticket text
data << uint8(0x7); // ticket category; why is this hardcoded? does it make a diff re: client?

// we've got the easy stuff done by now.
// Now we need to go through the client logic for displaying various levels of ticket load
ticket->WritePacket(data);
}
session->SendPacket(&data);
}