示例#1
0
文件: UnBanUser.cs 项目: sgf/Yupi
        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;
            }
        }
示例#2
0
文件: FloodUser.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
            if (client == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (client.GetHabbo().Rank >= session.GetHabbo().Rank)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }
            int time;
            if (!int.TryParse(pms[1], out time))
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("enter_numbers"));
                return true;
            }

            client.GetHabbo().FloodTime = Yupi.GetUnixTimeStamp() + Convert.ToInt32(pms[1]);
            ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("FloodFilterMessageComposer"));
            serverMessage.AppendInteger(Convert.ToInt32(pms[1]));
            client.SendMessage(serverMessage);
            return true;
        }
示例#3
0
        public override bool Execute(GameClient session, string[] pms)
        {
            GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
            if (user == null || user.GetHabbo() == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }
            try
            {
                user.GetConnection().Dispose();
                Yupi.GetGame()
                    .GetModerationTool()
                    .LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "dc",
                        $"Disconnect User[{pms[1]}]");
            }
            catch
            {
            }

            return true;
        }
示例#4
0
        public override bool Execute(GameClient session, string[] pms)
        {
            GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);

            if (user == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }

            string userName = pms[0];
            string rank = pms[1];
            using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
            {
                adapter.SetQuery("UPDATE users SET rank=@rank WHERE username=@user LIMIT 1");
                adapter.AddParameter("user", userName);
                adapter.AddParameter("rank", rank);
                adapter.RunQuery();
            }

            session.SendWhisper(Yupi.GetLanguage().GetVar("user_rank_update"));
            return true;
        }
示例#5
0
文件: GiveDiamonds.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);

            if (client == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }

            uint amount;

            if (!uint.TryParse(pms[1], out amount))
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("enter_numbers"));
                return true;
            }

            client.GetHabbo().Diamonds += amount;
            client.GetHabbo().UpdateSeasonalCurrencyBalance();

            client.SendNotif(string.Format(Yupi.GetLanguage().GetVar("staff_gives_diamonds"), session.GetHabbo().UserName, amount));

            return true;
        }
示例#6
0
        public override bool Execute(GameClient session, string[] pms)
        {
            GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);

            if (user == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }
            try
            {
                Yupi.GetGame()
                    .GetBanManager()
                    .BanUser(user, session.GetHabbo().UserName, 788922000.0, string.Join(" ", pms.Skip(2)),
                        true, false);
            }
            catch
            {
                ServerLogManager.LogException($"An error occurred when {session.GetHabbo().UserName} tried to ban {user.GetHabbo().UserName}");
            }

            return true;
        }
示例#7
0
        public override bool Execute(GameClient session, string[] pms)
        {
            Room room = session.GetHabbo().CurrentRoom;
            RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
            if (user == null) return true;

            if (room.RoomData.DisablePull)
            {
                session.SendWhisper("Realizar Pull Foi Desativado pelo Dono do Quarto");
                return true;
            }

            GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
            if (client == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (client.GetHabbo().Id == session.GetHabbo().Id)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_own"));
                return true;
            }
            RoomUser user2 = room.GetRoomUserManager().GetRoomUserByHabbo(client.GetHabbo().Id);
            if (user2 == null) return true;
            if (user2.TeleportEnabled)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_error_teleport_enable"));
                return true;
            }

            if (PathFinder.GetDistance(user.X, user.Y, user2.X, user2.Y) > 2)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_far_away"));
                return true;
            }
            if (user.RotBody%2 != 0) user.RotBody--;
            switch (user.RotBody)
            {
                case 0:
                    user2.MoveTo(user.X, user.Y - 1);
                    break;

                case 2:
                    user2.MoveTo(user.X + 1, user.Y);
                    break;

                case 4:
                    user2.MoveTo(user.X, user.Y + 1);
                    break;

                case 6:
                    user2.MoveTo(user.X - 1, user.Y);
                    break;
            }
            return true;
        }
示例#8
0
文件: Kick.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            string userName = pms[0];
            GameClient userSession = Yupi.GetGame().GetClientManager().GetClientByUserName(userName);
            if (userSession == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (session.GetHabbo().Rank <= userSession.GetHabbo().Rank)
            {
                session.SendNotif(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }
            if (userSession.GetHabbo().CurrentRoomId < 1)
            {
                session.SendNotif(Yupi.GetLanguage().GetVar("command_kick_user_not_in_room"));
                return true;
            }
            Room room = Yupi.GetGame().GetRoomManager().GetRoom(userSession.GetHabbo().CurrentRoomId);
            if (room == null) return true;

            room.GetRoomUserManager().RemoveUserFromRoom(userSession, true, false);
            userSession.CurrentRoomUserId = -1;
            if (pms.Length > 1)
            {
                userSession.SendNotif(
                    string.Format(Yupi.GetLanguage().GetVar("command_kick_user_mod_default") + "{0}.",
                        string.Join(" ", pms.Skip(1))));
            }
            else userSession.SendNotif(Yupi.GetLanguage().GetVar("command_kick_user_mod_default"));

            return true;
        }
示例#9
0
        public override bool Execute(GameClient session, string[] pms)
        {
            Room room = session.GetHabbo().CurrentRoom;
            if (!session.GetHabbo().CurrentRoom.RoomMuted)
            {
                session.SendWhisper("Room isn't muted.");
                return true;
            }

            session.GetHabbo().CurrentRoom.RoomMuted = false;

            /*
            var message = new ServerMessage();
            message.Load(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer"));
            message.AppendString("Room is now UnMuted.");
            message.AppendString("");
            room.SendMessage(message);*/

            room.SendMessage(GameClient.GetBytesNotif("Este quarto foi des-selenciado."));

            Yupi.GetGame()
                .GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
                    "Room Unmute", "Room UnMuted");
            return true;
        }
示例#10
0
文件: RoomMute.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            Room room = session.GetHabbo().CurrentRoom;
            if (room.RoomMuted)
            {
                session.SendWhisper("Room is already muted.");
                return true;
            }

            session.GetHabbo().CurrentRoom.RoomMuted = true;

            /*
            var message = new ServerMessage(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer"));
            message.AppendString(string.Format("The room was muted due to:\r{0}", string.Join(" ", pms)));
            message.AppendString(string.Empty);
            room.SendMessage(message);*/

            room.SendMessage(GameClient.GetBytesNotif(
                $"Este quarto foi silenciado pelo motivo:\r{string.Join(" ", pms)}"));

            Yupi.GetGame()
                .GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
                    "Room Mute", "Room muted");
            return true;
        }
示例#11
0
文件: SpullUser.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            Room room = session.GetHabbo().CurrentRoom;
            RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
            if (user == null) return true;

            GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
            if (client == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (client.GetHabbo().Id == session.GetHabbo().Id)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_own"));
                return true;
            }
            RoomUser user2 = room.GetRoomUserManager().GetRoomUserByHabbo(client.GetHabbo().Id);
            if (user2 == null) return true;
            if (user2.TeleportEnabled)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_error_teleport_enable"));
                return true;
            }

            if (user.RotBody % 2 != 0) user.RotBody--;
            switch (user.RotBody)
            {
                case 0:
                    user2.MoveTo(user.X, user.Y - 1);
                    break;

                case 2:
                    user2.MoveTo(user.X + 1, user.Y);
                    break;

                case 4:
                    user2.MoveTo(user.X, user.Y + 1);
                    break;

                case 6:
                    user2.MoveTo(user.X - 1, user.Y);
                    break;
            }
            return true;
        }
示例#12
0
文件: SetSpeed.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            uint speed;
            if (uint.TryParse(pms[0], out speed)) session.GetHabbo().CurrentRoom.GetRoomItemHandler().SetSpeed(speed);
            else session.SendWhisper(Yupi.GetLanguage().GetVar("command_setspeed_error_numbers"));

            return true;
        }
示例#13
0
文件: UnMute.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
            if (client == null || client.GetHabbo() == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (client.GetHabbo().Rank >= 4)
            {
                session.SendWhisper("You are not allowed to mute that user.");
            }

            Yupi.GetGame()
                .GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, client.GetHabbo().UserName,
                    "Unmute", "Unmuted user");
            client.GetHabbo().UnMute();
            return true;
        }
示例#14
0
文件: Freeze.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            RoomUser user = session.GetHabbo()
                .CurrentRoom.GetRoomUserManager()
                .GetRoomUserByHabbo(pms[0]);
            if (user == null) session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
            else user.Frozen = !user.Frozen;

            return true;
        }
示例#15
0
        public override bool Execute(GameClient session, string[] pms)
        {
            string mode = pms[0];
            pms = pms.Skip(1).ToArray();

            switch (mode.ToLower())
            {
                case "info":
                {
                    if (pms.Length == 0) session.SendWhisper("Usage :developer info [items/user/users/cache]");
                    else return GetInfo(session, pms);

                    break;
                }
                case "set":
                {
                    if (pms.Length < 2) session.SendWhisper("Usage :developer set [item/baseItem] id");
                    else return Set(session, pms);

                    break;
                }
                case "copy":
                {
                    return Copy(session);
                }
                case "paste":
                {
                    return Paste(session);
                }
                case "delete":
                {
                    return Delete(session);
                }
                default:
                {
                    session.SendWhisper("Usage :developer [info/set/copy/paste/delete]");
                    break;
                }
            }

            return true;
        }
示例#16
0
文件: EmptyUser.cs 项目: sgf/Yupi
 public override bool Execute(GameClient session, string[] pms)
 {
     GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
     if (client == null || client.GetHabbo().Rank >= session.GetHabbo().Rank)
     {
         session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
         return true;
     }
     client.GetHabbo().GetInventoryComponent().ClearItems();
     return true;
 }
示例#17
0
文件: Kill.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            Room room = Yupi.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);
            if (room == null) return true;

            RoomUser user2 = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().LastSelectedUser);
            if (user2 == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }

            RoomUser user =
                room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().UserName);
            if (PathFinder.GetDistance(user.X, user.Y, user2.X, user2.Y) > 1)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("kil_command_error_1"));

                return true;
            }
            if (user2.IsLyingDown || user2.IsSitting)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("kil_command_error_2"));
                return true;
            }
            if (
                !string.Equals(user2.GetUserName(), session.GetHabbo().UserName,
                    StringComparison.CurrentCultureIgnoreCase))
            {
                user2.Statusses.Add("lay", "0.55");
                user2.IsLyingDown = true;
                user2.UpdateNeeded = true;
                user.Chat(user.GetClient(), Yupi.GetLanguage().GetVar("command.kill.user"), true, 0, 3);
                user2.Chat(user2.GetClient(), Yupi.GetLanguage().GetVar("command.kill.userdeath"), true, 0,
                    3);
                return true;
            }
            user.Chat(session, "I am sad", false, 0);
            return true;
        }
示例#18
0
文件: AddBlackWord.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            string type = pms[0];
            string word = pms[1];

            if (string.IsNullOrEmpty(word))
            {
                session.SendWhisper("Palabra inválida.");
                return true;
            }
            BlackWordsManager.AddBlackWord(type, word);
            return true;
        }
示例#19
0
文件: Alert.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            string userName = pms[0];
            string msg = string.Join(" ", pms.Skip(1));

            GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(userName);
            if (client == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            client.SendNotif($"{msg} \r\r-{session.GetHabbo().UserName}");
            return true;
        }
示例#20
0
文件: TelePort.cs 项目: sgf/Yupi
 public override bool Execute(GameClient session, string[] pms)
 {
     Room room = session.GetHabbo().CurrentRoom;
     RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
     if (user == null) return true;
     if (!user.RidingHorse)
     {
         user.TeleportEnabled = !user.TeleportEnabled;
         room.GetGameMap().GenerateMaps();
         return true;
     }
     session.SendWhisper(Yupi.GetLanguage().GetVar("command_error_teleport_enable"));
     return true;
 }
示例#21
0
文件: SetMax.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            ushort maxUsers;
            if (!ushort.TryParse(pms[0], out maxUsers) || maxUsers == 0 || maxUsers > 200)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_setmax_error_number"));
                return true;
            }

            if (maxUsers > 100 && !(session.GetHabbo().Vip || session.GetHabbo().HasFuse("fuse_vip_commands")))
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_setmax_error_max"));
                return true;
            }
            if (maxUsers < 10 && !(session.GetHabbo().Vip || session.GetHabbo().HasFuse("fuse_vip_commands")))
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_setmax_error_min"));
                return true;
            }

            session.GetHabbo().CurrentRoom.SetMaxUsers(maxUsers);
            return true;
        }
示例#22
0
文件: BanUser.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            {
                GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);

                if (user == null)
                {
                    session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                    return true;
                }
                if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
                {
                    session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
                    return true;
                }
                try
                {
                    int length = int.Parse(pms[1]);

                    string message = pms.Length < 3 ? string.Empty : string.Join(" ", pms.Skip(2));
                    if (string.IsNullOrWhiteSpace(message))
                        message = Yupi.GetLanguage().GetVar("command_ban_user_no_reason");

                    ModerationTool.BanUser(session, user.GetHabbo().Id, length, message);
                    Yupi.GetGame()
                        .GetModerationTool()
                        .LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "Ban",
                            $"USER:{pms[0]} TIME:{pms[1]} REASON:{pms[2]}");
                }
                catch
                {
                    // error handle
                }

                return true;
            }
        }
示例#23
0
文件: StartQuestion.cs 项目: sgf/Yupi
 public override bool Execute(GameClient client, string[] pms)
 {
     uint id = uint.Parse(pms[0]);
     Poll poll = Yupi.GetGame().GetPollManager().TryGetPollById(id);
     if (poll == null || poll.Type != PollType.Matching)
     {
         client.SendWhisper("Poll doesn't exists or isn't a matching poll.");
         return true;
     }
     poll.AnswersPositive = 0;
     poll.AnswersNegative = 0;
     MatchingPollAnswer(client, poll);
     Thread showPoll = new Thread(delegate () { MatchingPollResults(client, poll); });
     showPoll.Start();
     return true;
 }
示例#24
0
文件: Dance.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            ushort result;
            ushort.TryParse(pms[0], out result);

            if (result > 4)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_dance_false"));
                result = 0;
            }
            ServerMessage message = new ServerMessage();
            message.Init(LibraryParser.OutgoingRequest("DanceStatusMessageComposer"));
            message.AppendInteger(session.CurrentRoomUserId);
            message.AppendInteger(result);
            session.GetHabbo().CurrentRoom.SendMessage(message);

            return true;
        }
示例#25
0
文件: FollowUser.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
            if (client == null || client.GetHabbo() == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (client.GetHabbo().CurrentRoom == null ||
                client.GetHabbo().CurrentRoom == session.GetHabbo().CurrentRoom)
                return false;
            ServerMessage roomFwd =
                new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer"));
            roomFwd.AppendInteger(client.GetHabbo().CurrentRoom.RoomId);
            session.SendMessage(roomFwd);

            return true;
        }
示例#26
0
文件: UserInfo.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            string userName = pms[0];
            if (string.IsNullOrEmpty(userName)) return true;
            GameClient clientByUserName = Yupi.GetGame().GetClientManager().GetClientByUserName(userName);
            if (clientByUserName == null || clientByUserName.GetHabbo() == null)
            {
                using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
                {
                    adapter.SetQuery(
                        "SELECT username, rank, id, credits, activity_points, diamonds FROM users WHERE username=@user LIMIT 1");
                    adapter.AddParameter("user", userName);
                    DataRow row = adapter.GetRow();

                    if (row == null)
                    {
                        session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                        return true;
                    }
                    session.SendNotif(string.Format(Yupi.GetLanguage().GetVar("user_info_all"), userName, row[1],
                        row[3], row[4], row[5]));
                }
                return true;
            }
            Habbo habbo = clientByUserName.GetHabbo();
            StringBuilder builder = new StringBuilder();
            if (habbo.CurrentRoom != null)
            {
                builder.AppendFormat(" - ROOM INFORMATION [{0}] - \r", habbo.CurrentRoom.RoomId);
                builder.AppendFormat("Owner: {0}\r", habbo.CurrentRoom.RoomData.Owner);
                builder.AppendFormat("Room Name: {0}\r", habbo.CurrentRoom.RoomData.Name);
                builder.Append(
                    string.Concat("Current Users: ", habbo.CurrentRoom.UserCount, "/",
                        habbo.CurrentRoom.RoomData.UsersMax));
            }
            session.SendNotif(string.Concat("User info for: ", userName, " \rUser ID: ", habbo.Id, ":\rRank: ",
                habbo.Rank, "\rCurrentTalentLevel: ", habbo.CurrentTalentLevel, " \rCurrent Room: ", habbo.CurrentRoomId,
                " \rCredits: ", habbo.Credits, "\rDuckets: ", habbo.ActivityPoints, "\rDiamonds: ", habbo.Diamonds,
                "\rMuted: ", habbo.Muted.ToString(), "\r\r\r", builder.ToString()));

            return true;
        }
示例#27
0
文件: HandItem.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            ushort itemId;

            if (!ushort.TryParse(pms[0], out itemId))
                return true;

            RoomUser user = session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().UserName);

            if (user.RidingHorse)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("horse_handitem_error"));
                return true;
            }

            if (user.IsLyingDown)
                return true;

            user.CarryItem(itemId);

            return true;
        }
示例#28
0
        public override bool Execute(GameClient session, string[] pms)
        {
            Room room = session.GetHabbo().CurrentRoom;

            RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(pms[0]);
            if (user == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }

            string gender = user.GetClient().GetHabbo().Gender;
            string look = user.GetClient().GetHabbo().Look;
            session.GetHabbo().Gender = gender;
            session.GetHabbo().Look = look;
            using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
            {
                adapter.SetQuery(
                    "UPDATE users SET gender = @gender, look = @look WHERE id = " + session.GetHabbo().Id);
                adapter.AddParameter("gender", gender);
                adapter.AddParameter("look", look);
                adapter.RunQuery();
            }

            RoomUser myUser = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().UserName);
            if (myUser == null) return true;

            ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserDataMessageComposer"));
            message.AppendInteger(myUser.VirtualId);
            message.AppendString(session.GetHabbo().Look);
            message.AppendString(session.GetHabbo().Gender.ToLower());
            message.AppendString(session.GetHabbo().Motto);
            message.AppendInteger(session.GetHabbo().AchievementPoints);
            room.SendMessage(message.GetReversedBytes());

            return true;
        }
示例#29
0
文件: MassDance.cs 项目: sgf/Yupi
        public override bool Execute(GameClient session, string[] pms)
        {
            ushort danceId;
            ushort.TryParse(pms[0], out danceId);

            if (danceId > 4)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("command_dance_wrong_syntax"));
                return true;
            }
            Room room = Yupi.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);
            HashSet<RoomUser> roomUsers = room.GetRoomUserManager().GetRoomUsers();

            foreach (RoomUser roomUser in roomUsers)
            {
                ServerMessage message =
                    new ServerMessage(LibraryParser.OutgoingRequest("DanceStatusMessageComposer"));
                message.AppendInteger(roomUser.VirtualId);
                message.AppendInteger(danceId);
                room.SendMessage(message);
                roomUser.DanceId = danceId;
            }
            return true;
        }
示例#30
0
        /// <summary>
        ///     Tries the execute.
        /// </summary>
        /// <param name="parameters"></param>
        /// <param name="client">The client.</param>
        /// <param name="scommand"></param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public static bool TryExecute(string scommand, string parameters, GameClient client)
        {
            if (string.IsNullOrEmpty(scommand) || string.IsNullOrEmpty(parameters) || client.GetHabbo() == null || !client.GetHabbo().InRoom)
                return false;

            string[] pms = parameters.Split(' ');

            string commandName = scommand;

            if (AliasDictionary.ContainsKey(commandName))
                commandName = AliasDictionary[commandName];

            if (!CommandsDictionary.ContainsKey(commandName))
                return false;

            Command command = CommandsDictionary[commandName];

            if (!CanUse(command.MinRank, client))
                return false;

            if (command.MinParams == -2 || (command.MinParams == -1 && pms.Length > 1) || command.MinParams != -1 && command.MinParams == pms.Length - 1)
                return command.Execute(client, pms.Skip(1).ToArray());

            client.SendWhisper(Yupi.GetLanguage().GetVar("use_the_command_as") + command.Usage);

            return true;
        }