public ModeratorSupportTicketComposer(SupportTicket Ticket)
            : base(ServerPacketHeader.ModeratorSupportTicketMessageComposer)
        {
            base.WriteInteger(Ticket.Id);
            base.WriteInteger(Ticket.TabId);
            base.WriteInteger(1); // Type
            base.WriteInteger(Ticket.Category); // Category
            base.WriteInteger(((int)PlusEnvironment.GetUnixTimestamp() - (int)Ticket.Timestamp) * 1000);
            base.WriteInteger(Ticket.Score);
            base.WriteInteger(0);
            base.WriteInteger(Ticket.SenderId);
            base.WriteString(Ticket.SenderName);
            base.WriteInteger(Ticket.ReportedId);
            base.WriteString(Ticket.ReportedName);
            base.WriteInteger((Ticket.Status == TicketStatus.PICKED) ? Ticket.ModeratorId : 0);
            base.WriteString(Ticket.ModName);
            base.WriteString(Ticket.Message);
            base.WriteInteger(0);//No idea?
            base.WriteInteger(0);//String, int, int - this is the "matched to" a string
            {
                base.WriteString("fresh-hotel.org");
                base.WriteInteger(-1);
                base.WriteInteger(-1);

            }
        }
        public ModeratorTicketChatlogComposer(SupportTicket Ticket, RoomData RoomData, double Timestamp)
            : base(ServerPacketHeader.ModeratorTicketChatlogMessageComposer)
        {
            base.WriteInteger(Ticket.TicketId);
            base.WriteInteger(Ticket.SenderId);
            base.WriteInteger(Ticket.ReportedId);
            base.WriteInteger(RoomData.Id);

            base.WriteByte(1);
            base.WriteShort(2);//Count
           base.WriteString("roomName");
            base.WriteByte(2);
           base.WriteString(RoomData.Name);
           base.WriteString("roomId");
            base.WriteByte(1);
            base.WriteInteger(RoomData.Id);

            base.WriteShort(Ticket.ReportedChats.Count);
            foreach (string Chat in Ticket.ReportedChats)
            {
                Habbo Habbo = PlusEnvironment.GetHabboById(Ticket.ReportedId);

                base.WriteInteger(((int)PlusEnvironment.GetUnixTimestamp() - Convert.ToInt32(Timestamp)) * 1000);
                base.WriteInteger(Ticket.ReportedId);
               base.WriteString(Habbo != null ? Habbo.Username : "******");
               base.WriteString(Chat);
                base.WriteBoolean(false);
            }
        }
 public static void SendTicketToModerators(SupportTicket Ticket)
 {
     PlusEnvironment.GetGame().GetClientManager().SendMessage(new ModeratorSupportTicketComposer(Ticket), "mod_tool");
 }
Beispiel #4
0
 public static void SendTicketToModerators(SupportTicket Ticket)
 {
     PlusEnvironment.GetGame().GetClientManager().SendMessage(new ModeratorSupportTicketComposer(Ticket), "mod_tool");
 }
Beispiel #5
0
        public void SendNewTicket(GameClient Session, int Category, int ReportedUser, String Message, List<string> Messages)
        {
            int TicketId = 0;
            SupportTicket Ticket;

            if (Session.GetHabbo().CurrentRoomId <= 0)
            {
                using (IQueryAdapter dbClient = PlusEnvironment.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','','" + PlusEnvironment.GetUnixTimestamp() + "')");
                    dbClient.AddParameter("message", Message);
                    TicketId = Convert.ToInt32(dbClient.InsertQuery());

                    dbClient.RunQuery("UPDATE `user_info` SET `cfhs` = `cfhs` + '1' WHERE `user_id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
                }

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

                Tickets.Add(Ticket);

                SendTicketToModerators(Ticket);
                return;
            }

            RoomData Data = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(Session.GetHabbo().CurrentRoomId);

            using (IQueryAdapter dbClient = PlusEnvironment.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,'" + PlusEnvironment.GetUnixTimestamp() + "')");
                dbClient.AddParameter("message", Message);
                dbClient.AddParameter("name", Data.Name);
                TicketId = Convert.ToInt32(dbClient.InsertQuery());

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

            Ticket = new SupportTicket(TicketId, 1, 7, Category, Session.GetHabbo().Id, ReportedUser, Message, Data.Id, Data.Name, PlusEnvironment.GetUnixTimestamp(), Messages);
            Tickets.Add(Ticket);
            SendTicketToModerators(Ticket);
        }
Beispiel #6
0
        /// <summary>
        /// Sends the new ticket.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="category">The category.</param>
        /// <param name="type">The type.</param>
        /// <param name="reportedUser">The reported user.</param>
        /// <param name="message">The message.</param>
        /// <param name="messages">The messages.</param>
        internal void SendNewTicket(GameClient session, int category, int type, uint reportedUser, string message,
                                    List <string> messages)
        {
            uint id;

            if (session.GetHabbo().CurrentRoomId <= 0)
            {
                using (IQueryAdapter dbClient = Plus.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.SetQuery(string.Concat(new object[]
                    {
                        "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','','",
                        Plus.GetUnixTimeStamp(),
                        "')"
                    }));
                    dbClient.AddParameter("message", message);
                    id = (uint)dbClient.InsertQuery();
                    dbClient.RunFastQuery(string.Format("UPDATE users_info SET cfhs = cfhs + 1 WHERE user_id = {0}", session.GetHabbo().Id));
                }

                var ticket = new SupportTicket(id, 1, category, type, session.GetHabbo().Id, reportedUser, message, 0u, "",
                                               Plus.GetUnixTimeStamp(), messages);
                this.Tickets.Add(ticket);
                SendTicketToModerators(ticket);
                return;
            }

            RoomData data = Plus.GetGame().GetRoomManager().GenerateNullableRoomData(session.GetHabbo().CurrentRoomId);

            using (IQueryAdapter dbClient = Plus.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery(string.Concat(new object[]
                {
                    "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,'",
                    Plus.GetUnixTimeStamp(),
                    "')"
                }));
                dbClient.AddParameter("message", message);
                dbClient.AddParameter("name", data.Name);
                id = (uint)dbClient.InsertQuery();
                dbClient.RunFastQuery(string.Format("UPDATE users_info SET cfhs = cfhs + 1 WHERE user_id = {0}", session.GetHabbo().Id));
            }
            var ticket2 = new SupportTicket(id, 1, category, type, session.GetHabbo().Id, reportedUser, message, data.Id, data.Name,
                                            Plus.GetUnixTimeStamp(), messages);

            this.Tickets.Add(ticket2);
            SendTicketToModerators(ticket2);
        }
Beispiel #7
0
 /// <summary>
 /// Sends the ticket update to moderators.
 /// </summary>
 /// <param name="ticket">The ticket.</param>
 internal static void SendTicketUpdateToModerators(SupportTicket ticket)
 {
 }