Beispiel #1
0
        internal void SendNewTicket(GameClient Session, int Category, uint ReportedUser, string Message, int type, List <string> Messages)
        {
            UInt32 Id = 0;

            if (Session.GetHabbo().CurrentRoomId <= 0)
            {
                using (IQueryAdapter DBClient = CyberEnvironment.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','','",
                        CyberEnvironment.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, type, Session.GetHabbo().Id, ReportedUser, Message, 0u, "", (double)CyberEnvironment.GetUnixTimestamp(), Messages);
                this.Tickets.Add(Ticket);
                ModerationTool.SendTicketToModerators(Ticket);
                return;
            }

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

            using (IQueryAdapter DBClient = CyberEnvironment.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,'",
                    CyberEnvironment.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, type, Session.GetHabbo().Id, ReportedUser, Message, 0u, "", (double)CyberEnvironment.GetUnixTimestamp(), Messages);

            this.Tickets.Add(Ticket2);
            ModerationTool.SendTicketToModerators(Ticket2);
        }
Beispiel #2
0
        internal void ReleaseTicket(GameClient Session, uint TicketId)
        {
            SupportTicket ticket = this.GetTicket(TicketId);

            if (ticket == null || ticket.Status != TicketStatus.PICKED || ticket.ModeratorId != Session.GetHabbo().Id)
            {
                return;
            }
            ticket.Release(true);
            ModerationTool.SendTicketToModerators(ticket);
        }
Beispiel #3
0
        internal void PickTicket(GameClient Session, uint TicketId)
        {
            SupportTicket ticket = this.GetTicket(TicketId);

            if (ticket == null || ticket.Status != TicketStatus.OPEN)
            {
                return;
            }
            ticket.Pick(Session.GetHabbo().Id, true);
            ModerationTool.SendTicketToModerators(ticket);
        }
Beispiel #4
0
 internal void DeletePendingTicketForUser(uint Id)
 {
     foreach (SupportTicket current in this.Tickets)
     {
         if (current.SenderId == Id)
         {
             current.Delete(true);
             ModerationTool.SendTicketToModerators(current);
             break;
         }
     }
 }
Beispiel #5
0
        internal void CloseTicket(GameClient Session, uint TicketId, int Result)
        {
            SupportTicket ticket = this.GetTicket(TicketId);

            if (ticket == null || ticket.Status != TicketStatus.PICKED || ticket.ModeratorId != Session.GetHabbo().Id)
            {
                return;
            }
            GameClient   clientByUserID = CyberEnvironment.GetGame().GetClientManager().GetClientByUserID(ticket.SenderId);
            int          i = 0;
            TicketStatus newStatus;

            switch (Result)
            {
            case 1:
                i         = 1;
                newStatus = TicketStatus.INVALID;
                goto IL_9E;

            case 2:
                i         = 2;
                newStatus = TicketStatus.ABUSIVE;
                using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
                {
                    queryreactor.runFastQuery("UPDATE user_info SET cfhs_abusive = cfhs_abusive + 1 WHERE user_id = " + ticket.SenderId);
                    goto IL_9E;
                }
            }
            i         = 0;
            newStatus = TicketStatus.RESOLVED;
IL_9E:
            if (clientByUserID != null && (ticket.Type != 3 && ticket.Type != 4))
            {
                clientByUserID.GetMessageHandler().GetResponse().Init(Outgoing.ModerationToolUpdateIssueMessageComposer);
                clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                clientByUserID.GetMessageHandler().GetResponse().AppendUInt(ticket.TicketId);
                clientByUserID.GetMessageHandler().GetResponse().AppendUInt(ticket.ModeratorId);
                clientByUserID.GetMessageHandler().GetResponse().AppendString((CyberEnvironment.getHabboForId(ticket.ModeratorId) != null) ? CyberEnvironment.getHabboForId(ticket.ModeratorId).Username : "******");
                clientByUserID.GetMessageHandler().GetResponse().AppendBoolean(false);
                clientByUserID.GetMessageHandler().GetResponse().AppendInt32(0);
                clientByUserID.GetMessageHandler().GetResponse().Init(Outgoing.ModerationTicketResponseMessageComposer);
                clientByUserID.GetMessageHandler().GetResponse().AppendInt32(i);
                clientByUserID.GetMessageHandler().SendResponse();
            }
            using (IQueryAdapter queryreactor2 = CyberEnvironment.GetDatabaseManager().getQueryReactor())
            {
                queryreactor2.runFastQuery("UPDATE user_stats SET tickets_answered = tickets_answered+1 WHERE id=" + Session.GetHabbo().Id + " LIMIT 1");
            }
            ticket.Close(newStatus, true);
            ModerationTool.SendTicketToModerators(ticket);
        }
Beispiel #6
0
		internal Game(int conns)
		{
            Logging.WriteLine("Starting modules...");
			this.ClientManager = new GameClientManager();
			this.BanManager = new ModerationBanManager();
			this.RoleManager = new RoleManager();
			this.Navigator = new Navigator();
			this.ItemManager = new ItemManager();
			this.Catalog = new Catalog();
			this.RoomManager = new RoomManager();
			this.PixelManager = new PixelManager();
			this.HotelView = new HotelView();
			this.ModerationTool = new ModerationTool();
			this.BotManager = new BotManager();
			this.questManager = new QuestManager();
			this.Events = new RoomEvents();
			this.groupManager = new GroupManager();
			this.talentManager = new TalentManager();
			this.VideoManager = new VideoManager();
			this.PinataHandler = new PinataHandler();
			this.PollManager = new PollManager();
            this.AntiMutant = new AntiMutant();
		}