Пример #1
0
        internal static ServerMessage SerializeTicketChatlog(SupportTicket Ticket, RoomData RoomData, Double Timestamp)
        {
            using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("SELECT user_id,timestamp,message FROM chatlogs WHERE room_id = " + RoomData.Id + " AND (timestamp >= " + (Timestamp - 300) + " AND timestamp <= " + Timestamp + ") OR (timestamp >= " + (Timestamp - 300) + " AND timestamp = 0) ORDER BY timestamp DESC LIMIT 150");
                DataTable Data = dbClient.getTable();

                ServerMessage Message = new ServerMessage(Outgoing.IssueChatlog);
                Message.AppendInt32(Ticket.TicketId);
                Message.AppendInt32(Ticket.SenderId);
                Message.AppendInt32(Ticket.ReportedId);
                Message.AppendInt32(RoomData.Id);
                Message.AppendBoolean(false); // Public room
                Message.AppendInt32(RoomData.Id);
                Message.AppendString(RoomData.Name);

                if (Data != null)
                {
                    Message.AppendInt32(Data.Rows.Count);

                    foreach (DataRow Row in Data.Rows)
                    {
                        Habbo Habbo = SilverwaveEnvironment.getHabboForId(Convert.ToUInt32(Row["user_id"]));
                        DateTime Time = SilverwaveEnvironment.UnixToDateTime(Convert.ToDouble(Row["timestamp"]));
                        //Message.AppendInt32(Time.Hour);
                        Message.AppendInt32(Time.Minute);
                        Message.AppendInt32(Habbo.Id);
                        Message.AppendString(Habbo.Username);
                        Message.AppendString((String)Row["message"]);
                    }
                }
                else
                {
                    Message.AppendInt32(0);
                }

                return Message;
            }
        }
Пример #2
0
 internal static void SendTicketToModerators(SupportTicket Ticket)
 {
     ServerMessage Response = new ServerMessage(Outgoing.SerializeIssue);
     Response = Ticket.Serialize(Response);
     SilverwaveEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(Response, "fuse_mod");
 }
Пример #3
0
        internal void SendNewTicket(GameClient Session, int Category, uint ReportedUser, String Message)
        {
            uint TicketId = 0;
            SupportTicket Ticket;
            if (Session.GetHabbo().CurrentRoomId <= 0)
            {
                using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.setQuery("INSERT INTO moderation_tickets (score,type,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp) VALUES (1,'" + Category + "','open','" + Session.GetHabbo().Id + "','" + ReportedUser + "','0',@message,'0','','" + SilverwaveEnvironment.GetUnixTimestamp() + "')");
                    dbClient.addParameter("message", Message);
                    TicketId = (uint)dbClient.insertQuery();

                    dbClient.runFastQuery("UPDATE user_info SET cfhs = cfhs + 1 WHERE user_id = " + Session.GetHabbo().Id + "");
                }

                Ticket = new SupportTicket(TicketId, 1, 7, Session.GetHabbo().Id, ReportedUser, Message, 0, "", SilverwaveEnvironment.GetUnixTimestamp());

                Tickets.Add(Ticket);

                SendTicketToModerators(Ticket);
                return;
            }

            RoomData Data = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateNullableRoomData(Session.GetHabbo().CurrentRoomId);



            using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("INSERT INTO moderation_tickets (score,type,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp) VALUES (1,'" + Category + "','open','" + Session.GetHabbo().Id + "','" + ReportedUser + "','0',@message,'" + Data.Id + "',@name,'" + SilverwaveEnvironment.GetUnixTimestamp() + "')");
                dbClient.addParameter("message", Message);
                dbClient.addParameter("name", Data.Name);
                TicketId = (uint)dbClient.insertQuery();

                dbClient.runFastQuery("UPDATE user_info SET cfhs = cfhs + 1 WHERE user_id = " + Session.GetHabbo().Id + "");

                //dbClient.setQuery("SELECT id FROM moderation_tickets WHERE sender_id = " + Session.GetHabbo().Id + " ORDER BY id DESC LIMIT 1");
                //TicketId = (uint)dbClient.getRow()[0];
            }

            Ticket = new SupportTicket(TicketId, 1, 7, Session.GetHabbo().Id, ReportedUser, Message, Data.Id, Data.Name, SilverwaveEnvironment.GetUnixTimestamp());

            Tickets.Add(Ticket);

            SendTicketToModerators(Ticket);
        }
Пример #4
0
 internal static void SendTicketUpdateToModerators(SupportTicket Ticket)
 {
     //SilverwaveEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(Ticket.SerializeUpdate(), "fuse_mod");
 }
Пример #5
0
        internal void SendNewTicket(GameClient Session, int Category, uint ReportedUser, string Message, List<string> Messages)
        {
            UInt32 Id = 0;


            if (Session.GetHabbo().CurrentRoomId <= 0)
            {
                using (IQueryAdapter DBClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    DBClient.setQuery(string.Concat(new object[]
                        {
                            "INSERT INTO moderation_tickets (score,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp) VALUES (1,'open','",
                            Session.GetHabbo().Id,
                            "','",
                            ReportedUser,
                            "','0',@message,'0','','",
                            SilverwaveEnvironment.GetUnixTimestamp(),
                            "')"
                        }));
                    DBClient.addParameter("message", Message);
                    Id = (uint)DBClient.insertQuery();
                    DBClient.runFastQuery("UPDATE user_info SET cfhs = cfhs + 1 WHERE user_id = " + Session.GetHabbo().Id);
                }


                SupportTicket Ticket = new SupportTicket(Id, 1, Session.GetHabbo().Id, ReportedUser, Message, 0, "", (double)SilverwaveEnvironment.GetUnixTimestamp(), Messages);
                this.Tickets.Add(Ticket);
                ModerationTool.SendTicketToModerators(Ticket);
                return;
            }


            RoomData Data = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateNullableRoomData(Session.GetHabbo().CurrentRoomId);
            using (IQueryAdapter DBClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                DBClient.setQuery(string.Concat(new object[]
                    {
                        "INSERT INTO moderation_tickets (score,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp) VALUES (1,'open','",
                        Session.GetHabbo().Id,
                        "','",
                        ReportedUser,
                        "','0',@message,'",
                        Data.Id,
                        "',@name,'",
                        SilverwaveEnvironment.GetUnixTimestamp(),
                        "')"
                    }));
                DBClient.addParameter("message", Message);
                DBClient.addParameter("name", Data.Name);
                Id = (uint)DBClient.insertQuery();
                DBClient.runFastQuery("UPDATE user_info SET cfhs = cfhs + 1 WHERE user_id = " + Session.GetHabbo().Id);
            }
            SupportTicket Ticket2 = new SupportTicket(Id, 1, Session.GetHabbo().Id, ReportedUser, Message, 0, "", (double)SilverwaveEnvironment.GetUnixTimestamp(), Messages);
            this.Tickets.Add(Ticket2);
            ModerationTool.SendTicketToModerators(Ticket2);
        }