Example #1
0
        public void ResolveTicket(ModerationTicket issue, Player sender, int state)
        {
            issue.State = ModerationTicketState.CLOSED;
            ModerationDatabase.UpdateTicket(issue);

            if (sender.Session != null)
            {
                switch (state)
                {
                case 1:
                    sender.Session.Send(new ModerationIssueHandledComposer(ModerationIssueHandledComposer.USELESS));
                    break;

                case 2:
                    sender.Session.Send(new ModerationIssueHandledComposer(ModerationIssueHandledComposer.ABUSIVE));
                    break;

                case 3:
                    sender.Session.Send(new ModerationIssueHandledComposer(ModerationIssueHandledComposer.HANDLED));
                    break;
                }
            }

            Alias.Server.SocketServer.SessionManager.SendWithPermission(new ModerationIssueInfoComposer(issue), "acc_modtool_ticket_queue");
            RemoveTicket(issue);
        }
Example #2
0
        public void ReleaseTicket(ModerationTicket issue)
        {
            issue.ModId       = 0;
            issue.ModUsername = "";
            issue.State       = ModerationTicketState.OPEN;
            ModerationDatabase.UpdateTicket(issue);

            Alias.Server.SocketServer.SessionManager.SendWithPermission(new ModerationIssueInfoComposer(issue), "acc_modtool_ticket_queue");
        }
Example #3
0
        public void PickTicket(ModerationTicket issue, Player habbo)
        {
            issue.ModId       = habbo.Id;
            issue.ModUsername = habbo.Username;
            issue.State       = ModerationTicketState.PICKED;
            ModerationDatabase.UpdateTicket(issue);

            Alias.Server.SocketServer.SessionManager.SendWithPermission(new ModerationIssueInfoComposer(issue), "acc_modtool_ticket_queue");
        }
Example #4
0
 public static void UpdateTicket(ModerationTicket ticket)
 {
     using (DatabaseConnection dbClient = Alias.Server.DatabaseManager.GetConnection())
     {
         dbClient.AddParameter("id", ticket.Id);
         dbClient.AddParameter("modId", ticket.ModId);
         dbClient.AddParameter("state", (int)ticket.State);
         dbClient.Query("UPDATE `support_tickets` SET `state` = @state, `mod_id` = @modId WHERE `id` = @id");
     }
 }
Example #5
0
        public void QuickTicket(Player reported, string message)
        {
            ModerationTicket issue = new ModerationTicket()
            {
                SenderId       = reported.Id,
                SenderUsername = reported.Username,
                Message        = message,
                Type           = ModerationTicketType.AUTOMATIC
            };

            AddTicket(issue);
        }
Example #6
0
 public static int AddTicket(ModerationTicket ticket)
 {
     using (DatabaseConnection dbClient = Alias.Server.DatabaseManager.GetConnection())
     {
         dbClient.AddParameter("time", ticket.Timestamp);
         dbClient.AddParameter("senderId", ticket.SenderId);
         dbClient.AddParameter("reporterID", ticket.ReportedId);
         dbClient.AddParameter("issue", ticket.Message);
         dbClient.AddParameter("type", ModerationTicketTypes.GetIntFromType(ticket.Type));
         dbClient.AddParameter("roomId", ticket.RoomId);
         dbClient.AddParameter("category", ticket.Category);
         dbClient.Query("INSERT INTO `support_tickets` (`timestamp`, `sender_id`, `reported_id`, `issue`, `type`, `room_id`, `category`) VALUES (@time, @senderId, @reporterId, @issue, @type, @roomId, @category)");
         return(dbClient.LastInsertedId());
     }
 }
Example #7
0
        public static List <ModerationTicket> ReadTickets()
        {
            List <ModerationTicket> tickets = new List <ModerationTicket>();

            using (DatabaseConnection dbClient = Alias.Server.DatabaseManager.GetConnection())
            {
                using (MySqlDataReader Reader = dbClient.DataReader("SELECT * FROM `support_tickets` WHERE `state` != 0"))
                {
                    while (Reader.Read())
                    {
                        string           senderUsername   = "******";
                        string           reportedUsername = "******";
                        string           modUsername      = "";
                        ModerationTicket ticket           = new ModerationTicket()
                        {
                            Id               = Reader.GetInt32("id"),
                            State            = ModerationTicketStates.GetStateFromInt(Reader.GetInt32("state")),
                            Timestamp        = Reader.GetInt32("timestamp"),
                            Priority         = Reader.GetInt32("score"),
                            SenderId         = Reader.GetInt32("sender_id"),
                            SenderUsername   = senderUsername,
                            ReportedId       = Reader.GetInt32("reported_id"),
                            ReportedUsername = reportedUsername,
                            ModId            = Reader.GetInt32("mod_id"),
                            ModUsername      = modUsername,
                            Message          = Reader.GetString("issue"),
                            Type             = ModerationTicketTypes.GetTypeFromInt(Reader.GetInt32("type")),
                            RoomId           = Reader.GetInt32("room_id"),
                            Category         = Reader.GetInt32("category")
                        };

                        if (ticket.ModId <= 0)
                        {
                            ticket.ModUsername = "";
                            ticket.State       = ModerationTicketState.OPEN;
                        }

                        tickets.Add(ticket);
                    }
                }
            }
            return(tickets);
        }
Example #8
0
 public void RemoveTicket(ModerationTicket issue)
 {
     this._modTickets.Remove(issue);
 }
Example #9
0
 public void AddTicket(ModerationTicket issue)
 {
     issue.Id = ModerationDatabase.AddTicket(issue);
     this._modTickets.Add(issue);
     Alias.Server.SocketServer.SessionManager.SendWithPermission(new ModerationIssueInfoComposer(issue), "acc_modtool_ticket_queue");
 }