Esempio n. 1
0
        internal static void SendTicketToModerators(SupportTicket Ticket)
        {
            ServerMessage Response = PacketHandelingManager.GetRecycledItem(OutputCode.IssueInfoMessageEvent);

            Response = Ticket.Serialize(Response);

            ButterflyEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(Response, "fuse_mod");
        }
Esempio n. 2
0
        internal static ServerMessage SerializeTicketChatlog(SupportTicket Ticket, RoomData RoomData, Double Timestamp)
        {
            Room currentRoom = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(RoomData.Id);

            ServerMessage Message = PacketHandelingManager.GetRecycledItem(OutputCode.CfhChatlogEvent);
            Message.AddUInt32(Ticket.TicketId);
            Message.AddUInt32(Ticket.SenderId);
            Message.AddUInt32(Ticket.ReportedId);
            Message.AddBoolean(false);
            Message.AddUInt32(RoomData.Id);
            Message.AddString(RoomData.Name);

            if (currentRoom == null)
            {
                Message.AddInt32(0);
                return Message;
            }
            else
            {
                ChatMessageManager manager = currentRoom.GetChatMessageManager();
                Message.AddInt32(manager.messageCount);
                manager.Serialize(ref Message);

                return Message;
            }
        }
Esempio n. 3
0
        internal static ServerMessage SerializeTicketChatlog(SupportTicket Ticket, RoomData RoomData, Double Timestamp)
        {
            Room currentRoom = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(RoomData.Id);

            ServerMessage Message = new ServerMessage(534);

            Message.AppendUInt(Ticket.TicketId);
            Message.AppendUInt(Ticket.SenderId);
            Message.AppendUInt(Ticket.ReportedId);
            Message.AppendBoolean(RoomData.IsPublicRoom);
            Message.AppendUInt(RoomData.Id);
            Message.AppendStringWithBreak(RoomData.Name);

            if (currentRoom == null)
            {
                Message.AppendInt32(0);
                return(Message);
            }
            else
            {
                ChatMessageManager manager = currentRoom.GetChatMessageManager();
                Message.AppendInt32(manager.messageCount);
                manager.Serialize(ref Message);

                return(Message);
            }


            //using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            //{
            //    dbClient.setQuery("SELECT user_id,user_name,hour,minute,message FROM chatlogs WHERE room_id = " + RoomData.Id + " AND timestamp >= " + (Timestamp - 300) + " AND timestamp <= " + Timestamp + " ORDER BY timestamp DESC");
            //    DataTable Data = dbClient.getTable();

            //    ServerMessage Message = new ServerMessage(534);
            //    Message.AppendUInt(Ticket.TicketId);
            //    Message.AppendUInt(Ticket.SenderId);
            //    Message.AppendUInt(Ticket.ReportedId);
            //    Message.AppendBoolean(RoomData.IsPublicRoom);
            //    Message.AppendUInt(RoomData.Id);
            //    Message.AppendStringWithBreak(RoomData.Name);

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

            //        foreach (DataRow Row in Data.Rows)
            //        {
            //            Message.AppendInt32((int)Row["hour"]);
            //            Message.AppendInt32((int)Row["minute"]);
            //            Message.AppendUInt((UInt32)Row["user_id"]);
            //            Message.AppendStringWithBreak((String)Row["user_name"]);
            //            Message.AppendStringWithBreak((String)Row["message"]);
            //        }
            //    }
            //    else
            //    {
            //        Message.AppendInt32(0);
            //    }

            //    return Message;
            //}
        }
Esempio n. 4
0
        internal void SendNewTicket(GameClient GetClient, int Type, int Category, uint ReportedUser, uint Roomid, string Message)
        {
            RoomData Data = ButterflyEnvironment.GetGame().GetRoomManager().GenerateNullableRoomData(Roomid);

            Roomid = Data == null ? 0 : Data.Id;

            uint TicketId = 0;

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

                dbClient.setQuery("UPDATE `user_info` SET cfhs = cfhs + 1 WHERE user_id = @id LIMIT 1;");
                dbClient.addParameter("id", GetClient.GetHabbo().Id);
                dbClient.runQuery();
            }

            SupportTicket Ticket = new SupportTicket(TicketId, 1, Type, Category, GetClient.GetHabbo().Id, ReportedUser, Message, Data.Id, Data.Name, ButterflyEnvironment.GetUnixTimestamp());

            lock (Tickets)
                Tickets.Add(Ticket);

            SendTicketToModerators(Ticket);
        }
Esempio n. 5
0
 internal static void SendTicketToModerators(SupportTicket Ticket)
 {
     ButterflyEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(Ticket.Serialize(), "fuse_mod");
 }
Esempio n. 6
0
 public static void SendTicketToModerators(SupportTicket Ticket)
 {
     ButterflyEnvironment.GetGame().GetClientManager().SendMessageStaff(Ticket.Serialize());
 }
Esempio n. 7
0
        internal void SendNewTicket(GameClient Session, int Category, uint ReportedUser, String Message)
        {
            if (Session.GetHabbo().CurrentRoomId <= 0)
            {
                return;
            }

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

            uint TicketId = 0;

            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                if (dbClient.dbType == Database_Manager.Database.DatabaseType.MSSQL)
                    dbClient.setQuery("INSERT INTO moderation_tickets (score,type,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp) OUTPUT INSERTED.* VALUES (1,'" + Category + "','open','" + Session.GetHabbo().Id + "','" + ReportedUser + "','0',@message,'" + Data.Id + "',@name,'" + ButterflyEnvironment.GetUnixTimestamp() + "')");
                else
                    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,'" + ButterflyEnvironment.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];
            }

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

            Tickets.Add(Ticket);

            SendTicketToModerators(Ticket);
        }
Esempio n. 8
0
        internal static ServerMessage SerializeTicketChatlog(SupportTicket Ticket, RoomData RoomData, Double Timestamp)
        {
            Room currentRoom = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(RoomData.Id);

            ServerMessage Message = new ServerMessage(534);
            Message.AppendUInt(Ticket.TicketId);
            Message.AppendUInt(Ticket.SenderId);
            Message.AppendUInt(Ticket.ReportedId);
            Message.AppendBoolean(RoomData.IsPublicRoom);
            Message.AppendUInt(RoomData.Id);
            Message.AppendStringWithBreak(RoomData.Name);

            if (currentRoom == null)
            {
                Message.AppendInt32(0);
                return Message;
            }
            else
            {
                ChatMessageManager manager = currentRoom.GetChatMessageManager();
                Message.AppendInt32(manager.messageCount);
                manager.Serialize(ref Message);

                return Message;
            }

            //using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            //{
            //    dbClient.setQuery("SELECT user_id,user_name,hour,minute,message FROM chatlogs WHERE room_id = " + RoomData.Id + " AND timestamp >= " + (Timestamp - 300) + " AND timestamp <= " + Timestamp + " ORDER BY timestamp DESC");
            //    DataTable Data = dbClient.getTable();

            //    ServerMessage Message = new ServerMessage(534);
            //    Message.AppendUInt(Ticket.TicketId);
            //    Message.AppendUInt(Ticket.SenderId);
            //    Message.AppendUInt(Ticket.ReportedId);
            //    Message.AppendBoolean(RoomData.IsPublicRoom);
            //    Message.AppendUInt(RoomData.Id);
            //    Message.AppendStringWithBreak(RoomData.Name);

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

            //        foreach (DataRow Row in Data.Rows)
            //        {
            //            Message.AppendInt32((int)Row["hour"]);
            //            Message.AppendInt32((int)Row["minute"]);
            //            Message.AppendUInt((UInt32)Row["user_id"]);
            //            Message.AppendStringWithBreak((String)Row["user_name"]);
            //            Message.AppendStringWithBreak((String)Row["message"]);
            //        }
            //    }
            //    else
            //    {
            //        Message.AppendInt32(0);
            //    }

            //    return Message;
            //}
        }
Esempio n. 9
0
 internal static void SendTicketToModerators(SupportTicket Ticket)
 {
     ButterflyEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(Ticket.Serialize(), "fuse_mod");
 }