Esempio n. 1
0
 public void Execute(GameClient Session, Room Room, string[] Params)
 {
     if (Session != null)
     {
         if (Room != null)
         {
             if (Params.Length != 1)
             {
                 Session.SendWhisper("Invalid command! :eventalert", 0);
             }
             else if (!PlusEnvironment.Event)
             {
                 PlusEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(":follow " + Session.GetHabbo().Username + " for events! win prizes!\r\n- " + Session.GetHabbo().Username, ""), "");
                 PlusEnvironment.lastEvent = DateTime.Now;
                 PlusEnvironment.Event = true;
             }
             else
             {
                 TimeSpan timeSpan = DateTime.Now - PlusEnvironment.lastEvent;
                 if (timeSpan.Hours >= 1)
                 {
                     PlusEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(":follow " + Session.GetHabbo().Username + " for events! win prizes!\r\n- " + Session.GetHabbo().Username, ""), "");
                     PlusEnvironment.lastEvent = DateTime.Now;
                 }
                 else
                 {
                     int num = checked(60 - timeSpan.Minutes);
                     Session.SendWhisper("Event Cooldown! " + num + " minutes left until another event can be hosted.", 0);
                 }
             }
         }
     }
 }
Esempio n. 2
0
        public void Execute(GameClient Session, Room Room, string[] Params)
        {
            if (!Room.CheckRights(Session, true))
                return;

            if (Params.Length == 1)
            {
                Session.SendWhisper("Oops, you forgot to choose a price to sell the room for.");
                return;
            }
            else if (Room.Group != null)
            {
                Session.SendWhisper("Oops, this room has a group. You must delete the group before you can sell the room.");
                return;
            }

            int Price = 0;
            if (!int.TryParse(Params[1], out Price))
            {
                Session.SendWhisper("Oops, you've entered an invalid integer.");
                return;
            }

            if (Price == 0)
            {
                Session.SendWhisper("Oops, you cannot sell a room for 0 credits.");
                return;
            }

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("UPDATE `rooms` SET `sale_price` = @SalePrice WHERE `id` = @Id LIMIT 1");
                dbClient.AddParameter("SalePrice", Price);
                dbClient.AddParameter("Id", Room.Id);
                dbClient.RunQuery();
            }

            Session.SendNotification("Your room is now up for sale. The the current room visitors have been alerted, any item that belongs to you in this room will be transferred to the new owner once purchased. Other items shall be ejected.");

            foreach (RoomUser User in Room.GetRoomUserManager().GetRoomUsers())
            {
                if (User == null || User.GetClient() == null)
                    continue;

                User.GetClient().SendWhisper("Attention! This room has been put up for sale, you can buy it now for " + Price + " credits! Use the :buyroom command.");
            }
        }
Esempio n. 3
0
        internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            // Is this user valid?
            if (Item == null || Item.GetRoom() == null || Session == null || Session.GetHabbo() == null)
                return;
            RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            User.LastInteraction = PlusEnvironment.GetUnixTimestamp();
            if (User == null)
            {
                return;
            }

            if ((User.LastInteraction - PlusEnvironment.GetUnixTimestamp() < 0) && User.InteractingGate && User.GateId == Item.Id)
            {
                User.InteractingGate = false;
                User.GateId = 0;
            }

            if (!User.InteractingGate && User.GateId != Item.Id && Item.TollPrice > 0)
            {
                if (Session.GetHabbo().Credits < Item.TollPrice)
                {
                    Session.SendNotif("You have not got enough credits to get through this gate.\n" +
                        "You need atleast " + Item.TollPrice + " to get through this gate");
                    return;
                }
                Session.SendWhisper("This gate has a toll of " + Item.TollPrice + " credits.");
                Session.SendWhisper("To continue through it, double click again!");
                User.InteractingGate = true;
                User.GateId = Item.Id;
                User.LastInteraction = PlusEnvironment.GetUnixTimestamp() + 7;
                return;
            }

            // Alright. But is this user in the right position?
            if (User.Coordinate == Item.Coordinate || User.Coordinate == Item.SquareInFront)
            {
                // Fine. But is this tele even free?
                if (Item.InteractingUser != 0)
                {
                    return;
                }

                if (!User.CanWalk || Session.GetHabbo().IsTeleporting || Session.GetHabbo().TeleporterId != 0 || (User.LastInteraction + 2) - PlusEnvironment.GetUnixTimestamp() < 0)
                    return;

                if (Item.TollPrice > 0 && Session.GetHabbo().Credits > Item.TollPrice)
                {
                    Habbo Data = PlusEnvironment.getHabboForId(Convert.ToUInt32(Item.GetRoom().OwnerId));
                    if (Data != null)
                    {
                        using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
                        {
                            dbClient.setQuery("SELECT online FROM users WHERE id=" + Data.Id + " LIMIT 1");
                            string online = dbClient.getString();
                            if (online == "0")
                            {
                                dbClient.runFastQuery("UPDATE users SET credits = credits+" + Item.TollPrice + " WHERE id=" + Data.Id + " LIMIT 1");
                            }
                            else if (online == "1")
                            {
                                GameClient H = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(Data.Id);
                                H.GetHabbo().Credits += Item.TollPrice;
                                H.GetHabbo().UpdateCreditsBalance();
                            }
                            else
                            {
                                Session.SendWhisper("An error occured!");
                                return;
                            }
                        }
                    }
                    Session.GetHabbo().Credits -= Item.TollPrice;
                    Session.GetHabbo().UpdateCreditsBalance();
                }
                else if (Session.GetHabbo().Credits < Item.TollPrice)
                {
                    User.InteractingGate = false;
                    User.GateId = 0;
                    return;
                }

                User.TeleDelay = 2;
                Item.InteractingUser = User.GetClient().GetHabbo().Id;

            }
            else if (User.CanWalk)
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
Esempio n. 4
0
        internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            if (Session == null)
                return;
            RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (Item.InteractingUser2 != User.userID)
                Item.InteractingUser2 = User.userID;

            if (User == null)
            {
                return;
            }

            if (User.Coordinate != Item.SquareInFront && User.CanWalk)
            {
                User.MoveTo(Item.SquareInFront);
                return;
            }
            if (!Item.GetRoom().GetGameMap().ValidTile(Item.SquareBehind.X, Item.SquareBehind.Y) || !Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, false)
                || !Item.GetRoom().GetGameMap().SquareIsOpen(Item.SquareBehind.X, Item.SquareBehind.Y, false))
            {
                return;
            }

            if ((User.LastInteraction - PlusEnvironment.GetUnixTimestamp() < 0) && User.InteractingGate && User.GateId == Item.Id)
            {
                User.InteractingGate = false;
                User.GateId = 0;
            }

            if (!User.InteractingGate && User.GateId != Item.Id && Item.TollPrice > 0)
            {
                if (Session.GetHabbo().Credits < Item.TollPrice)
                {
                    Session.SendNotif("You have not got enough credits to get through this gate.\n" +
                        "You need atleast " + Item.TollPrice + " to get through this gate");
                    return;
                }
                Session.SendWhisper("This gate has a toll of " + Item.TollPrice + " credits.");
                Session.SendWhisper("To continue through it, double click again!");
                User.InteractingGate = true;
                User.GateId = Item.Id;
                User.LastInteraction = PlusEnvironment.GetUnixTimestamp() + 7;
                return;
            }

            if (!Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, User.AllowOverride))
            {
                return;
            }

            if (Item.InteractingUser == 0)
            {
                User.InteractingGate = true;
                User.GateId = Item.Id;
                Item.InteractingUser = User.HabboId;

                User.CanWalk = false;

                if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y))
                {
                    User.ClearMovement(true);
                }

                if (Item.TollPrice > 0 && Session.GetHabbo().Credits > Item.TollPrice)
                {
                    Habbo Data = PlusEnvironment.getHabboForId(Convert.ToUInt32(Item.GetRoom().OwnerId));
                    if (Data != null)
                    {
                        using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
                        {
                            dbClient.setQuery("SELECT online FROM users WHERE id=" + Data.Id + " LIMIT 1");
                            string online = dbClient.getString();
                            if (online == "0")
                            {
                                dbClient.runFastQuery("UPDATE users SET credits = credits+" + Item.TollPrice + " WHERE id=" + Data.Id + " LIMIT 1");
                            }
                            else if (online == "1")
                            {
                                GameClient H = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(Data.Id);
                                H.GetHabbo().Credits += Item.TollPrice;
                                H.GetHabbo().UpdateCreditsBalance();
                            }
                            else
                            {
                                Session.SendWhisper("An error occured!");
                                return;
                            }
                        }
                    }
                    Session.GetHabbo().Credits -= Item.TollPrice;
                    Session.GetHabbo().UpdateCreditsBalance();
                }
                else if (Session.GetHabbo().Credits < Item.TollPrice)
                {
                    User.InteractingGate = false;
                    User.GateId = 0;
                    return;
                }

                User.AllowOverride = true;
                User.MoveTo(Item.Coordinate);

                Item.ReqUpdate(4, true);
            }
        }
Esempio n. 5
0
        public void Execute(GameClient session, Room room, string[] Params)
        {
            if (Params.Length == 1)
            {
                session.SendWhisper("Please enter a currency type! (coins, duckets, diamonds, gotw)");
                return;
            }

            string updateVal = Params[1];
            switch (updateVal.ToLower())
            {
                case "coins":
                case "credits":
                    {
                        if (!session.GetHabbo().GetPermissions().HasCommand("command_give_coins"))
                        {
                            session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
                            break;
                        }
                        int amount;
                        if (int.TryParse(Params[2], out amount))
                        {
                            foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
                            {
                                client.GetHabbo().Credits += amount;
                                client.SendMessage(new CreditBalanceComposer(client.GetHabbo().Credits));
                            }
                            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                            {
                                dbClient.RunQuery("UPDATE users SET credits = credits + " + amount);
                            }
                            break;
                        }
                        session.SendWhisper("Oops, that appears to be an invalid amount!");
                        break;
                    }
                case "pixels":
                case "duckets":
                    {
                        if (!session.GetHabbo().GetPermissions().HasCommand("command_give_pixels"))
                        {
                            session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
                            break;
                        }
                        int amount;
                        if (int.TryParse(Params[2], out amount))
                        {
                            foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
                            {
                                client.GetHabbo().Duckets += amount;
                                client.SendMessage(new HabboActivityPointNotificationComposer(
                                    client.GetHabbo().Duckets, amount));
                            }
                            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                            {
                                dbClient.RunQuery("UPDATE users SET activity_points = activity_points + " + amount);
                            }
                            break;
                        }
                        session.SendWhisper("Oops, that appears to be an invalid amount!");
                        break;
                    }
                case "diamonds":
                    {
                        if (!session.GetHabbo().GetPermissions().HasCommand("command_give_diamonds"))
                        {
                            session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
                            break;
                        }
                        int amount;
                        if (int.TryParse(Params[2], out amount))
                        {
                            foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
                            {
                                client.GetHabbo().Diamonds += amount;
                                client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().Diamonds,
                                    amount,
                                    5));
                            }
                            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                            {
                                dbClient.RunQuery("UPDATE users SET vip_points = vip_points + " + amount);
                            }
                            break;
                        }
                        session.SendWhisper("Oops, that appears to be an invalid amount!");
                        break;
                    }
                case "gotw":
                case "gotwpoints":
                    {
                        if (!session.GetHabbo().GetPermissions().HasCommand("command_give_gotw"))
                        {
                            session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
                            break;
                        }
                        int amount;
                        if (int.TryParse(Params[2], out amount))
                        {
                            foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
                            {
                                client.GetHabbo().GOTWPoints = client.GetHabbo().GOTWPoints + amount;
                                client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().GOTWPoints,
                                    amount, 103));
                            }
                            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                            {
                                dbClient.RunQuery("UPDATE users SET gotw_points = gotw_points + " + amount);
                            }
                            break;
                        }
                        session.SendWhisper("Oops, that appears to be an invalid amount!");
                        break;
                    }
            }
        }
Esempio n. 6
0
        public void Execute(GameClient session, Room room, string[] Params)
        {
            if (Params.Length == 1)
            {
                session.SendWhisper("Please enter a currency type! (coins, duckets, diamonds, gotw)");
                return;
            }

            var updateVal = Params[1];
            switch (updateVal.ToLower())
            {
                case "coins":
                case "credits":
                    {
                        if (!session.GetHabbo().GetPermissions().HasCommand("command_give_coins"))
                        {
                            session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
                            break;
                        }
                        int amount;
                        if (int.TryParse(Params[2], out amount))
                        {
                            foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
                            {
                                client.GetHabbo().Credits = client.GetHabbo().Credits += amount;
                                client.SendMessage(new CreditBalanceComposer(client.GetHabbo().Credits));

                                if (client.GetHabbo().Id != session.GetHabbo().Id)
                                    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
                                                            " Credit(s)!");
                                session.SendWhisper("Successfully given " + amount + " Credit(s) to " +
                                                    client.GetHabbo().Username + "!");
                            }

                            break;
                        }
                        session.SendWhisper("Oops, that appears to be an invalid amount!");
                        break;
                    }

                case "pixels":
                case "duckets":
                    {
                        if (!session.GetHabbo().GetPermissions().HasCommand("command_give_pixels"))
                        {
                            session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
                            break;
                        }
                        int amount;
                        if (int.TryParse(Params[2], out amount))
                        {
                            foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
                            {
                                client.GetHabbo().Duckets += amount;
                                client.SendMessage(new HabboActivityPointNotificationComposer(
                                    client.GetHabbo().Duckets, amount));

                                if (client.GetHabbo().Id != session.GetHabbo().Id)
                                    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
                                                            " Ducket(s)!");
                                session.SendWhisper("Successfully given " + amount + " Ducket(s) to " +
                                                    client.GetHabbo().Username + "!");
                            }
                            break;
                        }
                        session.SendWhisper("Oops, that appears to be an invalid amount!");
                        break;
                    }

                case "diamonds":
                    {
                        if (!session.GetHabbo().GetPermissions().HasCommand("command_give_diamonds"))
                        {
                            session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
                            break;
                        }
                        int amount;
                        if (int.TryParse(Params[2], out amount))
                        {
                            foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
                            {
                                client.GetHabbo().Diamonds += amount;
                                client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().Diamonds,
                                    amount,
                                    5));

                                if (client.GetHabbo().Id != session.GetHabbo().Id)
                                    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
                                                            " Diamond(s)!");
                                session.SendWhisper("Successfully given " + amount + " Diamond(s) to " +
                                                    client.GetHabbo().Username + "!");
                            }

                            break;
                        }
                        session.SendWhisper("Oops, that appears to be an invalid amount!");
                        break;
                    }

                case "gotw":
                case "gotwpoints":
                    {
                        if (!session.GetHabbo().GetPermissions().HasCommand("command_give_gotw"))
                        {
                            session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
                            break;
                        }
                        int amount;
                        if (int.TryParse(Params[2], out amount))
                        {
                            foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
                            {
                                client.GetHabbo().GOTWPoints = client.GetHabbo().GOTWPoints + amount;
                                client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().GOTWPoints,
                                    amount, 103));

                                if (client.GetHabbo().Id != session.GetHabbo().Id)
                                    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
                                                            " GOTW Point(s)!");
                                session.SendWhisper("Successfully given " + amount + " GOTW point(s) to " +
                                                    client.GetHabbo().Username + "!");
                            }
                            break;
                        }
                        session.SendWhisper("Oops, that appears to be an invalid amount!");
                        break;
                    }
                default:
                    session.SendWhisper("'" + updateVal + "' is not a valid currency!");
                    break;
            }
        }
Esempio n. 7
0
        public void Parse(GameClient Session, ClientPacket Packet)
        {
            if (!Session.GetHabbo().InRoom)
                return;

            Room Room = Session.GetHabbo().CurrentRoom;
            if (Room == null)
                return;

            if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool") && Room.CheckMute(Session))
            {
                Session.SendWhisper("Oops, you're currently muted.");
                return;
            }

            if (PlusEnvironment.GetUnixTimestamp() < Session.GetHabbo().FloodTime && Session.GetHabbo().FloodTime != 0)
                return;

            string Params = Packet.PopString();
            string ToUser = Params.Split(' ')[0];
            string Message = Params.Substring(ToUser.Length + 1);
            int Colour = Packet.PopInt();

            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
                return;

            RoomUser User2 = Room.GetRoomUserManager().GetRoomUserByHabbo(ToUser);
            if (User2 == null)
                return;

            if (Session.GetHabbo().TimeMuted > 0)
            {
                Session.SendMessage(new MutedComposer(Session.GetHabbo().TimeMuted));
                return;
            }

            if (!Session.GetHabbo().GetPermissions().HasRight("word_filter_override"))
                Message = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Message);

            ChatStyle Style = null;
            if (!PlusEnvironment.GetGame().GetChatManager().GetChatStyles().TryGetStyle(Colour, out Style) || (Style.RequiredRight.Length > 0 && !Session.GetHabbo().GetPermissions().HasRight(Style.RequiredRight)))
                Colour = 0;

            User.LastBubble = Session.GetHabbo().CustomBubbleId == 0 ? Colour : Session.GetHabbo().CustomBubbleId;

            if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
            {
                int MuteTime;
                if (User.IncrementAndCheckFlood(out MuteTime))
                {
                    Session.SendMessage(new FloodControlComposer(MuteTime));
                    return;
                }
            }

            if (!User2.GetClient().GetHabbo().ReceiveWhispers && !Session.GetHabbo().GetPermissions().HasRight("room_whisper_override"))
            {
                Session.SendWhisper("Oops, this user has their whispers disabled!");
                return;
            }

            PlusEnvironment.GetGame().GetChatManager().GetLogs().StoreChatlog(new Plus.HabboHotel.Rooms.Chat.Logs.ChatlogEntry(Session.GetHabbo().Id, Room.Id, "<Whisper to " + ToUser + ">: " + Message, UnixTimestamp.GetNow(), Session.GetHabbo(), Room));

            Room.AddChatlog(Session.GetHabbo().Id, "<Whisper to " + ToUser + ">: " + Message);

            if (PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckBannedWords(Message))
            {
                Session.GetHabbo().BannedPhraseCount++;
                if (Session.GetHabbo().BannedPhraseCount >= PlusStaticGameSettings.BannedPhrasesAmount)
                {
                    PlusEnvironment.GetGame().GetModerationManager().BanUser("System", HabboHotel.Moderation.ModerationBanType.USERNAME, Session.GetHabbo().Username, "Spamming banned phrases (" + Message + ")", (PlusEnvironment.GetUnixTimestamp() + 78892200));
                    Session.Disconnect();
                    return;
                }
                Session.SendMessage(new WhisperComposer(User.VirtualId, Message, 0, User.LastBubble));
                return;
            }


            PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.SOCIAL_CHAT);

            User.UnIdle();
            User.GetClient().SendMessage(new WhisperComposer(User.VirtualId, Message, 0, User.LastBubble));

            if (User2 != null && !User2.IsBot && User2.UserId != User.UserId)
            {
                if (!User2.GetClient().GetHabbo().MutedUsers.Contains(Session.GetHabbo().Id))
                {
                    User2.GetClient().SendMessage(new WhisperComposer(User.VirtualId, Message, 0, User.LastBubble));
                }
            }

            List<RoomUser> ToNotify = Room.GetRoomUserManager().GetRoomUserByRank(2);
            if (ToNotify.Count > 0)
            {
                foreach (RoomUser user in ToNotify)
                {
                    if (user != null && user.HabboId != User2.HabboId && user.HabboId != User.HabboId)
                    {
                        if (user.GetClient() != null && user.GetClient().GetHabbo() != null && !user.GetClient().GetHabbo().IgnorePublicWhispers)
                        {
                            user.GetClient().SendMessage(new WhisperComposer(User.VirtualId, "[Whisper to " + ToUser + "] " + Message, 0, User.LastBubble));
                        }
                    }
                }
            }
        }
Esempio n. 8
0
        public void Parse(GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom)
                return;

            Room Room = Session.GetHabbo().CurrentRoom;
            if (Room == null)
                return;

            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
                return;

            string Message = StringCharFilter.Escape(Packet.PopString());
            if (Message.Length > 100)
                Message = Message.Substring(0, 100);

            int Colour = Packet.PopInt();

            ChatStyle Style = null;
            if (!PlusEnvironment.GetGame().GetChatManager().GetChatStyles().TryGetStyle(Colour, out Style) || (Style.RequiredRight.Length > 0 && !Session.GetHabbo().GetPermissions().HasRight(Style.RequiredRight)))
                Colour = 0;

            User.UnIdle();

            if (PlusEnvironment.GetUnixTimestamp() < Session.GetHabbo().FloodTime && Session.GetHabbo().FloodTime != 0)
                return;

            if (Session.GetHabbo().TimeMuted > 0)
            {
                Session.SendMessage(new MutedComposer(Session.GetHabbo().TimeMuted));
                return;
            }

            if (!Session.GetHabbo().GetPermissions().HasRight("room_ignore_mute") && Room.CheckMute(Session))
            {
                Session.SendWhisper("Oops, you're currently muted.");
                return;
            }

            User.LastBubble = Session.GetHabbo().CustomBubbleId == 0 ? Colour : Session.GetHabbo().CustomBubbleId;

            if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
            {
                int MuteTime;
                if (User.IncrementAndCheckFlood(out MuteTime))
                {
                    Session.SendMessage(new FloodControlComposer(MuteTime));
                    return;
                }
            }

            if (Message.StartsWith(":", StringComparison.CurrentCulture) && PlusEnvironment.GetGame().GetChatManager().GetCommands().Parse(Session, Message))
                return;

            PlusEnvironment.GetGame().GetChatManager().GetLogs().StoreChatlog(new ChatlogEntry(Session.GetHabbo().Id, Room.Id, Message, UnixTimestamp.GetNow(), Session.GetHabbo(), Room));

            if (PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckBannedWords(Message))
            {
                Session.GetHabbo().BannedPhraseCount++;
                if (Session.GetHabbo().BannedPhraseCount >= PlusStaticGameSettings.BannedPhrasesAmount)
                {
                    PlusEnvironment.GetGame().GetModerationManager().BanUser("System", HabboHotel.Moderation.ModerationBanType.USERNAME, Session.GetHabbo().Username, "Spamming banned phrases (" + Message + ")", (PlusEnvironment.GetUnixTimestamp() + 78892200));
                    Session.Disconnect();
                    return;
                }

                Session.SendMessage(new ChatComposer(User.VirtualId, Message, 0, Colour));
                return;
            }

            if (!Session.GetHabbo().GetPermissions().HasRight("word_filter_override"))
                Message = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Message);


            PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.SOCIAL_CHAT);

            User.OnChat(User.LastBubble, Message, false);
        }