コード例 #1
0
ファイル: cs_ticket.cpp プロジェクト: lukaasm/Core
    static bool HandleGMTicketEscalateCommand(ChatHandler* handler, char const* args)
    {
        if (!*args)
            return false;

        uint32 ticketId = atoi(args);
        GmTicket* ticket = sTicketMgr->GetTicket(ticketId);

        // Ticket must exists and not be closed / completed / assigned.
        if (!ticket || ticket->IsClosed() || ticket->IsCompleted() || ticket->GetEscalatedStatus() != TICKET_UNASSIGNED)
        {
            handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
            return true;
        }

        // Set the ticket in the priority queue and the text and save it.
        SQLTransaction trans = SQLTransaction(NULL);
        ticket->SetEscalatedStatus(TICKET_IN_ESCALATION_QUEUE);
        ticket->SetResponse("Your ticket is in the priority queue and will be serviced shortly.");
        ticket->SaveToDB(trans);

        // Update the last change time.
        sTicketMgr->UpdateLastChange();

        return true;
    }
コード例 #2
0
ファイル: cs_ticket.cpp プロジェクト: shaunk1593/Crusade
    static bool HandleGMTicketEscalateCommand(ChatHandler* handler, char const* args)
    {
        if (!*args)
            return false;

        uint32 ticketId = atoi(args);
        GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
        if (!ticket || ticket->IsClosed() || ticket->IsCompleted() || ticket->GetEscalatedStatus() != TICKET_UNASSIGNED)
        {
            handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
            return true;
        }

        ticket->SetEscalatedStatus(TICKET_IN_ESCALATION_QUEUE);

        if (Player* player = ticket->GetPlayer())
            sTicketMgr->SendTicket(player->GetSession(), ticket);

        sTicketMgr->UpdateLastChange();
        return true;
    }