public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				ServerMessage Message = new ServerMessage(650);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				Message.AppendInt32(0);
				Message.AppendInt32(Item.GetBaseItem().SpriteId);
				Message.AppendUInt(Item.Id);
				Message.AppendStringWithBreak("");
				Message.AppendString("I");
				if (Item.Extra2.Length > 0)
				{
					Message.AppendString(Item.Extra2);
				}
				else
				{
					Message.AppendString("RB");
				}
				Message.AppendStringWithBreak("HRAH");
				Session.SendMessage(Message);
				Item.ReqUpdate(1);
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				Item.method_9();
				ServerMessage Message = new ServerMessage(651);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				if (Item.Extra4.Length > 0)
				{
					Message.AppendString(Item.Extra4);
				}
				else
				{
					Message.AppendInt32(0);
				}
				Message.AppendInt32(Item.GetBaseItem().SpriteId);
				Message.AppendUInt(Item.Id);
				Message.AppendStringWithBreak("");
				Message.AppendString("J");
				if (Item.Extra1.Length > 0)
				{
					Message.AppendInt32(Convert.ToInt32(Item.Extra1));
				}
				else
				{
					Message.AppendInt32(0);
				}
				if (Item.Extra2.Length > 0)
				{
					Message.AppendInt32(Convert.ToInt32(Item.Extra2));
				}
				else
				{
					Message.AppendInt32(0);
				}
				Message.AppendString("HPA");
				if (Item.Extra5.Length > 0)
				{
					Message.AppendInt32(Convert.ToInt32(Item.Extra5));
				}
				else
				{
					Message.AppendInt32(0);
				}
				Message.AppendStringWithBreak("H");
				Session.SendMessage(Message);
			}
		}
		public void parse(GameClient Session, ClientMessage Event)
		{
			uint num = Event.PopWiredUInt();
			string text = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString());
			if (Session.GetHabbo().GetMessenger() != null)
			{
				if (num == 0 && Session.GetHabbo().HasRole("cmd_sa"))
				{
					ServerMessage Message = new ServerMessage(134);
					Message.AppendUInt(0);
					Message.AppendString(Session.GetHabbo().Username + ": " + text);
					PhoenixEnvironment.GetGame().GetClientManager().SendStaffChat(Session, Message);
				}
				else
				{
					if (num == 0)
					{
						ServerMessage Message2 = new ServerMessage(261);
						Message2.AppendInt32(4);
						Message2.AppendUInt(0);
						Session.SendMessage(Message2);
					}
					else
					{
						Session.GetHabbo().GetMessenger().method_18(num, text);
					}
				}
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				ServerMessage Message = new ServerMessage(650);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendInt32(Item.GetBaseItem().SpriteId);
				Message.AppendUInt(Item.Id);
				Message.AppendString(Item.Extra1);
				Session.SendMessage(Message);
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0)
			{
				ServerMessage Message = new ServerMessage(650u);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				Message.AppendInt32(0);
				Message.AppendInt32(RoomItem_0.GetBaseItem().SpriteId);
				Message.AppendUInt(RoomItem_0.Id);
				Message.AppendStringWithBreak("");
				Message.AppendString("I");
				if (RoomItem_0.Extra2.Length > 0)
				{
					Message.AppendString(RoomItem_0.Extra2);
				}
				else
				{
					Message.AppendString("I");
				}
				Message.AppendStringWithBreak("IKH");
				Session.SendMessage(Message);
			}
		}
        internal static Boolean Parse(GameClient Session, string Input)
        {
            string[] Params = Input.Split(' ');

            string TargetUser = null;
            GameClient TargetClient = null;
            Room TargetRoom = null;
            RoomUser TargetRoomUser = null;
            Habbo TargetHabbo = null;
            if (!PhoenixEnvironment.GetGame().GetRoleManager().CommandsList.ContainsKey(Params[0]))
            {
                return false;
            }
            else
            {
                try
                {
                    int num;
                    if (TargetRoom != null && TargetRoom.CheckRights(Session, true))
                    {
                        num = PhoenixEnvironment.GetGame().GetRoleManager().CommandsList[Params[0]];
                        if (num <= 33)
                        {
                            if (num == 8)
                            {
                                TargetRoom = Session.GetHabbo().CurrentRoom;
                                if (TargetRoom.bool_5)
                                {
                                    TargetRoom.bool_5 = false;
                                }
                                else
                                {
                                    TargetRoom.bool_5 = true;
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (num == 33)
                            {
                                TargetRoom = Session.GetHabbo().CurrentRoom;
                                if (TargetRoom != null && TargetRoom.CheckRights(Session, true))
                                {
                                    List<RoomItem> list = TargetRoom.RemoveAllFurniture(Session);
                                    Session.GetHabbo().GetInventoryComponent().AddItemArray(list);
                                    Session.GetHabbo().GetInventoryComponent().UpdateItems(true);
                                    PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input + " " + Session.GetHabbo().CurrentRoomId);
                                    return true;
                                }
                                return false;
                            }
                        }
                        else
                        {
                            if (num == 46)
                            {
                                TargetRoom = Session.GetHabbo().CurrentRoom;
                                try
                                {
                                    int num2 = int.Parse(Params[1]);
                                    if (Session.GetHabbo().Rank >= 6)
                                    {
                                        TargetRoom.UsersMax = num2;
                                    }
                                    else
                                    {
                                        if (num2 > 100 || num2 < 5)
                                        {
                                            Session.SendNotif("ERROR: Use a number between 5 and 100");
                                        }
                                        else
                                        {
                                            TargetRoom.UsersMax = num2;
                                        }
                                    }
                                }
                                catch
                                {
                                    return false;
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (num == 53)
                            {
                                TargetRoom = Session.GetHabbo().CurrentRoom;
                                PhoenixEnvironment.GetGame().GetRoomManager().UnloadRoom(TargetRoom);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                        }
                    }
                    switch (PhoenixEnvironment.GetGame().GetRoleManager().CommandsList[Params[0]])
                    {
                        #region Moderation Commands
                        #region CMD Alert
                        case 2: //CMD Alert
                            if (!Session.GetHabbo().HasRole("cmd_alert"))
                            {
                                return false;
                            }

                            TargetUser = Params[1];
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(TargetUser);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"cmd_award"))
                            {
                                return false;
                            }

                            TargetUser = Params[1];
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(TargetUser);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"cmd_ban"))
                            {
                                return false;
                            }

                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User not found");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (TargetClient.GetHabbo().Rank >= Session.GetHabbo().Rank)
                            {
                                Session.SendNotif("You are not allowed to ban that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }

                            int BanTime = 0;
                            try
                            {
                                BanTime = int.Parse(Params[2]);
                            }
                            catch (FormatException) { }

                            if (BanTime <= 600)
                            {
                                Session.SendNotif("Ban time is in seconds and must be at least than 600 seconds (ten minutes). For more specific preset ban times, use the mod tool.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            PhoenixEnvironment.GetGame().GetBanManager().BanUser(TargetClient, Session.GetHabbo().Username, BanTime, MergeParams(Params, 3), false);
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Coins
                        case 6: //CMD Coins
                            if (!Session.GetHabbo().HasRole("cmd_coins"))
                            {
                                return false;
                            }

                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User could not be found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            int creditsToAdd;
                            if (int.TryParse(Params[2], out creditsToAdd))
                            {
                                TargetClient.GetHabbo().Credits = TargetClient.GetHabbo().Credits + creditsToAdd;
                                TargetClient.GetHabbo().UpdateCreditsBalance(true);
                                TargetClient.SendNotif(Session.GetHabbo().Username + " has awarded you " + creditsToAdd.ToString() + " credits.");
                                Session.SendNotif("Credit balance updated successful.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            Session.SendNotif("Please send a valid amount of credits.");
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Freeze
                        case 14: //CMD Freeze
                            if (Session.GetHabbo().HasRole("cmd_freeze"))
                            {

                                TargetRoomUser = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Params[1]);
                                if (TargetRoomUser != null)
                                {
                                    TargetRoomUser.bool_5 = !TargetRoomUser.bool_5;
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD GiveBadge
                        case 15: //CMD GiveBadge
                            if (Session.GetHabbo().HasRole("cmd_givebadge"))
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);

                                if (TargetClient != null)
                                {
                                    TargetClient.GetHabbo().GetBadgeComponent().GiveBadge(TargetClient, PhoenixEnvironment.FilterInjectionChars(Params[2]), true);
                                }
                                else
                                {
                                    Session.SendNotif("User: "******" could not be found in the database.\rPlease try your request again.");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD GlobalCredits
                        case 16: //CMD GlobalCredits
                            if (Session.GetHabbo().HasRole("cmd_globalcredits"))
                            {
                                try
                                {
                                    int GCreditsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GiveCredits(GCreditsToAdd);
                                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                    {
                                        adapter.ExecuteQuery("UPDATE users SET credits = credits + " + GCreditsToAdd);
                                    }
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD GlobalPixels
                        case 17: //CMD GlobalPixels
                            if (Session.GetHabbo().HasRole("cmd_globalpixels"))
                            {
                                try
                                {
                                    int pixelsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GivePixels(pixelsToAdd, false);
                                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                    {
                                        adapter.ExecuteQuery("UPDATE users SET activity_points = activity_points + " + pixelsToAdd);
                                    }
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD GlobalPoints
                        case 18: //CMD GlobalPoints
                            if (Session.GetHabbo().HasRole("cmd_globalpoints"))
                            {
                                try
                                {
                                    int pointsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GivePoints(pointsToAdd, false);
                                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                    {
                                        adapter.ExecuteQuery("UPDATE users SET vip_points = vip_points + " + pointsToAdd);
                                    }
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD HaL
                        case 19: //CMD HaL
                            if (Session.GetHabbo().HasRole("cmd_hal"))
                            {
                                string msg = Params[1];
                                Input = Input.Substring(4).Replace(msg, "");
                                string url = Input.Substring(1);
                                ServerMessage Message = new ServerMessage(161);
                                Message.AppendStringWithBreak(string.Concat(new string[]
							{
								TextManager.GetText("cmd_hal_title"),
								"\r\n",
								url,
								"\r\n-",
								Session.GetHabbo().Username
							}));
                                Message.AppendStringWithBreak(msg);
                                PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessage(Message);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Ha
                        case 20: //CMD Ha
                            if (Session.GetHabbo().HasRole("cmd_ha"))
                            {
                                string notice = Input.Substring(3);
                                ServerMessage Message2 = new ServerMessage(808);
                                Message2.AppendStringWithBreak(TextManager.GetText("cmd_ha_title"));
                                Message2.AppendStringWithBreak(notice + "\r\n- " + Session.GetHabbo().Username);
                                ServerMessage Message3 = new ServerMessage(161);
                                Message3.AppendStringWithBreak(notice + "\r\n- " + Session.GetHabbo().Username);
                                PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessage(Message2, Message3);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Invisible
                        case 21: //CMD Invisible
                            if (Session.GetHabbo().HasRole("cmd_invisible"))
                            {
                                Session.GetHabbo().Visible = !Session.GetHabbo().Visible;
                                Session.SendNotif("You are now " + (Session.GetHabbo().Visible ? "visible" : "invisible") + "\nTo apply the changes reload the room ;D");
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD IpBan
                        case 22: //CMD IpBan
                            if (!Session.GetHabbo().HasRole("cmd_ipban"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User not found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (TargetClient.GetHabbo().Rank >= Session.GetHabbo().Rank && !Session.GetHabbo().isAaron)
                            {
                                Session.SendNotif("You are not allowed to ban that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            PhoenixEnvironment.GetGame().GetBanManager().BanUser(TargetClient, Session.GetHabbo().Username, 360000000.0, ChatCommandHandler.MergeParams(Params, 2), true);
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Kick
                        case 23: //CMD Kick
                            if (!Session.GetHabbo().HasRole("cmd_kick"))
                            {
                                return false;
                            }
                            TargetUser = Params[1];
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(TargetUser);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"You are not allowed to kick that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (TargetClient.GetHabbo().CurrentRoomId < 1u)
                            {
                                Session.SendNotif("That user is not in a room and can not be kicked.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(TargetClient.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            TargetRoom.RemoveUserFromRoom(TargetClient, true, false);
                            if (Params.Length > 2)
                            {
                                TargetClient.SendNotif("A moderator has kicked you from the room for the following reason: " + ChatCommandHandler.MergeParams(Params, 2));
                            }
                            else
                            {
                                TargetClient.SendNotif("A moderator has kicked you from the room.");
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD MassBadge
                        case 24: //CMD MassBadge
                            if (Session.GetHabbo().HasRole("cmd_massbadge"))
                            {
                                PhoenixEnvironment.GetGame().GetClientManager().GiveMassBadge(Params[1]);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD MassCredits
                        case 25: //CMD MassCredits
                            if (Session.GetHabbo().HasRole("cmd_masscredits"))
                            {
                                try
                                {
                                    int MCreditsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GiveCredits(MCreditsToAdd);
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD MassPixels
                        case 26: //CMD MassPixels
                            if (Session.GetHabbo().HasRole("cmd_masspixels"))
                            {
                                try
                                {
                                    int MPixelsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GivePixels(MPixelsToAdd, true);
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD MassPoints
                        case 27: //CMD MassPoints
                            if (Session.GetHabbo().HasRole("cmd_masspoints"))
                            {
                                try
                                {
                                    int MPointsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GivePoints(MPointsToAdd, true);
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Motd
                        case 30: //CMD Motd
                            if (!Session.GetHabbo().HasRole("cmd_motd"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"cmd_mute"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null || TargetClient.GetHabbo() == null)
                            {
                                Session.SendNotif("Could not find user: "******"You are not allowed to (un)mute that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            TargetClient.GetHabbo().Mute();
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Override
                        case 32: //CMD Override
                            if (!Session.GetHabbo().HasRole("cmd_override"))
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser == null)
                            {
                                return false;
                            }
                            if (TargetRoomUser.AllowOverride)
                            {
                                TargetRoomUser.AllowOverride = false;
                                Session.SendNotif("Walking override disabled.");
                            }
                            else
                            {
                                TargetRoomUser.AllowOverride = true;
                                Session.SendNotif("Walking override enabled.");
                            }
                            TargetRoom.GenerateMaps();
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Pixels
                        case 34: //CMD Pixels
                            if (!Session.GetHabbo().HasRole("cmd_pixels"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User could not be found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            int PixelsToAdd;
                            if (int.TryParse(Params[2], out PixelsToAdd))
                            {
                                TargetClient.GetHabbo().ActivityPoints = TargetClient.GetHabbo().ActivityPoints + PixelsToAdd;
                                TargetClient.GetHabbo().UpdateActivityPointsBalance(true);
                                TargetClient.SendNotif(Session.GetHabbo().Username + " has awarded you " + PixelsToAdd.ToString() + " Pixels!");
                                Session.SendNotif("Pixels balance updated successfully.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            Session.SendNotif("Please send a valid amount of pixels.");
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Points
                        case 35: //CMD Points
                            if (!Session.GetHabbo().HasRole("cmd_points"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User could not be found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            int PointsToAdd;
                            if (int.TryParse(Params[2], out PointsToAdd))
                            {
                                TargetClient.GetHabbo().shells = TargetClient.GetHabbo().shells + PointsToAdd;
                                TargetClient.GetHabbo().UpdateShellsBalance(false, true);
                                TargetClient.SendNotif(Session.GetHabbo().Username + " has awarded you " + PointsToAdd.ToString() + " Points!");
                                Session.SendNotif("Points balance updated successfully.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            Session.SendNotif("Please send a valid amount of points.");
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RemoveBadge
                        case 39: //CMD RemoveBadge
                            if (Session.GetHabbo().HasRole("cmd_removebadge"))
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                if (TargetClient != null)
                                {
                                    TargetClient.GetHabbo().GetBadgeComponent().RemoveBadge(PhoenixEnvironment.FilterInjectionChars(Params[2]));
                                }
                                else
                                {
                                    Session.SendNotif("User: "******" could not be found in the database.\rPlease try your request again.");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD RoomAlert
                        case 41: //CMD RoomAlert
                            if (!Session.GetHabbo().HasRole("cmd_roomalert"))
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            string alert = ChatCommandHandler.MergeParams(Params, 1);
                            for (int i = 0; i < TargetRoom.UserList.Length; i++)
                            {
                                TargetRoomUser = TargetRoom.UserList[i];
                                if (TargetRoomUser != null)
                                {
                                    TargetRoomUser.GetClient().SendNotif(alert);
                                }
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RoomBadge
                        case 42: //CMD RoomBadge
                            if (!Session.GetHabbo().HasRole("cmd_roombadge"))
                            {
                                return false;
                            }
                            if (Session.GetHabbo().CurrentRoom == null)
                            {
                                return false;
                            }
                            for (int i = 0; i < Session.GetHabbo().CurrentRoom.UserList.Length; i++)
                            {
                                try
                                {
                                    TargetRoomUser = Session.GetHabbo().CurrentRoom.UserList[i];
                                    if (TargetRoomUser != null)
                                    {
                                        if (!TargetRoomUser.IsBot)
                                        {
                                            if (TargetRoomUser.GetClient() != null)
                                            {
                                                if (TargetRoomUser.GetClient().GetHabbo() != null)
                                                {
                                                    TargetRoomUser.GetClient().GetHabbo().GetBadgeComponent().GiveBadge(TargetRoomUser.GetClient(), Params[1], true);
                                                }
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Session.SendNotif("Error: " + ex.ToString());
                                }
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RoomKick
                        case 43: //CMD RoomKick
                            if (!Session.GetHabbo().HasRole("cmd_roomkick"))
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            bool GenericMsg = true;
                            string ModMsg = ChatCommandHandler.MergeParams(Params, 1);
                            if (ModMsg.Length > 0)
                            {
                                GenericMsg = false;
                            }
                            for (int i = 0; i < TargetRoom.UserList.Length; i++)
                            {
                                TargetRoomUser = TargetRoom.UserList[i];
                                if (TargetRoomUser != null && TargetRoomUser.GetClient().GetHabbo().Rank < Session.GetHabbo().Rank)
                                {
                                    if (!GenericMsg)
                                    {
                                        TargetRoomUser.GetClient().SendNotif("You have been kicked by an moderator: " + ModMsg);
                                    }
                                    TargetRoom.RemoveUserFromRoom(TargetRoomUser.GetClient(), true, GenericMsg);
                                }
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RoomMute
                        case 44: //CMD RoomMute
                            if (Session.GetHabbo().HasRole("cmd_roommute"))
                            {
                                if (Session.GetHabbo().CurrentRoom.RoomMuted)
                                {
                                    Session.GetHabbo().CurrentRoom.RoomMuted = false;
                                }
                                else
                                {
                                    Session.GetHabbo().CurrentRoom.RoomMuted = true;
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD SA
                        case 45: //CMD SA
                            if (Session.GetHabbo().HasRole("cmd_sa"))
                            {
                                ServerMessage Logging = new ServerMessage(134);
                                Logging.AppendUInt(0);
                                Logging.AppendString(Session.GetHabbo().Username + ": " + Input.Substring(3));
                                PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessageToStaff(Logging, Logging);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD SetSpeed
                        case 47: //CMD SetSpeed
                            if (Session.GetHabbo().HasRole("cmd_setspeed"))
                            {
                                int.Parse(Params[1]);
                                Session.GetHabbo().CurrentRoom.method_102(int.Parse(Params[1]));
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Shutdown
                        case 48: //CMD Shutdown
                            if (Session.GetHabbo().HasRole("cmd_shutdown"))
                            {
                                Logging.LogCriticalException("User " + Session.GetHabbo().Username + " shut down the server " + DateTime.Now.ToString());
                                Task task = new Task(new Action(PhoenixEnvironment.BeginShutDown));
                                task.Start();
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Spull
                        case 49: //CMD Spull
                            if (Session.GetHabbo().HasRole("cmd_spull"))
                            {
                                try
                                {
                                    string a = "down";
                                    TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                    TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                    if (Session == null || TargetClient == null)
                                    {
                                        return false;
                                    }
                                    TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                    RoomUser TargetClient2 = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                    if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
                                    {
                                        Session.GetHabbo().Sendselfwhisper("You cannot pull yourself");
                                        return true;
                                    }
                                    TargetRoomUser.Chat(Session, "*pulls " + TargetClient.GetHabbo().Username + " to them*", false);
                                    if (TargetRoomUser.RotBody == 0)
                                    {
                                        a = "up";
                                    }
                                    if (TargetRoomUser.RotBody == 2)
                                    {
                                        a = "right";
                                    }
                                    if (TargetRoomUser.RotBody == 4)
                                    {
                                        a = "down";
                                    }
                                    if (TargetRoomUser.RotBody == 6)
                                    {
                                        a = "left";
                                    }
                                    if (a == "up")
                                    {
                                        TargetClient2.MoveTo(TargetRoomUser.X, TargetRoomUser.Y - 1);
                                    }
                                    if (a == "right")
                                    {
                                        TargetClient2.MoveTo(TargetRoomUser.X + 1, TargetRoomUser.Y);
                                    }
                                    if (a == "down")
                                    {
                                        TargetClient2.MoveTo(TargetRoomUser.X, TargetRoomUser.Y + 1);
                                    }
                                    if (a == "left")
                                    {
                                        TargetClient2.MoveTo(TargetRoomUser.X - 1, TargetRoomUser.Y);
                                    }
                                    return true;
                                }
                                catch
                                {
                                    return false;
                                }
                            }
                            return false;
                        #endregion
                        #region CMD Summon
                        case 50: //CMD Summon
                            if (Session.GetHabbo().HasRole("cmd_summon"))
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                if (TargetClient != null && TargetClient.GetHabbo().CurrentRoom != Session.GetHabbo().CurrentRoom)
                                {
                                    ServerMessage Message5 = new ServerMessage(286u);
                                    Message5.AppendBoolean(Session.GetHabbo().CurrentRoom.IsPublic);
                                    Message5.AppendUInt(Session.GetHabbo().CurrentRoomId);
                                    TargetClient.SendMessage(Message5);
                                    TargetClient.SendNotif(Session.GetHabbo().Username + " has summoned you to them");
                                }
                                else
                                {
                                    Session.GetHabbo().Sendselfwhisper("User: "******" could not be found - Maybe they're not online anymore :(");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD SuperBan
                        case 51: //CMD SuperBan
                            if (!Session.GetHabbo().HasRole("cmd_superban"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User not found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (TargetClient.GetHabbo().Rank >= Session.GetHabbo().Rank && !Session.GetHabbo().isAaron)
                            {
                                Session.SendNotif("You are not allowed to ban that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            PhoenixEnvironment.GetGame().GetBanManager().BanUser(TargetClient, Session.GetHabbo().Username, 360000000.0, ChatCommandHandler.MergeParams(Params, 2), false);
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Teleport
                        case 52: //CMD Teleport
                            if (!Session.GetHabbo().HasRole("cmd_teleport"))
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser == null)
                            {
                                return false;
                            }
                            if (TargetRoomUser.TeleportMode)
                            {
                                TargetRoomUser.TeleportMode = false;
                                Session.SendNotif("Teleporting disabled.");
                            }
                            else
                            {
                                TargetRoomUser.TeleportMode = true;
                                Session.SendNotif("Teleporting enabled.");
                            }
                            TargetRoom.GenerateMaps();
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD UnMute
                        case 54: //CMD UnMute
                            if (!Session.GetHabbo().HasRole("cmd_unmute"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null || TargetClient.GetHabbo() == null)
                            {
                                Session.SendNotif("Could not find user: "******"cmd_update_achievements"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    AchievementManager.LoadAchievements(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Bans
                        case 56: //CMD Update Bans
                            if (Session.GetHabbo().HasRole("cmd_update_bans"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetBanManager().LoadBans(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().CheckForAllBanConflicts();
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region  CMD Update Bots
                        case 57: //CMD Update Bots
                            if (Session.GetHabbo().HasRole("cmd_update_bots"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetBotManager().LoadBots(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Catalogue
                        case 58: //CMD Update Catalogue
                            if (Session.GetHabbo().HasRole("cmd_update_catalogue"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetCatalog().Initialize(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetCatalog().InitCache();
                                PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessage(new ServerMessage(441u));
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Filter
                        case 59: //CMD Update Filter
                            if (Session.GetHabbo().HasRole("cmd_update_filter"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    ChatCommandHandler.UpdateFilters(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Items
                        case 60: //CMD Update Items
                            if (Session.GetHabbo().HasRole("cmd_update_items"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetItemManager().LoadItems(adapter);
                                }
                                Session.SendNotif("Item defenitions reloaded successfully.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Navigator
                        case 61: //CMD Update Navigator
                            if (Session.GetHabbo().HasRole("cmd_update_navigator"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetNavigator().Initialize(adapter);
                                    PhoenixEnvironment.GetGame().GetRoomManager().LoadModels(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Permissions
                        case 62: //CMD Update Premissions
                            if (Session.GetHabbo().HasRole("cmd_update_permissions"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetRoleManager().LoadRoles(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Settings
                        case 63: ///CMD Update Settings
                            if (Session.GetHabbo().HasRole("cmd_update_settings"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().LoadSettings(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Texts
                        case 65: //CMD Update Texts
                            if (Session.GetHabbo().HasRole("cmd_update_texts"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    TextManager.LoadTexts(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD UserInfo
                        case 64: //CMD UserInfo
                            if (!Session.GetHabbo().HasRole("cmd_userinfo"))
                            {
                                return false;
                            }
                            bool flag2 = true;
                            if (string.IsNullOrEmpty(Params[1]))
                            {
                                Session.SendNotif("Please enter a username");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                flag2 = false;
                                TargetHabbo = Authenticator.GetHabboViaUsername(Params[1]);
                            }
                            else
                            {
                                TargetHabbo = TargetClient.GetHabbo();
                            }
                            if (TargetHabbo == null)
                            {
                                Session.SendNotif("Unable to find user " + Params[1]);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            StringBuilder Builderer = new StringBuilder();
                            if (TargetHabbo.CurrentRoom != null)
                            {
                                Builderer.Append(" - ROOM INFORMATION FOR ROOMID: " + TargetHabbo.CurrentRoom.RoomId + " - \r");
                                Builderer.Append("Owner: " + TargetHabbo.CurrentRoom.Owner + "\r");
                                Builderer.Append("Room name: " + TargetHabbo.CurrentRoom.Name + "\r");
                                Builderer.Append(string.Concat(new object[]
							{
								"Users in room: ",
								TargetHabbo.CurrentRoom.UserCount,
								"/",
								TargetHabbo.CurrentRoom.UsersMax
							}));
                            }
                            uint UserRank = TargetHabbo.Rank;
                            string UserIP = "";
                            if (Session.GetHabbo().HasRole("cmd_userinfo_viewip"))
                            {
                                UserIP = "UserIP: " + TargetHabbo.LastIp + " \r";
                            }
                            Session.SendNotif(string.Concat(new object[]
						{
							"User information for user: "******":\rRank: ",
							UserRank,
							" \rUser online: ",
							flag2.ToString(),
							" \rUserID: ",
							TargetHabbo.Id,
							" \r",
							UserIP,
							"Visiting room: ",
							TargetHabbo.CurrentRoomId,
							" \rUser motto: ",
							TargetHabbo.Motto,
							" \rUser credits: ",
							TargetHabbo.Credits,
							" \rUser pixels: ",
							TargetHabbo.ActivityPoints,
							" \rUser points: ",
							TargetHabbo.shells,
							" \rUser muted: ",
							TargetHabbo.Muted.ToString(),
							"\r\r\r",
							Builderer.ToString()
						}));
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Disconnect
                        case 66: //CMD Disconnect
                            if (!Session.GetHabbo().HasRole("cmd_disconnect"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"You are not allowed to kick that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (!TargetClient.GetHabbo().isAaron)
                            {
                                TargetClient.Disconnect();
                            }
                            return true;
                        #endregion
                        #region CMD Empty
                        case 10: //CMD Empty
                            if (Session.GetHabbo().HasRole("cmd_empty") && Params[1] != null)
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                if (TargetClient != null && TargetClient.GetHabbo() != null)
                                {
                                    TargetClient.GetHabbo().GetInventoryComponent().ClearItems();
                                    Session.SendNotif("Inventory cleared! (Database and cache)");
                                }
                                else
                                {
                                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                    {
                                        adapter.AddParamWithValue("usrname", Params[1]);
                                        int userId = int.Parse(adapter.ReadString("SELECT Id FROM users WHERE username = @usrname LIMIT 1;"));
                                        adapter.ExecuteQuery("DELETE FROM items WHERE user_id = '" + userId + "' AND room_id = 0;");
                                        Session.SendNotif("Inventory cleared! (Database)");
                                    }
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #endregion

                        #region VIP Commands
                        #region CMD Enable
                        case 11: //CMD Enable
                            if (!GlobalClass.cmdEnableEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            int effect = int.Parse(Params[1]);
                            Session.GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(effect, true);
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD FlagMe
                        case 12: //CMD FlagMe
                            if (!GlobalClass.cmdFlagmeEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            ServerMessage message = new ServerMessage(573);
                            Session.SendMessage(message);
                            return true;
                        #endregion
                        #region CMD Follow
                        case 13: //CMD Follow
                            if (!GlobalClass.cmdFollowEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient != null && TargetClient.GetHabbo().InRoom && Session.GetHabbo().CurrentRoom != TargetClient.GetHabbo().CurrentRoom && !TargetClient.GetHabbo().HideInRom)
                            {
                                ServerMessage message2 = new ServerMessage(286);
                                message2.AppendBoolean(TargetClient.GetHabbo().CurrentRoom.IsPublic);
                                message2.AppendUInt(TargetClient.GetHabbo().CurrentRoomId);
                                Session.SendMessage(message2);
                            }
                            else
                            {
                                Session.GetHabbo().Sendselfwhisper("User: "******" could not be found - Maybe they're not online or not in a room anymore (or maybe they're a ninja)");
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Mimic
                        case 28: //CMD Mimic    
                            if (!GlobalClass.cmdMimicEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.GetHabbo().Sendselfwhisper("Could not find user: "******"cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser == null)
                            {
                                return false;
                            }
                            if (TargetRoomUser.WalkBackwards)
                            {
                                TargetRoomUser.WalkBackwards = false;
                                Session.GetHabbo().Sendselfwhisper("Your moonwalk has been disabled.");
                                return true;
                            }
                            TargetRoomUser.WalkBackwards = true;
                            Session.GetHabbo().Sendselfwhisper("Your moonwalk has been enabled.");
                            return true;
                        #endregion
                        #region CMD Pull
                        case 36: //CMD Pull
                            try
                            {
                                if (!GlobalClass.cmdPullEnabled)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                    return true;
                                }
                                if (!Session.GetHabbo().Vip)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                    return true;
                                }
                                string a = "down";
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                if (Session == null || TargetClient == null)
                                {
                                    return false;
                                }
                                TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                RoomUser TargetRoomUser2 = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
                                {
                                    Session.GetHabbo().Sendselfwhisper("You cannot pull yourself");
                                    return true;
                                }
                                if (TargetClient.GetHabbo().CurrentRoomId == Session.GetHabbo().CurrentRoomId && Math.Abs(TargetRoomUser.X - TargetRoomUser2.X) < 3 && Math.Abs(TargetRoomUser.Y - TargetRoomUser2.Y) < 3)
                                {
                                    TargetRoomUser.Chat(Session, "*pulls " + TargetClient.GetHabbo().Username + " to them*", false);
                                    if (TargetRoomUser.RotBody == 0)
                                    {
                                        a = "up";
                                    }
                                    if (TargetRoomUser.RotBody == 2)
                                    {
                                        a = "right";
                                    }
                                    if (TargetRoomUser.RotBody == 4)
                                    {
                                        a = "down";
                                    }
                                    if (TargetRoomUser.RotBody == 6)
                                    {
                                        a = "left";
                                    }
                                    if (a == "up")
                                    {
                                        TargetRoomUser2.MoveTo(TargetRoomUser.X, TargetRoomUser.Y - 1);
                                    }
                                    if (a == "right")
                                    {
                                        TargetRoomUser2.MoveTo(TargetRoomUser.X + 1, TargetRoomUser.Y);
                                    }
                                    if (a == "down")
                                    {
                                        TargetRoomUser2.MoveTo(TargetRoomUser.X, TargetRoomUser.Y + 1);
                                    }
                                    if (a == "left")
                                    {
                                        TargetRoomUser2.MoveTo(TargetRoomUser.X - 1, TargetRoomUser.Y);
                                    }
                                    return true;
                                }
                                Session.GetHabbo().Sendselfwhisper("That user is not close enough to you to be pulled, try getting closer");
                                return true;
                            }
                            catch
                            {
                                return false;
                            }
                        #endregion
                        #region CMD Push
                        case 37: //CMD Push
                            try
                            {
                                if (!GlobalClass.cmdPushEnabled)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                    return true;
                                }
                                if (!Session.GetHabbo().Vip)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                    return true;
                                }
                                string a = "down";
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                if (Session == null || TargetClient == null)
                                {
                                    return false;
                                }
                                TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                RoomUser TargetRoomUser2 = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
                                {
                                    Session.GetHabbo().Sendselfwhisper("It can't be that bad mate, no need to push yourself!");
                                    return true;
                                }
                                bool arg_3DD2_0; //What is it? I don't know!
                                if (TargetClient.GetHabbo().CurrentRoomId == Session.GetHabbo().CurrentRoomId)
                                {
                                    if ((TargetRoomUser.X + 1 != TargetRoomUser2.X || TargetRoomUser.Y != TargetRoomUser2.Y) && (TargetRoomUser.X - 1 != TargetRoomUser2.X || TargetRoomUser.Y != TargetRoomUser2.Y) && (TargetRoomUser.Y + 1 != TargetRoomUser2.Y || TargetRoomUser.X != TargetRoomUser2.X))
                                    {
                                        if (TargetRoomUser.Y - 1 == TargetRoomUser2.Y)
                                        {
                                            if (TargetRoomUser.X == TargetRoomUser2.X)
                                            {
                                                arg_3DD2_0 = false;
                                            }
                                            else
                                            {
                                                arg_3DD2_0 = true;
                                            }
                                        }
                                        arg_3DD2_0 = (TargetRoomUser.X != TargetRoomUser2.X || TargetRoomUser.Y != TargetRoomUser2.Y);
                                        if (!arg_3DD2_0)
                                        {
                                            TargetRoomUser.Chat(Session, "*pushes " + TargetClient.GetHabbo().Username + "*", false);
                                            if (TargetRoomUser.RotBody == 0)
                                            {
                                                a = "up";
                                                a = "right";
                                            }
                                            if (TargetRoomUser.RotBody == 4)
                                            {
                                                a = "down";
                                            }
                                            if (TargetRoomUser.RotBody == 6)
                                            {
                                                a = "left";
                                            }
                                            if (TargetRoomUser.RotBody == 2)
                                            {
                                            }
                                            if (a == "up")
                                            {
                                                TargetRoomUser2.MoveTo(TargetRoomUser2.X, TargetRoomUser2.Y - 1);
                                            }
                                            if (a == "right")
                                            {
                                                TargetRoomUser2.MoveTo(TargetRoomUser2.X + 1, TargetRoomUser2.Y);
                                            }
                                            if (a == "down")
                                            {
                                                TargetRoomUser2.MoveTo(TargetRoomUser2.X, TargetRoomUser2.Y + 1);
                                            }
                                            if (a == "left")
                                            {
                                                TargetRoomUser2.MoveTo(TargetRoomUser2.X - 1, TargetRoomUser2.Y);
                                            }
                                        }
                                        return true;
                                    }
                                }
                                return false;
                            }
                            catch
                            {
                                return false;
                            }
                        #endregion
                        #region CMD Faceless
                        case 85: //CMD Faceless
                            string[] figureParts;
                            string[] headParts;

                            if (!GlobalClass.cmdFacelessEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }

                            figureParts = Session.GetHabbo().Look.Split('.');
                            foreach (string Part in figureParts)
                            {
                                if(Part.StartsWith("hd"))
                                {
                                    headParts = Part.Split('-');

                                    if (!headParts[1].Equals("99999"))
                                        headParts[1] = "99999";
                                    else
                                        break;

                                    string NewHead = "hd-" + headParts[1] + "-" + headParts[2];

                                    Session.GetHabbo().Look = Session.GetHabbo().Look.Replace(Part, NewHead);
                                    break;
                                }
                            }

                            using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                            {
                                adapter.AddParamWithValue("look", Session.GetHabbo().Look);
                                adapter.AddParamWithValue("username", Session.GetHabbo().Username);
                                adapter.ExecuteQuery("UPDATE users SET look = @look WHERE username = @username");
                            }

                            Room Room = Session.GetHabbo().CurrentRoom;

                            if (Room == null)
                                break;

                            RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);

                            if (User == null)
                                break;
                            					    
                            ServerMessage UserUpdate = new ServerMessage(266);
					        UserUpdate.AppendInt32(-1);
					        UserUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
					        UserUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
					        UserUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
					        UserUpdate.AppendInt32(Session.GetHabbo().AchievementScore);
				        	UserUpdate.AppendStringWithBreak("");
					        Session.SendMessage(UserUpdate);
					
                            ServerMessage RoomUpdate = new ServerMessage(266);
					        RoomUpdate.AppendInt32(User.VirtualId);
					        RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
					        RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
					        RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
					        RoomUpdate.AppendInt32(Session.GetHabbo().AchievementScore);
					        RoomUpdate.AppendStringWithBreak("");
					        Room.SendMessage(RoomUpdate, null);
                            return true;
                        #endregion
                        #endregion

                        #region Normal Commands
                        #region CMD Buy
                        case 5: //CMD Buy
                            int amountToBuy = Convert.ToInt16(Params[1]);
                            if (amountToBuy > 0 && amountToBuy < 101)
                            {
                                Session.GetHabbo().BuyCount = (int)Convert.ToInt16(Params[1]);
                            }
                            else
                            {
                                Session.GetHabbo().Sendselfwhisper("Please choose a value between 1 - 100");
                            }
                            return true;
                        #endregion
                        #region CMD Ride
                        case 40: //CMD Ride
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            RoomUser TargetRoomUser3 = TargetRoom.method_57(Params[1]);
                            if (TargetRoomUser.Riding != null)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_err_riding"));
                                return true;
                            }
                            if (!TargetRoomUser3.IsBot || TargetRoomUser3.PetData.Type != 13)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_err_nothorse"));
                                return true;
                            }
                            bool arg_40EB_0; //What is it? I don't know!
                            if ((TargetRoomUser.X + 1 != TargetRoomUser3.X || TargetRoomUser.Y != TargetRoomUser3.Y) && (TargetRoomUser.X - 1 != TargetRoomUser3.X || TargetRoomUser.Y != TargetRoomUser3.Y) && (TargetRoomUser.Y + 1 != TargetRoomUser3.Y || TargetRoomUser.X != TargetRoomUser3.X))
                            {
                                if (TargetRoomUser.Y - 1 == TargetRoomUser3.Y)
                                {
                                    if (TargetRoomUser.X == TargetRoomUser3.X)
                                    {
                                        arg_40EB_0 = false;
                                    }
                                }
                                arg_40EB_0 = (TargetRoomUser.X != TargetRoomUser3.X || TargetRoomUser.Y != TargetRoomUser3.Y);
                                if (arg_40EB_0)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_err_toofar"));
                                    return true;
                                }
                            }
                            if (TargetRoomUser3.BotData.Rider == null)
                            {
                                TargetRoomUser3.BotData.Rider = TargetRoomUser;
                                TargetRoomUser.Riding = TargetRoomUser3.BotData;
                                TargetRoomUser.X = TargetRoomUser3.X;
                                TargetRoomUser.Y = TargetRoomUser3.Y;
                                TargetRoomUser.Z = TargetRoomUser3.Z + 1.0;
                                TargetRoomUser.RotBody = TargetRoomUser3.RotBody;
                                TargetRoomUser.RotHead = TargetRoomUser3.RotHead;
                                TargetRoomUser.UpdateNeeded = true;
                                TargetRoom.UpdateUserStatus(TargetRoomUser, false, false);
                                TargetRoomUser.Target = TargetRoomUser3;
                                TargetRoomUser.Statusses.Clear();
                                TargetRoomUser3.Statusses.Clear();
                                Session.GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(77, true);
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_instr_getoff"));
                                TargetRoom.GenerateMaps();
                                return true;
                            }
                            Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_err_tooslow"));
                            return true;
                        #endregion
                        #region CMD Dismount
                        case 80: //CMD Dismount
                        case 81:
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser.Riding != null)
                            {
                                Session.GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1, true);
                                TargetRoomUser.Riding.Rider = null;
                                TargetRoomUser.Riding = null;
                                TargetRoomUser.Z -= 1.0;
                                TargetRoomUser.Statusses.Clear();
                                TargetRoomUser.UpdateNeeded = true;
                                int int_3 = PhoenixEnvironment.GetRandomNumber(0, TargetRoom.Model.MapSizeX);
                                int int_4 = PhoenixEnvironment.GetRandomNumber(0, TargetRoom.Model.MapSizeY);
                                TargetRoomUser.Target.MoveTo(int_3, int_4);
                                TargetRoomUser.Target = null;
                                TargetRoom.UpdateUserStatus(TargetRoomUser, false, false);
                            }
                            return true;
                        #endregion
                        #region CMD DisableDiagonal
                        case 8: //CMD DisableDiagonal
                            Session.SendNotif("Command disabled");
                            return true;
                        #endregion
                        #region CMD EmptyItems
                        case 9: //CMD EmptyItems
                            Session.GetHabbo().GetInventoryComponent().ClearItems();
                            Session.SendNotif(TextManager.GetText("cmd_emptyitems_success"));
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD EmptyPets
                        case 82: //CMD EmptyPets
                            Session.GetHabbo().GetInventoryComponent().ClearPets();
                            Session.SendNotif(TextManager.GetText("cmd_emptypets_success"));
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RedeemCreds
                        case 38: //CMD RedeemCreds
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser.IsTrading)
                            {
                                Session.GetHabbo().Sendselfwhisper("Command unavailable while trading");
                                return true;
                            }
                            if (GlobalClass.cmdRedeemCredits)
                            {
                                Session.GetHabbo().GetInventoryComponent().RedeemCredits(Session);
                            }
                            else
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                            }
                            return true;
                        #endregion
                        #region CMD Commands
                        case 67: //CMD Commands
                            string Command = "Your Commands:\r\r";
                            if (Session.GetHabbo().HasRole("cmd_update_settings"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_settings_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_bans"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_bans_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_permissions"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_permissions_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_filter"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_filter_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_bots"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_bots_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_catalogue"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_catalogue_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_items"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_items_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_navigator"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_navigator_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_achievements"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_achievements_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_award"))
                            {
                                Command = Command + TextManager.GetText("cmd_award_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_coords"))
                            {
                                Command = Command + TextManager.GetText("cmd_coords_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_override"))
                            {
                                Command = Command + TextManager.GetText("cmd_override_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_teleport"))
                            {
                                Command = Command + TextManager.GetText("cmd_teleport_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_coins"))
                            {
                                Command = Command + TextManager.GetText("cmd_coins_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_pixels"))
                            {
                                Command = Command + TextManager.GetText("cmd_pixels_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_points"))
                            {
                                Command = Command + TextManager.GetText("cmd_points_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_alert"))
                            {
                                Command = Command + TextManager.GetText("cmd_alert_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_motd"))
                            {
                                Command = Command + TextManager.GetText("cmd_motd_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_roomalert"))
                            {
                                Command = Command + TextManager.GetText("cmd_roomalert_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_ha"))
                            {
                                Command = Command + TextManager.GetText("cmd_ha_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_hal"))
                            {
                                Command = Command + TextManager.GetText("cmd_hal_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_freeze"))
                            {
                                Command = Command + TextManager.GetText("cmd_freeze_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_roommute"))
                            {
                                Command = Command + TextManager.GetText("cmd_roommute_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_setspeed"))
                            {
                                Command = Command + TextManager.GetText("cmd_setspeed_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_globalcredits"))
                            {
                                Command = Command + TextManager.GetText("cmd_globalcredits_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_globalpixels"))
                            {
                                Command = Command + TextManager.GetText("cmd_globalpixels_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_globalpoints"))
                            {
                                Command = Command + TextManager.GetText("cmd_globalpoints_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_masscredits"))
                            {
                                Command = Command + TextManager.GetText("cmd_masscredits_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_masspixels"))
                            {
                                Command = Command + TextManager.GetText("cmd_masspixels_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_masspoints"))
                            {
                                Command = Command + TextManager.GetText("cmd_masspoints_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_givebadge"))
                            {
                                Command = Command + TextManager.GetText("cmd_givebadge_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_removebadge"))
                            {
                                Command = Command + TextManager.GetText("cmd_removebadge_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_summon"))
                            {
                                Command = Command + TextManager.GetText("cmd_summon_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_roombadge"))
                            {
                                Command = Command + TextManager.GetText("cmd_roombadge_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_massbadge"))
                            {
                                Command = Command + TextManager.GetText("cmd_massbadge_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_userinfo"))
                            {
                                Command = Command + TextManager.GetText("cmd_userinfo_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_shutdown"))
                            {
                                Command = Command + TextManager.GetText("cmd_shutdown_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_invisible"))
                            {
                                Command = Command + TextManager.GetText("cmd_invisible_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_ban"))
                            {
                                Command = Command + TextManager.GetText("cmd_ban_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_superban"))
                            {
                                Command = Command + TextManager.GetText("cmd_superban_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_ipban"))
                            {
                                Command = Command + TextManager.GetText("cmd_ipban_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_kick"))
                            {
                                Command = Command + TextManager.GetText("cmd_kick_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_roomkick"))
                            {
                                Command = Command + TextManager.GetText("cmd_roomkick_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_mute"))
                            {
                                Command = Command + TextManager.GetText("cmd_mute_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_unmute"))
                            {
                                Command = Command + TextManager.GetText("cmd_unmute_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_sa"))
                            {
                                Command = Command + TextManager.GetText("cmd_sa_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_spull"))
                            {
                                Command = Command + TextManager.GetText("cmd_spull_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_empty"))
                            {
                                Command = Command + TextManager.GetText("cmd_empty_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_texts"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_texts_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().Vip)
                            {
                                if (GlobalClass.cmdMoonwalkEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_moonwalk_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdFacelessEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_faceless_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdMimicEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_mimic_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdFollowEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_follow_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdPushEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_push_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdPullEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_pull_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdFlagmeEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_flagme_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdEnableEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_enable_desc") + "\r\r";
                                }
                            }
                            string RCommand = "";
                            if (GlobalClass.cmdRedeemCredits)
                            {
                                RCommand = RCommand + TextManager.GetText("cmd_redeemcreds_desc") + "\r\r";
                            }
                            string mCommand = Command;
                            Command = string.Concat(new string[]
									{
										mCommand,
										"- - - - - - - - - - - \r\r",
										TextManager.GetText("cmd_about_desc"),
										"\r\r",
										TextManager.GetText("cmd_pickall_desc"),
										"\r\r",
										TextManager.GetText("cmd_unload_desc"),
										"\r\r",
										TextManager.GetText("cmd_disablediagonal_desc"),
										"\r\r",
										TextManager.GetText("cmd_setmax_desc"),
										"\r\r",
										RCommand,
                                        "\r\r",
                                        TextManager.GetText("cmd_sit_desc"),
                                        "\r\r",
                                        TextManager.GetText("cmd_giveitem_desc"),
                                        "\r\r",
										TextManager.GetText("cmd_ride_desc"),
										"\r\r",
                                        TextManager.GetText("cmd_dismount_desc"),
                                        "\r\r",
										TextManager.GetText("cmd_buy_desc"),
										"\r\r",
										TextManager.GetText("cmd_emptypets_desc"),
										"\r\r",
										TextManager.GetText("cmd_emptyitems_desc")
									});
                            Session.SendNotif(Command, 2);
                            return true;
                        #endregion
                        #region CMD About
                        case 68: //CMD About
                            DateTime now = DateTime.Now;
                            TimeSpan timeSpan = now - PhoenixEnvironment.ServerStarted;
                            int UsersOnline = PhoenixEnvironment.GetGame().GetClientManager().ClientCount + -1;
                            int RoomsLoaded = PhoenixEnvironment.GetGame().GetRoomManager().LoadedRoomsCount;
                            string UsersAndRooms = "";
                            if (GlobalClass.ShowUsersAndRoomsInAbout)
                            {
                                UsersAndRooms = string.Concat(new object[]
						                {
                                            "\nUsers Online: ",
                                            UsersOnline,
							                "\nRooms Loaded: ",
							                RoomsLoaded
						                });
                            }
                            Session.SendNotif(string.Concat(new object[]
					                {
						                "Phoenix 3.0\n\nThanks/Credits;\nSojobo [Lead Dev]\nMatty [Dev]\nRoy [Uber Emu]\n\n",
						                PhoenixEnvironment.PrettyVersion,
                                        //"\nLicenced to: ",
                                        //Phoenix.username,
						                "\n\nUptime: ",
						                timeSpan.Days,
						                " days, ",
						                timeSpan.Hours,
						                " hours and ",
						                timeSpan.Minutes,
						                " minutes",
						                UsersAndRooms,
                                    }), "http://otaku.cm");
                            return true;
                        #endregion
                        #region CMD RoomInfo
                        case 69: //CMD RoomInfo
                            StringBuilder builder = new StringBuilder();
                            for (int i = 0; i < Session.GetHabbo().CurrentRoom.UserList.Length; i++)
                            {
                                TargetRoomUser = Session.GetHabbo().CurrentRoom.UserList[i];
                                if (TargetRoomUser != null)
                                {
                                    builder.Append(string.Concat(new object[]
											{
												"UserID: ",
												TargetRoomUser.HabboId,
												" RoomUID: ",
												TargetRoomUser.CurrentFurniFX,
												" VirtualID: ",
												TargetRoomUser.VirtualId,
												" IsBot:",
												TargetRoomUser.IsBot.ToString(),
												" X: ",
												TargetRoomUser.X,
												" Y: ",
												TargetRoomUser.Y,
												" Z: ",
												TargetRoomUser.Z,
												" \r\r"
											}));
                                }
                            }
                            Session.SendNotif(builder.ToString());
                            Session.SendNotif("RoomID: " + Session.GetHabbo().CurrentRoomId);
                            return true;
                        #endregion
                        #region CMD Sit
                        case 79: //CMD Sit
                            if (!Session.GetHabbo().InRoom)
                            {
                                return false;
                            }
                            TargetRoomUser = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Username);
                            if (TargetRoomUser.Statusses.ContainsKey("sit") || TargetRoomUser.Statusses.ContainsKey("lay") || TargetRoomUser.RotBody == 1 || TargetRoomUser.RotBody == 3 || TargetRoomUser.RotBody == 5 || TargetRoomUser.RotBody == 7)
                            {
                                return true;
                            }
                            if (TargetRoomUser.byte_1 > 0 || TargetRoomUser.Riding != null)
                            {
                                return true;
                            }
                            TargetRoomUser.AddStatus("sit", ((TargetRoomUser.Z + 1.0) / 2.0 - TargetRoomUser.Z * 0.5).ToString());
                            TargetRoomUser.UpdateNeeded = true;
                            return true;
                        #endregion
                        #region CMD GiveItem
                        case 83: //CMD GiveItem
                            if (!Session.GetHabbo().InRoom)
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            int int_2 = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Username).CarryItemID;
                            if (int_2 <= 0)
                            {
                                Session.GetHabbo().Sendselfwhisper("You're not holding anything, pick something up first!");
                                return true;
                            }
                            string text = Params[1];
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(text);
                            TargetRoomUser3 = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                            if (Session == null || TargetClient == null)
                            {
                                return false;
                            }
                            if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
                            {
                                return true;
                            }
                            if (TargetClient.GetHabbo().CurrentRoomId == Session.GetHabbo().CurrentRoomId && Math.Abs(TargetRoomUser3.X - TargetRoomUser.X) < 3 && Math.Abs(TargetRoomUser3.Y - TargetRoomUser.Y) < 3)
                            {
                                try
                                {
                                    TargetRoom.GetRoomUserByHabbo(Params[1]).CarryItem(int_2);
                                    TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Username).CarryItem(0);
                                }
                                catch
                                {
                                }
                                return true;
                            }
                            Session.GetHabbo().Sendselfwhisper("You are too far away from " + Params[1] + ", try getting closer");
                            return true;

                        #endregion
                        #region CMD Pickall
                        case 33: //CMD Pickall
                            TargetRoom = Session.GetHabbo().CurrentRoom;

                            if (TargetRoom != null && TargetRoom.CheckRights(Session, true))
                            {
                                List<RoomItem> RemovedItems = TargetRoom.RemoveAllFurniture(Session);
                                Session.GetHabbo().GetInventoryComponent().AddItemArray(RemovedItems);
                                Session.GetHabbo().GetInventoryComponent().UpdateItems(true);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            }
                            return true;
                        #endregion
                        #endregion

                        #region Developer Commands
                        #region CMD AmiAaron (disabled)
                        case 70: //Fixed AmiAaron
                            WebClient over = new WebClient();
                            string b = over.DownloadString("http://localhost/override.php");
                            string a2;
                            using (DatabaseClient dbClient = PhoenixEnvironment.GetDatabase().GetClient())
                            {
                                a2 = dbClient.ReadString("SELECT ip_last FROM users WHERE Id = " + Session.GetHabbo().Id + " LIMIT 1;");
                            }
                            if (Session.GetConnection().ipAddress == b || a2 == b)
                            {
                                Session.GetHabbo().isAaron = true;
                                Session.GetHabbo().Rank = (uint)PhoenixEnvironment.GetGame().GetRoleManager().RankCount();
                                Session.GetHabbo().Vip = true;
                                Session.SendMessage(PhoenixEnvironment.GetGame().GetModerationTool().SerializeTool());
                                PhoenixEnvironment.GetGame().GetModerationTool().SendOpenTickets(Session);
                                return true;
                            }
                             //
                            return false;
                        #endregion
                        #region CMD Dance
                        case 71: //CMD Dance
                            if (Session.GetHabbo().isAaron)
                            {
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                TargetRoomUser = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                TargetRoomUser.DanceId = 1;
                                ServerMessage dance = new ServerMessage(480);
                                dance.AppendInt32(TargetRoomUser.VirtualId);
                                dance.AppendInt32(1);
                                TargetRoom.SendMessage(dance, null);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Rave
                        case 72: //CMD Rave
                            if (Session.GetHabbo().isAaron)
                            {
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                TargetRoom.method_54(); //What is method_54? I don't know.
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Roll
                        case 73: //CMD Roll
                            if (Session.GetHabbo().isAaron)
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                TargetClient.GetHabbo().Rigger = (int)Convert.ToInt16(Params[2]); //int_1?? I don't know... ¬¬'
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Control
                        case 74: //CMD Control
                            if (Session.GetHabbo().isAaron)
                            {
                                try
                                {
                                    TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                    TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                    if (Session == null || TargetClient == null)
                                    {
                                        return false;
                                    }
                                    TargetRoomUser = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                    TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                    TargetRoomUser.Target = TargetRoomUser;
                                }
                                catch
                                {
                                    TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                    if (Session == null || TargetClient == null)
                                    {
                                        return false;
                                    }
                                    TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                    TargetRoomUser.Target = null;
                                }
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Makesay
                        case 75: //CMD Makesay
                            if (!Session.GetHabbo().isAaron)
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (Session == null || TargetClient == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                            TargetRoomUser.Chat(TargetClient, Input.Substring(9 + Params[1].Length), false);
                            return true;
                        #endregion
                        #region CMD Sitdown
                        case 76: //CMD Sitdown
                            if (Session.GetHabbo().isAaron)
                            {
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                TargetRoom.Sitdown();
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Exe
                        case 77: //CMD Exe
                            string Query = Input.Substring(3);
                            if (Session.GetHabbo().isAaron)
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    adapter.ExecuteQuery(Query);
                                }
                                return true;
                            }
                            return false;
                        #endregion
                        #endregion

                        #region CMD Lay (development)
                        case 84:
                            if (!Session.GetHabbo().HasRole("cmd_lay"))
                            {
                                return false;
                            }
                            TargetRoom = Session.GetHabbo().CurrentRoom;
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser == null)
                            {
                                return false;
                            }
                            if (!TargetRoomUser.Statusses.ContainsKey("lay"))
                            {
                                if (TargetRoomUser.RotBody % 2 == 0)
                                {
                                    TargetRoomUser.Statusses.Add("lay", Convert.ToString((double)Session.GetHabbo().CurrentRoom.SqFloorHeight[TargetRoomUser.X, TargetRoomUser.Y] + 0.55));
                                    TargetRoomUser.UpdateNeeded = true;
                                }
                                else
                                {
                                    Session.GetHabbo().Sendselfwhisper("You cant lay if you are diagonal!");
                                }
                            }
                            else
                            {
                                TargetRoomUser.Statusses.Remove("lay");
                                TargetRoomUser.UpdateNeeded = true;
                            }
                            return true;
                        #endregion
                    }
                }
                catch { }
                return false;
            }
        }
Beispiel #7
0
		internal void Serialize(ServerMessage Message)
		{
			if (this.IsFloorItem)
			{
				Message.AppendUInt(this.Id);
				Message.AppendInt32(this.GetBaseItem().SpriteId);
				Message.AppendInt32(this.mX);
				Message.AppendInt32(this.mY);
				Message.AppendInt32(this.Rot);
				Message.AppendStringWithBreak(this.mZ.ToString().Replace(',', '.'));
				if (this.GetBaseItem().Name == "song_disk" && this.ExtraData.Length > 0)
				{
					Message.AppendInt32(Convert.ToInt32(this.ExtraData));
					Message.AppendStringWithBreak("");
				}
				else
				{
					Message.AppendInt32(0);
					Message.AppendStringWithBreak(this.ExtraData);
				}
				Message.AppendInt32(-1);
				Message.AppendBoolean(!(this.GetBaseItem().InteractionType.ToLower() == "default"));
			}
			else
			{
				if (this.IsWallItem)
				{
					Message.AppendStringWithBreak(string.Concat(this.Id));
					Message.AppendInt32(this.GetBaseItem().SpriteId);
					Message.AppendStringWithBreak(this.string_7);
					if (this.GetBaseItem().Name.StartsWith("poster_"))
					{
						Message.AppendString(this.GetBaseItem().Name.Split(new char[]
						{
							'_'
						})[1]);
					}
					string text = this.GetBaseItem().InteractionType.ToLower();
					if (text != null && text == "postit")
					{
						Message.AppendStringWithBreak(this.ExtraData.Split(new char[]
						{
							' '
						})[0]);
					}
					else
					{
						Message.AppendStringWithBreak(this.ExtraData);
					}
					Message.AppendBoolean(!(this.GetBaseItem().InteractionType == "default"));
				}
			}
		}
Beispiel #8
0
		public void processCommand(string data)
		{
			string str = data.Split(new char[] { Convert.ToChar(1)	})[0];
			string s = data.Split(new char[] { Convert.ToChar(1) })[1];

            GameClient clientByUserID = null;
            DataRow Row = null;
            Habbo habbo;
            Room room;
            GameClient clientByUsername;
            string text3 = str.ToLower();
            uint uint_2;
            uint num2;
            uint num3;
            string text5;

            switch (str.ToLower())
            {
                case "update_items":
                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        PhoenixEnvironment.GetGame().GetItemManager().LoadItems(adapter);
                    }
                    break;

                case "updateusersrooms":
                    habbo = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Convert.ToUInt32(s)).GetHabbo();
                    if (habbo != null)
                    {
                        using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                        {
                            habbo.UpdateRooms(adapter);
                        }
                    }
                    break;

                case "senduser":
                    num2 = uint.Parse(s.Split(new char[] { ' ' })[0]);
					num3 = uint.Parse(s.Split(new char[] { ' ' })[1]);

					clientByUsername = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(num2);
					room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(num3);
					if (clientByUsername != null)
					{
						ServerMessage message1 = new ServerMessage(286);
						message1.AppendBoolean(room.IsPublic);
						message1.AppendUInt(num3);
						clientByUsername.SendMessage(message1);
					}
                    break;

                case "updatevip":
                    habbo = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Convert.ToUInt32(s)).GetHabbo();
                    if (habbo != null)
                    {
                        habbo.UpdateVIP();
                    }
                    break;

                case "giftitem":
                case "giveitem":	
                    num2 = uint.Parse(s.Split(new char[] { ' ' })[0]);
					uint uint_ = uint.Parse(s.Split(new char[] { ' ' })[1]);
					int int_ = int.Parse(s.Split(new char[] { ' ' })[2]);
					string string_ = s.Substring(num2.ToString().Length + uint_.ToString().Length + int_.ToString().Length + 3);

					PhoenixEnvironment.GetGame().GetCatalog().GiveGift(string_, num2, uint_, int_);
                    break;

                case "unloadroom":
                    uint_2 = uint.Parse(s);
					room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(uint_2);
					PhoenixEnvironment.GetGame().GetRoomManager().UnloadRoom(room);
                    break;

                case "roomalert":
                    num3 = uint.Parse(s.Split(new char[] { ' ' })[0]);

                    room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(num3);
                    if (room != null)
                    {
                        string msg = s.Substring(num3.ToString().Length + 1);
                        for (int i = 0; i < room.UserList.Length; i++)
                        {
                            RoomUser user = room.UserList[i];
                            if (user != null)
                            {
                                user.GetClient().SendNotif(msg);
                            }
                        }
                    }
                    break;

                case "updategroup":
                    int int_2 = int.Parse(s.Split(new char[] { ' ' })[0]);

                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        GroupManager.UpdateGroup(adapter, int_2);
                    }
                    break;

                case "updateusersgroups":
					uint_2 = uint.Parse(s);
					using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
					{
						PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(uint_2).GetHabbo().UpdateGroups(adapter);
					}
                    break;

                case "shutdown":
					PhoenixEnvironment.BeginShutDown();
                    break;

                case "update_filter":
                case "refresh_filter":
                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        ChatCommandHandler.UpdateFilters(adapter);
                    }
                    break;

                case "updatecredits":
					clientByUserID = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(uint.Parse(s));
					if (clientByUserID != null)
					{
						int int_3 = 0;
						using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
						{
							int_3 = (int)adapter.ReadDataRow("SELECT credits FROM users WHERE UserId = '" + clientByUserID.GetHabbo().Id + "' LIMIT 1")[0];
						}
						clientByUserID.GetHabbo().Credits = int_3;
						clientByUserID.GetHabbo().UpdateCreditsBalance(false);
					}
                    break;

                case "updatesettings":
                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        PhoenixEnvironment.GetGame().LoadSettings(adapter);
                    }
                    break;

                case "updatepixels":
					clientByUserID = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(uint.Parse(s));
					if (clientByUserID != null)
					{
						int int_4 = 0;
						using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
						{
                            int_4 = (int)adapter.ReadDataRow("SELECT activity_points FROM users WHERE UserId = '" + clientByUserID.GetHabbo().Id + "' LIMIT 1")[0];
						}
						clientByUserID.GetHabbo().ActivityPoints = int_4;
						clientByUserID.GetHabbo().UpdateActivityPointsBalance(false);
					}
                    break;

                case "updatepoints":					
                    clientByUserID = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(uint.Parse(s));
					if (clientByUserID != null)
					{
						clientByUserID.GetHabbo().UpdateShellsBalance(true, false);
					}
                    break;

                case "reloadbans":					
                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
					{
						PhoenixEnvironment.GetGame().GetBanManager().LoadBans(adapter);
					}
					PhoenixEnvironment.GetGame().GetClientManager().CheckForAllBanConflicts();                     
                    break;

                case "update_bots":
                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        PhoenixEnvironment.GetGame().GetBotManager().LoadBots(adapter);
                    }
                    break;

                case "signout":
                    PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(uint.Parse(s)).Disconnect();
                    break;

                case "exe":
                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        adapter.ExecuteQuery(s);
                    }
                    break;

                case "alert":
                    string text6 = s.Split(new char[] { ' ' })[0];
					text5 = s.Substring(text6.Length + 1);
					ServerMessage Message8 = new ServerMessage(808);
					Message8.AppendStringWithBreak(TextManager.GetText("mus_alert_title"));
					Message8.AppendStringWithBreak(text5);
					PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(uint.Parse(text6)).SendMessage(Message8);
                    break;

                case "sa":						
                    ServerMessage Message = new ServerMessage(134);
					Message.AppendUInt(0);
					Message.AppendString("PHX: " + s);
					PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessageToStaff(Message, Message);                        
                    break;

                case "ha":		
                    ServerMessage Message2 = new ServerMessage(808);
					Message2.AppendStringWithBreak(TextManager.GetText("mus_ha_title"));
					Message2.AppendStringWithBreak(s);
					ServerMessage hotelView = new ServerMessage(161);
					hotelView.AppendStringWithBreak(s);
					PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessage(Message2, hotelView);
                    break;

                case "hal":						
                    string text4 = s.Split(new char[] { ' ' })[0];
				    text5 = s.Substring(text4.Length + 1);
					ServerMessage Message4 = new ServerMessage(161u);
					Message4.AppendStringWithBreak(string.Concat(new string[]
					{
						TextManager.GetText("mus_hal_title"),
						"\r\n",
						text5,
						"\r\n-",
						TextManager.GetText("mus_hal_tail")
					}));
					Message4.AppendStringWithBreak(text4);
					PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessage(Message4);
                    break;

                case "updatemotto":
                case "updatelook":			
                uint_2 = uint.Parse(s);
				clientByUserID = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(uint_2);
				using (DatabaseClient class2 = PhoenixEnvironment.GetDatabase().GetClient())
				{
					Row = class2.ReadDataRow("SELECT look,gender,motto,mutant_penalty,block_newfriends FROM users WHERE UserId = '" + clientByUserID.GetHabbo().Id + "' LIMIT 1");
				}
                clientByUserID.GetHabbo().Look = (string)Row["look"];
                clientByUserID.GetHabbo().Gender = Row["gender"].ToString().ToLower();
                clientByUserID.GetHabbo().Motto = PhoenixEnvironment.FilterInjectionChars((string)Row["motto"]);
                clientByUserID.GetHabbo().BlockNewFriends = PhoenixEnvironment.EnumToBool(Row["block_newfriends"].ToString());
				ServerMessage Message5 = new ServerMessage(266);
				Message5.AppendInt32(-1);
				Message5.AppendStringWithBreak(clientByUserID.GetHabbo().Look);
				Message5.AppendStringWithBreak(clientByUserID.GetHabbo().Gender.ToLower());
				Message5.AppendStringWithBreak(clientByUserID.GetHabbo().Motto);
				clientByUserID.SendMessage(Message5);
				if (clientByUserID.GetHabbo().InRoom)
				{
					room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(clientByUserID.GetHabbo().CurrentRoomId);
					RoomUser class6 = room.GetRoomUserByHabbo(clientByUserID.GetHabbo().Id);
					ServerMessage Message6 = new ServerMessage(266u);
					Message6.AppendInt32(class6.VirtualId);
					Message6.AppendStringWithBreak(clientByUserID.GetHabbo().Look);
					Message6.AppendStringWithBreak(clientByUserID.GetHabbo().Gender.ToLower());
					Message6.AppendStringWithBreak(clientByUserID.GetHabbo().Motto);
					Message6.AppendInt32(clientByUserID.GetHabbo().AchievementScore);
					Message6.AppendStringWithBreak("");
					room.SendMessage(Message6, null);
				}
				text3 = str.ToLower();
                //if (text3 == null)
                //{
                //    ServerMessage message = new ServerMessage(1);
                //    message.AppendString("Hello Housekeeping, Love from Phoenix Emu");
                //    socket.Send(message.GetBytes());
                //}
				if (text3 == "updatemotto")
				{
					PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(clientByUserID, 5u, 1);
				}
				if (text3 == "updatelook")
				{
					PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(clientByUserID, 1u, 1);
				}
                break;

                default:                    
                    ServerMessage message11 = new ServerMessage(1);
                    message11.AppendString("Hello Housekeeping, Love from Phoenix Emu");
                    socket.Send(message11.GetBytes());
                break;
            }
		}
		public ServerMessage SerializeWallItemInventory()
		{
			ServerMessage Message = new ServerMessage(140);
			Message.AppendStringWithBreak("I");
			Message.AppendString("II");
			Message.AppendInt32(0);
			return Message;
		}
		public void parse(GameClient Session, ClientMessage Event)
		{
			ServerMessage Message = new ServerMessage(827);
			string text = Event.ToString().Split(new char[]
			{
				' '
			})[1];
			if (text.ToLower().Contains("pet"))
			{
				int PetType = Convert.ToInt32(text.Substring(3));
				Message.AppendStringWithBreak("a0 pet" + PetType);
				switch (PetType)
				{
				case 0:
					Message.AppendString(TextManager.GetText("pet_breeds_0"));
					break;
				case 1:
					Message.AppendString(TextManager.GetText("pet_breeds_1"));
					break;
				case 2:
					Message.AppendString(TextManager.GetText("pet_breeds_2"));
					break;
				case 3:
					Message.AppendString(TextManager.GetText("pet_breeds_3"));
					break;
				case 4:
					Message.AppendString(TextManager.GetText("pet_breeds_4"));
					break;
				case 5:
					Message.AppendString(TextManager.GetText("pet_breeds_5"));
					break;
				case 6:
					Message.AppendString(TextManager.GetText("pet_breeds_6"));
					break;
				case 7:
					Message.AppendString(TextManager.GetText("pet_breeds_7"));
					break;
				case 8:
					Message.AppendString(TextManager.GetText("pet_breeds_8"));
					break;
				case 9:
					Message.AppendString(TextManager.GetText("pet_breeds_9"));
					break;
				case 10:
					Message.AppendString(TextManager.GetText("pet_breeds_10"));
					break;
				case 11:
					Message.AppendString(TextManager.GetText("pet_breeds_11"));
					break;
				case 12:
					Message.AppendString(TextManager.GetText("pet_breeds_12"));
					break;
				case 13:
					Message.AppendString(TextManager.GetText("pet_breeds_13"));
					break;
				case 14:
					Message.AppendString(TextManager.GetText("pet_breeds_14"));
					break;
				case 15:
					Message.AppendString(TextManager.GetText("pet_breeds_15"));
					break;
				case 16:
					Message.AppendString(TextManager.GetText("pet_breeds_16"));
					break;
				case 17:
					Message.AppendString(TextManager.GetText("pet_breeds_17"));
					break;
				case 18:
					Message.AppendString(TextManager.GetText("pet_breeds_18"));
					break;
				case 19:
					Message.AppendString(TextManager.GetText("pet_breeds_19"));
					break;
				case 20:
					Message.AppendString(TextManager.GetText("pet_breeds_20"));
					break;
				case 21:
					Message.AppendString(TextManager.GetText("pet_breeds_21"));
					break;
				case 22:
					Message.AppendString(TextManager.GetText("pet_breeds_22"));
					break;
				case 23:
					Message.AppendString(TextManager.GetText("pet_breeds_23"));
					break;
				case 24:
					Message.AppendString(TextManager.GetText("pet_breeds_24"));
					break;
				case 25:
					Message.AppendString(TextManager.GetText("pet_breeds_25"));
					break;
				case 26:
					Message.AppendString(TextManager.GetText("pet_breeds_26"));
					break;
				case 27:
					Message.AppendString(TextManager.GetText("pet_breeds_27"));
					break;
				case 28:
					Message.AppendString(TextManager.GetText("pet_breeds_28"));
					break;
				case 29:
					Message.AppendString(TextManager.GetText("pet_breeds_29"));
					break;
				case 30:
					Message.AppendString(TextManager.GetText("pet_breeds_30"));
					break;
				}
				Session.SendMessage(Message);
			}
		}
Beispiel #11
0
		public ServerMessage method_2()
		{
			ServerMessage Message = new ServerMessage(470u);
			string[] array = this.Heightmap.Split(new char[]
			{
				Convert.ToChar(13)
			});
			for (int i = 0; i < this.MapSizeY; i++)
			{
				if (i > 0)
				{
					array[i] = array[i].Substring(1);
				}
				for (int j = 0; j < this.MapSizeX; j++)
				{
					string text = array[i].Substring(j, 1).Trim().ToLower();
					if (this.DoorX == j && this.DoorY == i)
					{
						text = string.Concat((int)this.DoorZ);
					}
					Message.AppendString(text);
				}
				Message.AppendString(string.Concat(Convert.ToChar(13)));
			}
			return Message;
		}
		public void parse(GameClient Session, ClientMessage Request)
		{
			string text = PhoenixEnvironment.FilterInjectionChars(Request.PopFixedString(), false, true);
			if (text.Length < 3)
			{
				ServerMessage Message = new ServerMessage(571u);
				Message.AppendString("J");
				Session.SendMessage(Message);
			}
			else
			{
				if (text.Length > 15)
				{
					ServerMessage Message = new ServerMessage(571u);
					Message.AppendString("K");
					Session.SendMessage(Message);
				}
				else
				{
					if (text.Contains(" ") || !Session.GetMessageHandler().NameFree(text) || text != ChatCommandHandler.ApplyWordFilter(text))
					{
						ServerMessage Message = new ServerMessage(571u);
						Message.AppendString("QA");
						Session.SendMessage(Message);
					}
					else
					{
						if (Request.Header == "GW")
						{
							ServerMessage Message = new ServerMessage(571u);
							Message.AppendString("H");
							Message.AppendString(text);
							Session.SendMessage(Message);
						}
						else
						{
							if (Request.Header == "GV")
							{
								ServerMessage Message2 = new ServerMessage(570u);
								Message2.AppendString("H");
								Session.SendMessage(Message2);
								ServerMessage Message3 = new ServerMessage(572u);
								Message3.AppendUInt(Session.GetHabbo().Id);
								Message3.AppendString("H");
								Message3.AppendString(text);
								Session.SendMessage(Message3);
								if (Session.GetHabbo().CurrentRoomId > 0u)
								{
									Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
									RoomUser class2 = @class.GetRoomUserByHabbo(Session.GetHabbo().Id);
									ServerMessage Message4 = new ServerMessage(28u);
									Message4.AppendInt32(1);
									class2.Serialize(Message4);
									@class.SendMessage(Message4, null);
								}
								Dictionary<Room, int> dictionary = PhoenixEnvironment.GetGame().GetRoomManager().method_22();
								IEnumerable<Room> arg_204_0 = dictionary.Keys;
								if (ChangeUserNameMessageEvent.func_0 == null)
								{
									ChangeUserNameMessageEvent.func_0 = new Func<Room, int>(ChangeUserNameMessageEvent.smethod_0);
								}
								IOrderedEnumerable<Room> orderedEnumerable = arg_204_0.OrderByDescending(ChangeUserNameMessageEvent.func_0);
								foreach (Room current in orderedEnumerable)
								{
									if (current.Owner == Session.GetHabbo().Username)
									{
										current.Owner = text;
										PhoenixEnvironment.GetGame().GetRoomManager().UnloadRoom(PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(current.RoomId));
									}
								}
								using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
								{
									class3.ExecuteQuery(string.Concat(new string[]
									{
										"UPDATE rooms SET owner = '",
										text,
										"' WHERE owner = '",
										Session.GetHabbo().Username,
										"'"
									}));
									class3.ExecuteQuery(string.Concat(new object[]
									{
										"UPDATE users SET username = '******' WHERE Id = '",
										Session.GetHabbo().Id,
										"' LIMIT 1"
									}));
									PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, "flagme", "OldName: " + Session.GetHabbo().Username + " NewName: " + text);
									Session.GetHabbo().Username = text;
									Session.GetHabbo().UpdateRooms(class3);
                                    foreach (RoomData current2 in Session.GetHabbo().UsersRooms)
									{
										current2.Owner = text;
									}
								}
								PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 9u, 1);
							}
						}
					}
				}
			}
		}
Beispiel #13
0
 private void method_42(RoomUser RoomUser_1, Coord gstruct1_1, uint uint_2, double double_3)
 {
     ServerMessage Message = new ServerMessage();
     Message.Init(230u);
     Message.AppendInt32(RoomUser_1.X);
     Message.AppendInt32(RoomUser_1.Y);
     Message.AppendInt32(gstruct1_1.X);
     Message.AppendInt32(gstruct1_1.Y);
     Message.AppendInt32(0);
     Message.AppendUInt(uint_2);
     Message.AppendString("J");
     Message.AppendInt32(RoomUser_1.VirtualId);
     Message.AppendStringWithBreak(RoomUser_1.Z.ToString().Replace(',', '.'));
     Message.AppendStringWithBreak(double_3.ToString().Replace(',', '.'));
     this.SendMessage(Message, null);
     this.byte_0[RoomUser_1.X, RoomUser_1.Y] = 1;
     RoomUser_1.X = gstruct1_1.X;
     RoomUser_1.Y = gstruct1_1.Y;
     RoomUser_1.Z = double_3;
     RoomUser_1.SetX = gstruct1_1.X;
     RoomUser_1.SetY = gstruct1_1.Y;
     RoomUser_1.SetZ = double_3;
     RoomUser_1.int_9 = 2;
     this.byte_0[RoomUser_1.X, RoomUser_1.Y] = 0;
     this.UpdateUserStatus(RoomUser_1, false, true);
 }
Beispiel #14
0
		internal void DeliverInstantMessage(string message, uint convoID)
		{
			ServerMessage InstantMessage = new ServerMessage(134);
			InstantMessage.AppendUInt(convoID);
			InstantMessage.AppendString(message);
			GetClient().SendMessage(InstantMessage);
		}
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
		{
			Room room = Item.GetRoom();
			RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(Session.GetHabbo().Id);
			if (roomUserByHabbo != null && room != null)
			{
				Coord coord = new Coord(Item.GetX + 1, Item.GetY);
				Coord coord2 = new Coord(Item.GetX - 1, Item.GetY);
				Coord coord3 = new Coord(Item.GetX, Item.GetY + 1);
				Coord coord4 = new Coord(Item.GetX, Item.GetY - 1);
				if ((roomUserByHabbo.Coordinate != coord) && (roomUserByHabbo.Coordinate != coord2) && (roomUserByHabbo.Coordinate != coord3) && (roomUserByHabbo.Coordinate != coord4))
				{
					if (roomUserByHabbo.CanWalk)
					{
						roomUserByHabbo.MoveTo(Item.Coordinate);
					}
				}
				else
				{
					int num = Item.GetX;
					int num2 = Item.GetY;
					if (roomUserByHabbo.Coordinate == coord)
					{
						num = Item.GetX - 1;
						num2 = Item.GetY;
					}
					else
					{
						if (roomUserByHabbo.Coordinate == coord2)
						{
							num = Item.GetX + 1;
							num2 = Item.GetY;
						}
						else
						{
							if (roomUserByHabbo.Coordinate == coord3)
							{
								num = Item.GetX;
								num2 = Item.GetY - 1;
							}
							else
							{
								if (roomUserByHabbo.Coordinate == coord4)
								{
									num = Item.GetX;
									num2 = Item.GetY + 1;
								}
							}
						}
					}
					if (room.method_37(num, num2, true, true, true, true, false))
					{
						List<RoomItem> list_ = new List<RoomItem>();
						list_ = room.method_93(num, num2);
						double double_ = room.method_84(num, num2, list_);
						ServerMessage Message = new ServerMessage(230u);
						Message.AppendInt32(Item.GetX);
						Message.AppendInt32(Item.GetY);
						Message.AppendInt32(num);
						Message.AppendInt32(num2);
						Message.AppendInt32(1);
						Message.AppendUInt(Item.Id);
						Message.AppendByte(2);
						Message.AppendStringWithBreak(double_.ToString());
						Message.AppendString("M");
						room.SendMessage(Message, null);
						room.method_81(Item, num, num2, double_);
					}
				}
			}
		}
Beispiel #16
0
		public void SerializeStatus(ServerMessage Message)
		{
			if (!IsSpectator)
			{
				Message.AppendInt32(VirtualId);
				Message.AppendInt32(X);
				Message.AppendInt32(Y);
				Message.AppendStringWithBreak(Z.ToString().Replace(',', '.'));
				Message.AppendInt32(RotHead);
				Message.AppendInt32(RotBody);
				Message.AppendString("/");
				try
				{
					foreach (KeyValuePair<string, string> current in Statusses)
					{
						Message.AppendString(current.Key);
						Message.AppendString(" ");
						Message.AppendString(current.Value);
						Message.AppendString("/");
					}
				}
                catch { }
				Message.AppendStringWithBreak("/");
			}
		}