Beispiel #1
0
 public override bool Execute(GameClient session, string[] pms)
 {
     var room = Azure.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);
     room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
     foreach (var user in room.GetRoomUserManager().GetRoomUsers()) user.ApplyEffect(108);
     return true;
 }
        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            RoomUser roomUser = null;

            if (session != null)
                roomUser = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (roomUser == null)
                return;

            if (Gamemap.TilesTouching(item.X, item.Y, roomUser.X, roomUser.Y))
            {
                var num = item.GetBaseItem().Modes - 1;
                int num2, num3;
                int.TryParse(item.ExtraData, out num2);

                if (num2 <= 0)
                    num3 = 1;
                else
                {
                    if (num2 >= num)
                        num3 = 0;
                    else
                        num3 = num2 + 1;
                }

                item.ExtraData = num3.ToString();
                item.UpdateState();
                item.GetRoom().GetWiredHandler().ExecuteWired(Interaction.TriggerStateChanged, roomUser, item);

                return;
            }

            roomUser.MoveTo(item.SquareInFront);
        }
 public override bool Execute(GameClient session, string[] pms)
 {
     Azure.GetGame().GetHallOfFame().RefreshHallOfFame();
     Azure.GetGame().GetRoomManager().GetCompetitionManager().RefreshCompetitions();
     Azure.GetGame().GetTargetedOfferManager().LoadOffer();
     return true;
 }
Beispiel #4
0
        public override bool Execute(GameClient session, string[] pms)
        {
            var client = Azure.GetGame().GetClientManager().GetClientByUserName(pms[0]);
            if (client == null)
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (client.GetHabbo().Rank >= session.GetHabbo().Rank)
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }
            int time;
            if (!int.TryParse(pms[1], out time))
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("enter_numbers"));
                return true;
            }

            client.GetHabbo().FloodTime = Azure.GetUnixTimeStamp() + Convert.ToInt32(pms[1]);
            var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("FloodFilterMessageComposer"));
            serverMessage.AppendInteger(Convert.ToInt32(pms[1]));
            client.SendMessage(serverMessage);
            return true;
        }
 public override bool Execute(GameClient session, string[] pms)
 {
     using (var adapter = Azure.GetDatabaseManager().GetQueryReactor())
         Azure.ConfigData = new ConfigData(adapter);
     session.SendNotif(Azure.GetLanguage().GetVar("command_refresh_settings"));
     return true;
 }
        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (!hasRights)
                return;

            int num;

            int.TryParse(item.ExtraData, out num);

            switch (request)
            {
                case 1:
                    num++;
                    break;

                case 2:
                    num--;
                    break;

                case 3:
                    num = 0;
                    break;
            }

            item.ExtraData = num.ToString();
            item.UpdateState(false, true);
        }
        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (item.ExtraData == "1" || !item.GetBaseItem().VendingIds.Any() || item.InteractingUser != 0u ||
                session == null)
                return;

            var roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (roomUserByHabbo == null)
                return;

            if (!Gamemap.TilesTouching(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y))
            {
                roomUserByHabbo.MoveTo(item.SquareInFront);
                return;
            }

            item.InteractingUser = session.GetHabbo().Id;
            roomUserByHabbo.CanWalk = false;
            roomUserByHabbo.ClearMovement();

            roomUserByHabbo.SetRot(PathFinder.CalculateRotation(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y));

            item.ReqUpdate(2, true);
            item.ExtraData = "1";
            item.UpdateState(false, true);
        }
Beispiel #8
0
        public override bool Execute(GameClient session, string[] pms)
        {
            session.GetHabbo().SpectatorMode = true;
            session.SendNotif("In next room you enter you will be invisible.");

            return true;
        }
        public override bool Execute(GameClient session, string[] pms)
        {
            var user = Azure.GetGame().GetClientManager().GetClientByUserName(pms[0]);
            if (user == null || user.GetHabbo() == null)
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }
            try
            {
                user.GetConnection().Dispose();
                Azure.GetGame()
                    .GetModerationTool()
                    .LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "dc",
                        string.Format("Disconnect User[{0}]", pms[1]));
            }
            catch
            {
            }

            return true;
        }
        public override void OnPlace(GameClient session, RoomItem item)
        {
            item.ExtraData = "0";

            if (item.InteractingUser != 0u)
            {
                var roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser);

                if (roomUserByHabbo != null)
                {
                    roomUserByHabbo.ClearMovement();
                    roomUserByHabbo.AllowOverride = false;
                    roomUserByHabbo.CanWalk = true;
                }

                item.InteractingUser = 0u;
            }

            if (item.InteractingUser2 == 0u)
                return;

            var roomUserByHabbo2 = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser2);

            if (roomUserByHabbo2 != null)
            {
                roomUserByHabbo2.ClearMovement();
                roomUserByHabbo2.AllowOverride = false;
                roomUserByHabbo2.CanWalk = true;
            }

            item.InteractingUser2 = 0u;
        }
Beispiel #11
0
 public override bool Execute(GameClient session, string[] pms)
 {
     if (pms[0].Length < 2) return true;
     var room = session.GetHabbo().CurrentRoom;
     foreach (var current in room.GetRoomUserManager().UserList.Values)
     {
         try
         {
             if (!current.IsBot && current.GetClient() != null &&
                 current.GetClient().GetHabbo() != null)
             {
                 current.GetClient()
                     .GetHabbo()
                     .GetBadgeComponent()
                     .GiveBadge(pms[0], true, current.GetClient());
             }
         }
         catch
         {
         }
     }
     Azure.GetGame().GetModerationTool()
         .LogStaffEntry(session.GetHabbo().UserName,
             string.Empty, "Badge",
             string.Concat("Roombadge in room [", room.RoomId, "] with badge [", pms[0], "]"));
     return true;
 }
Beispiel #12
0
        public override bool Execute(GameClient session, string[] pms)
        {
            var 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)}"));

            Azure.GetGame()
                .GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
                    "Room Mute", "Room muted");
            return true;
        }
Beispiel #13
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="HelperSession" /> class.
 /// </summary>
 /// <param name="helper">The helper.</param>
 /// <param name="requester">The requester.</param>
 /// <param name="question">The question.</param>
 internal HelperSession(GameClient helper, GameClient requester, string question)
 {
     Helper = helper;
     Requester = requester;
     Chats = new List<string> {question};
     Response(requester, question);
 }
        public override void OnPlace(GameClient session, RoomItem item)
        {
            item.ExtraData = "0";

            if (item.InteractingUser != 0)
            {
                var user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser);

                if (user != null)
                {
                    user.ClearMovement();
                    user.AllowOverride = false;
                    user.CanWalk = true;
                }

                item.InteractingUser = 0;
            }

            if (item.InteractingUser2 != 0)
            {
                var user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser2);

                if (user != null)
                {
                    user.ClearMovement();
                    user.AllowOverride = false;
                    user.CanWalk = true;
                }

                item.InteractingUser2 = 0;
            }
        }
Beispiel #15
0
        public override bool Execute(GameClient session, string[] pms)
        {
            var user = Azure.GetHabboForName(pms[0]);

            if (user == null)
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (user.Rank >= session.GetHabbo().Rank)
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }
            using (var adapter = Azure.GetDatabaseManager().GetQueryReactor())
            {
                adapter.SetQuery("DELETE FROM users_bans WHERE value = @name");
                adapter.AddParameter("name", user.UserName);
                adapter.RunQuery();
                Azure.GetGame()
                    .GetModerationTool()
                    .LogStaffEntry(session.GetHabbo().UserName, user.UserName, "Unban",
                        string.Format("User has been Unbanned [{0}]", pms[0]));
                return true;
            }
        }
Beispiel #16
0
        public override bool Execute(GameClient session, string[] pms)
        {
            var user = Azure.GetGame().GetClientManager().GetClientByUserName(pms[0]);

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

            var userName = pms[0];
            var rank = pms[1];
            using (var adapter = Azure.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(Azure.GetLanguage().GetVar("user_rank_update"));
            return true;
        }
Beispiel #17
0
        public override bool Execute(GameClient session, string[] pms)
        {
            var 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.Init(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer"));
            message.AppendString("Room is now UnMuted.");
            message.AppendString("");
            room.SendMessage(message);*/

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

            Azure.GetGame()
                .GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
                    "Room Unmute", "Room UnMuted");
            return true;
        }
Beispiel #18
0
        public override bool Execute(GameClient session, string[] pms)
        {
            var user = Azure.GetGame().GetClientManager().GetClientByUserName(pms[0]);

            if (user == null)
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }
            try
            {
                Azure.GetGame()
                    .GetBanManager()
                    .BanUser(user, session.GetHabbo().UserName, 788922000.0, string.Join(" ", pms.Skip(2)),
                        true, false);
            }
            catch
            {
                Writer.Writer.LogException("Error while banning");
            }

            return true;
        }
Beispiel #19
0
        public override bool Execute(GameClient session, string[] pms)
        {
            var userName = pms[0];
            var userSession = Azure.GetGame().GetClientManager().GetClientByUserName(userName);
            if (userSession == null)
            {
                session.SendWhisper(Azure.GetLanguage().GetVar("user_not_found"));
                return true;
            }
            if (session.GetHabbo().Rank <= userSession.GetHabbo().Rank)
            {
                session.SendNotif(Azure.GetLanguage().GetVar("user_is_higher_rank"));
                return true;
            }
            if (userSession.GetHabbo().CurrentRoomId < 1)
            {
                session.SendNotif(Azure.GetLanguage().GetVar("command_kick_user_not_in_room"));
                return true;
            }
            var room = Azure.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(Azure.GetLanguage().GetVar("command_kick_user_mod_default") + "{0}.",
                        string.Join(" ", pms.Skip(1))));
            }
            else userSession.SendNotif(Azure.GetLanguage().GetVar("command_kick_user_mod_default"));

            return true;
        }
        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            RoomUser roomUser = null;
            if (session != null)
                roomUser = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (roomUser == null)
                return;

            if (Gamemap.TilesTouching(item.X, item.Y, roomUser.X, roomUser.Y))
            {
                if (item.ExtraData == "-1")
                    return;

                if (request == -1)
                {
                    item.ExtraData = "0";
                    item.UpdateState();
                    return;
                }

                item.ExtraData = "-1";
                item.UpdateState(false, true);
                item.ReqUpdate(4, true);
                return;
            }

            roomUser.MoveTo(item.SquareInFront);
        }
Beispiel #21
0
        public override bool Execute(GameClient client, string[] pms)
        {
            var message =
                new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));

            message.AppendString("Azure");
            message.AppendInteger(4);
            message.AppendString("title");
            message.AppendString("ManiaEVO 1.2");
            message.AppendString("message");
            var info = new StringBuilder();
            info.Append("<h5><b>ManiaEVO 1.2 - Base: Azure</b><h5></br></br>");
            info.Append("<br />");
            info.AppendFormat(
                "<b><br />Desenvolvedores:</b> <br />iPlezier <br />Claudi0<br />Kessiler <br /><br /> ");
            info.AppendFormat(
                "<b>Créditos:</b> <br />Jamal, Claudio, Boris, Lucca, Antoine, IhToN<br /> <br /> ");
            info.AppendFormat("<b>Estatisticas:</b> <br />");
            var userCount = Azure.GetGame().GetClientManager().Clients.Count;
            var roomsCount = Azure.GetGame().GetRoomManager().LoadedRooms.Count;
            info.AppendFormat("<b>Usuários:</b> {0} em {1}{2}.<br /><br /><br />", userCount, roomsCount,
                (roomsCount == 1) ? " Quarto" : " Quartos");
            message.AppendString(info.ToString());
            message.AppendString("linkUrl");
            message.AppendString("event:");
            message.AppendString("linkTitle");
            message.AppendString("ok");
            client.SendMessage(message);

            return true;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="InventoryComponent" /> class.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="client">The client.</param>
        /// <param name="userData">The user data.</param>
        internal InventoryComponent(uint userId, GameClient client, UserData userData)
        {
            _mClient = client;
            UserId = userId;
            _floorItems = new HybridDictionary();
            _wallItems = new HybridDictionary();
            SongDisks = new HybridDictionary();

            foreach (var current in userData.Inventory)
            {
                if (current.BaseItem.InteractionType == Interaction.MusicDisc)
                    SongDisks.Add(current.Id, current);
                if (current.IsWallItem)
                    _wallItems.Add(current.Id, current);
                else
                    _floorItems.Add(current.Id, current);
            }

            _inventoryPets = new HybridDictionary();
            _inventoryBots = new HybridDictionary();
            _mAddedItems = new HybridDictionary();
            _mRemovedItems = new HybridDictionary();
            _isUpdated = false;

            foreach (var bot in userData.Bots)
                AddBot(bot.Value);

            foreach (var pets in userData.Pets)
                AddPets(pets.Value);
        }
        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (session == null)
                return;

            var user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (user == null)
                return;

            if (user.Coordinate != item.SquareInFront && user.CanWalk)
            {
                user.MoveTo(item.SquareInFront);
                return;
            }

            if (!item.GetRoom().GetGameMap().CanWalk(item.SquareBehind.X, item.SquareBehind.Y, user.AllowOverride))
                return;

            if (item.InteractingUser == 0)
            {
                item.InteractingUser = user.HabboId;

                user.CanWalk = false;

                if (user.IsWalking && (user.GoalX != item.SquareInFront.X || user.GoalY != item.SquareInFront.Y))
                    user.ClearMovement();

                user.AllowOverride = true;
                user.MoveTo(item.Coordinate);

                item.ReqUpdate(4, true);
            }
        }
        /// <summary>
        ///     Gives the badge.
        /// </summary>
        /// <param name="badge">The badge.</param>
        /// <param name="inDatabase">if set to <c>true</c> [in database].</param>
        /// <param name="session">The session.</param>
        /// <param name="wiredReward">if set to <c>true</c> [wired reward].</param>
        internal void GiveBadge(string badge, bool inDatabase, GameClient session, bool wiredReward = false)
        {
            if (wiredReward)
                session.SendMessage(SerializeBadgeReward(!HasBadge(badge)));

            if (HasBadge(badge))
                return;

            if (inDatabase)
            {
                using (var queryReactor = Azure.GetDatabaseManager().GetQueryReactor())
                {
                    queryReactor.SetQuery(
                        string.Concat("INSERT INTO users_badges (user_id,badge_id,badge_slot) VALUES (", _userId,
                            ",@badge,", 0, ")"));
                    queryReactor.AddParameter("badge", badge);
                    queryReactor.RunQuery();
                }
            }

            BadgeList.Add(badge, new Badge(badge, 0));

            session.SendMessage(SerializeBadge(badge));
            session.SendMessage(Update(badge));
        }
        /// <summary>
        ///     Serializes the quest.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="session">The session.</param>
        /// <param name="quest">The quest.</param>
        /// <param name="category">The category.</param>
        internal static void SerializeQuest(ServerMessage message, GameClient session, Quest quest, string category)
        {
            if (message == null || session == null)
            {
                return;
            }
            var amountOfQuestsInCategory = Azure.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(category);

            {
                var num = (quest == null) ? amountOfQuestsInCategory : (quest.Number - 1);
                var num2 = (quest == null) ? 0 : session.GetHabbo().GetQuestProgress(quest.Id);
                if (quest != null && quest.IsCompleted(num2))
                {
                    num++;
                }
                message.AppendString(category);
                message.AppendInteger((quest == null) ? 0 : (quest.Category.Contains("xmas2012") ? 0 : num));
                message.AppendInteger((quest == null)
                    ? 0
                    : (quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory));
                message.AppendInteger((quest == null) ? 3 : quest.RewardType);
                message.AppendInteger((quest == null) ? 0u : quest.Id);
                message.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id);
                message.AppendString((quest == null) ? string.Empty : quest.ActionName);
                message.AppendString((quest == null) ? string.Empty : quest.DataBit);
                message.AppendInteger((quest == null) ? 0 : quest.Reward);
                message.AppendString((quest == null) ? string.Empty : quest.Name);
                message.AppendInteger(num2);
                message.AppendInteger((quest == null) ? 0u : quest.GoalData);
                message.AppendInteger((quest == null) ? 0 : quest.TimeUnlock);
                message.AppendString("");
                message.AppendString("");
                message.AppendBool(true);
            }
        }
 /// <summary>
 ///     Composes the specified session.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <param name="quest">The quest.</param>
 /// <returns>ServerMessage.</returns>
 internal static ServerMessage Compose(GameClient session, Quest quest)
 {
     var amountOfQuestsInCategory = Azure.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(quest.Category);
     var i = (quest == null) ? amountOfQuestsInCategory : quest.Number;
     var i2 = (quest == null) ? 0 : session.GetHabbo().GetQuestProgress(quest.Id);
     var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("QuestCompletedMessageComposer"));
     serverMessage.AppendString(quest.Category);
     serverMessage.AppendInteger(i);
     serverMessage.AppendInteger(quest.Name.Contains("xmas2012") ? 1 : amountOfQuestsInCategory);
     serverMessage.AppendInteger((quest == null) ? 3 : quest.RewardType);
     serverMessage.AppendInteger((quest == null) ? 0u : quest.Id);
     serverMessage.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id);
     serverMessage.AppendString((quest == null) ? string.Empty : quest.ActionName);
     serverMessage.AppendString((quest == null) ? string.Empty : quest.DataBit);
     serverMessage.AppendInteger((quest == null) ? 0 : quest.Reward);
     serverMessage.AppendString((quest == null) ? string.Empty : quest.Name);
     serverMessage.AppendInteger(i2);
     serverMessage.AppendInteger((quest == null) ? 0u : quest.GoalData);
     serverMessage.AppendInteger((quest == null) ? 0 : quest.TimeUnlock);
     serverMessage.AppendString("");
     serverMessage.AppendString("");
     serverMessage.AppendBool(true);
     serverMessage.AppendBool(true);
     return serverMessage;
 }
        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (!hasRights)
                return;

            int num;
            int.TryParse(item.ExtraData, out num);

            switch (request)
            {
                case 1:
                    if (item.PendingReset && num > 0)
                    {
                        num = 0;
                        item.PendingReset = false;
                    }
                    else
                    {
                        num += 60;
                        item.UpdateNeeded = false;
                    }
                    break;

                case 2:
                    item.UpdateNeeded = !item.UpdateNeeded;
                    item.PendingReset = true;
                    break;
            }

            item.ExtraData = num.ToString();
            item.UpdateState();
        }
Beispiel #28
0
        internal static void MatchingPollResults(GameClient client, Poll poll)
        {
            var room = client.GetHabbo().CurrentRoom;
            if (poll == null || poll.Type != PollType.Matching || room == null)
                return;

            var users = room.GetRoomUserManager().GetRoomUsers();

            for (var i = 0; i < 10; i++)
            {
                Thread.Sleep(1000);
                foreach (var roomUser in users)
                {
                    var user = Azure.GetHabboById(roomUser.UserId);
                    if (user.AnsweredPool)
                    {
                        var result =
                            new ServerMessage(LibraryParser.OutgoingRequest("MatchingPollResultMessageComposer"));
                        result.AppendInteger(poll.Id);
                        result.AppendInteger(2);
                        result.AppendString("0");
                        result.AppendInteger(poll.AnswersNegative);
                        result.AppendString("1");
                        result.AppendInteger(poll.AnswersPositive);
                        client.SendMessage(result);
                    }
                }
            }

            foreach (var roomUser in users)
                Azure.GetHabboById(roomUser.UserId).AnsweredPool = false;
        }
Beispiel #29
0
        /// <summary>
        ///     Adds the guide.
        /// </summary>
        /// <param name="guide">The guide.</param>
        public void AddGuide(GameClient guide)
        {
            switch (guide.GetHabbo().DutyLevel)
            {
                case 1:
                    if (!GuidesOnDuty.Contains(guide))
                        GuidesOnDuty.Add(guide);
                    break;

                case 2:
                    if (!HelpersOnDuty.Contains(guide))
                        HelpersOnDuty.Add(guide);
                    break;

                case 3:
                    if (!GuardiansOnDuty.Contains(guide))
                        GuardiansOnDuty.Add(guide);
                    break;

                default:
                    if (!GuidesOnDuty.Contains(guide))
                        GuidesOnDuty.Add(guide);
                    break;
            }
        }
Beispiel #30
0
        public override bool Execute(GameClient session, string[] pms)
        {
            if (!session.GetHabbo().Look.Contains("hd-"))
                return true;

            var head = session.GetHabbo().Look.Split('.').FirstOrDefault(element => element.StartsWith("hd-"));
            var color = "1";
            if (!string.IsNullOrEmpty(head))
            {
                color = head.Split('-')[2];
                session.GetHabbo().Look = session.GetHabbo().Look.Replace('.' + head, string.Empty);
            }
            session.GetHabbo().Look += ".hd-99999-" + color;

            using (var dbClient = Azure.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery(
                    "UPDATE users SET look = @look WHERE id = " + session.GetHabbo().Id);
                dbClient.AddParameter("look", session.GetHabbo().Look);
                dbClient.RunQuery();
            }
            var room = session.GetHabbo().CurrentRoom;
            var user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
            if (user == null) return true;

            var roomUpdate = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserDataMessageComposer"));
            roomUpdate.AppendInteger(user.VirtualId);
            roomUpdate.AppendString(session.GetHabbo().Look);
            roomUpdate.AppendString(session.GetHabbo().Gender.ToLower());
            roomUpdate.AppendString(session.GetHabbo().Motto);
            roomUpdate.AppendInteger(session.GetHabbo().AchievementPoints);
            room.SendMessage(roomUpdate);

            return true;
        }