本文整理汇总了C++中GmTicket::SetChatLog方法的典型用法代码示例。如果您正苦于以下问题:C++ GmTicket::SetChatLog方法的具体用法?C++ GmTicket::SetChatLog怎么用?C++ GmTicket::SetChatLog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GmTicket
的用法示例。
在下文中一共展示了GmTicket::SetChatLog方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleGMTicketCreateOpcode
void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
{
// Don't accept tickets if the ticket queue is disabled. (Ticket UI is greyed out but not fully dependable)
if (sTicketMgr->GetStatus() == GMTICKET_QUEUE_STATUS_DISABLED)
return;
if(!GetPlayer()->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
return;
}
if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_TICKET_REQ), sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ));
return;
}
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 (!ticket || ticket->IsClosed())
{
ticket = new GmTicket(GetPlayer(), recvData);
uint32 count;
std::list<uint32> times;
uint32 decompressedSize;
std::string chatLog;
recvData >> count;
for (uint32 i = 0; i < count; i++)
{
uint32 time;
recvData >> time;
times.push_back(time);
}
recvData >> decompressedSize;
if (count && decompressedSize && decompressedSize < 0xFFFF)
{
uint32 pos = recvData.rpos();
ByteBuffer dest;
dest.resize(decompressedSize);
uLongf realSize = decompressedSize;
if (uncompress(dest.contents(), &realSize, recvData.contents() + pos, recvData.size() - pos) == Z_OK)
{
dest >> chatLog;
ticket->SetChatLog(times, chatLog);
}