* Update GM ticket system data, thanks to MaNGOS.
--HG-- branch : trunk
This commit is contained in:
+35
-11
@@ -29,6 +29,14 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
|||||||
{
|
{
|
||||||
CHECK_PACKET_SIZE(recv_data, 4*4+1+2*4);
|
CHECK_PACKET_SIZE(recv_data, 4*4+1+2*4);
|
||||||
|
|
||||||
|
if(GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()))
|
||||||
|
{
|
||||||
|
WorldPacket data( SMSG_GMTICKET_CREATE, 4 );
|
||||||
|
data << uint32(1); // 1 - You already have GM ticket
|
||||||
|
SendPacket( &data );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 map;
|
uint32 map;
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
std::string ticketText, ticketText2;
|
std::string ticketText, ticketText2;
|
||||||
@@ -105,24 +113,22 @@ void WorldSession::HandleGMTicketDeleteOpcode( WorldPacket & /*recv_data*/)
|
|||||||
|
|
||||||
sWorld.SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName(), ticket->guid );
|
sWorld.SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName(), ticket->guid );
|
||||||
objmgr.RemoveGMTicket(ticket, GetPlayer()->GetGUID(), false);
|
objmgr.RemoveGMTicket(ticket, GetPlayer()->GetGUID(), false);
|
||||||
|
SendGMTicketGetTicket(0x0A, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/)
|
void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_GMTICKET_GETTICKET, 400);
|
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
||||||
|
data << (uint32)time(NULL);
|
||||||
|
data << (uint32)0;
|
||||||
|
SendPacket( &data );
|
||||||
|
|
||||||
GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||||
|
if(ticket)
|
||||||
if(!ticket)
|
SendGMTicketGetTicket(0x06, ticket->message);
|
||||||
{
|
else
|
||||||
data << uint32(10);
|
SendGMTicketGetTicket(0x0A, 0);
|
||||||
SendPacket(&data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
data << uint32(6);
|
|
||||||
data << ticket->message.c_str();
|
|
||||||
SendPacket(&data);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,3 +138,21 @@ void WorldSession::HandleGMTicketSystemStatusOpcode( WorldPacket & /*recv_data*/
|
|||||||
data << uint32(1);
|
data << uint32(1);
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text)
|
||||||
|
{
|
||||||
|
int len = text ? strlen(text) : 0;
|
||||||
|
WorldPacket data( SMSG_GMTICKET_GETTICKET, (4+len+1+4+2+4+4) );
|
||||||
|
data << uint32(status); // standard 0x0A, 0x06 if text present
|
||||||
|
if(status == 6)
|
||||||
|
{
|
||||||
|
data << text; // ticket text
|
||||||
|
data << uint8(0x7); // ticket category
|
||||||
|
data << float(0); // tickets in queue?
|
||||||
|
data << float(0); // if > "tickets in queue" then "We are currently experiencing a high volume of petitions."
|
||||||
|
data << float(0); // 0 - "Your ticket will be serviced soon", 1 - "Wait time currently unavailable"
|
||||||
|
data << uint8(0); // if == 2 and next field == 1 then "Your ticket has been escalated"
|
||||||
|
data << uint8(0); // const
|
||||||
|
}
|
||||||
|
SendPacket( &data );
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user