Example #1
0
        public override bool Execute(GameClient session, string[] pms)
        {
            Habbo user = Yupi.GetHabboForName(pms[0]);

            if (user == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return(true);
            }
            if (user.Rank >= session.GetHabbo().Rank)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
                return(true);
            }
            using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
            {
                adapter.SetQuery("DELETE FROM users_bans WHERE value = @name");
                adapter.AddParameter("name", user.UserName);
                adapter.RunQuery();
                Yupi.GetGame()
                .GetModerationTool()
                .LogStaffEntry(session.GetHabbo().UserName, user.UserName, "Unban",
                               $"User has been Unbanned [{pms[0]}]");
                return(true);
            }
        }
Example #2
0
        public override bool Execute(GameClient session, string[] pms)
        {
            if (pms.Length != 1)
            {
                return(true);
            }

            if (string.IsNullOrEmpty(pms[0]))
            {
                return(true);
            }

            string userName = Yupi.FilterInjectionChars(pms[0]);

            Habbo userCached = Yupi.GetHabboForName(userName);

            if (userCached == null)
            {
                return(true);
            }

            StringBuilder builder = new StringBuilder();

            if (userCached.CurrentRoom != null)
            {
                builder.Append($" - ROOM INFORMATION [{userCached.CurrentRoom.RoomId}] - \r");
                builder.Append($"Owner: {userCached.CurrentRoom.RoomData.Owner}\r");
                builder.Append($"Room Name: {userCached.CurrentRoom.RoomData.Name}\r");
                builder.Append($"Current Users: {userCached.CurrentRoom.UserCount} / {userCached.CurrentRoom.RoomData.UsersMax}");
            }

            session.SendNotif(string.Concat("User info for: ", userName, " \rUser ID: ", userCached.Id, ":\rRank: ",
                                            userCached.Rank, "\rCurrentTalentLevel: ", userCached.CurrentTalentLevel, " \rCurrent Room: ", userCached.CurrentRoomId,
                                            " \rCredits: ", userCached.Credits, "\rDuckets: ", userCached.Duckets, "\rDiamonds: ", userCached.Diamonds,
                                            "\rMuted: ", userCached.Muted.ToString(), "\r\r\r", builder.ToString()));

            return(true);
        }