示例#1
0
void ComplaintTicket::LoadFromDB(Field* fields)
{
    uint8 idx = 0;
    _id                     = fields[  idx].GetUInt32();
    _playerGuid             = ObjectGuid::Create<HighGuid::Player>(fields[++idx].GetUInt64());
    _note                   = fields[++idx].GetString();
    _createTime             = fields[++idx].GetUInt32();
    _mapId                  = fields[++idx].GetUInt16();
    _pos.x                  = fields[++idx].GetFloat();
    _pos.y                  = fields[++idx].GetFloat();
    _pos.z                  = fields[++idx].GetFloat();
    _facing                 = fields[++idx].GetFloat();
    _targetCharacterGuid    = ObjectGuid::Create<HighGuid::Player>(fields[++idx].GetUInt64());
    _complaintType          = GMSupportComplaintType(fields[++idx].GetUInt8());
    int32 reportLineIndex = fields[++idx].GetInt32();
    if (reportLineIndex != -1)
        _chatLog.ReportLineIndex = reportLineIndex;

    int64 closedBy = fields[++idx].GetInt64();
    if (closedBy == 0)
        _closedBy = ObjectGuid::Empty;
    else if (closedBy < 0)
        _closedBy.SetRawValue(0, uint64(closedBy));
    else
        _closedBy = ObjectGuid::Create<HighGuid::Player>(uint64(closedBy));

    uint64 assignedTo       = fields[++idx].GetUInt64();
    if (assignedTo == 0)
        _assignedTo = ObjectGuid::Empty;
    else
        _assignedTo = ObjectGuid::Create<HighGuid::Player>(assignedTo);

    _comment                = fields[++idx].GetString();
}
示例#2
0
void WorldSession::HandleSupportTicketSubmitComplaint(WorldPackets::Ticket::SupportTicketSubmitComplaint& packet)
{
    if (!sSupportMgr->GetComplaintSystemStatus())
        return;

    ComplaintTicket* comp = new ComplaintTicket(GetPlayer());
    comp->SetPosition(packet.Header.MapID, packet.Header.Position);
    comp->SetFacing(packet.Header.Facing);
    comp->SetChatLog(packet.ChatLog);
    comp->SetTargetCharacterGuid(packet.TargetCharacterGUID);
    comp->SetComplaintType(GMSupportComplaintType(packet.ComplaintType));
    comp->SetNote(packet.Note);

    sSupportMgr->AddTicket(comp);
}