当前位置: 首页>>代码示例>>C#>>正文


C# ServerMessage.AppendInteger方法代码示例

本文整理汇总了C#中Azure.Messages.ServerMessage.AppendInteger方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendInteger方法的具体用法?C# ServerMessage.AppendInteger怎么用?C# ServerMessage.AppendInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Azure.Messages.ServerMessage的用法示例。


在下文中一共展示了ServerMessage.AppendInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public override void Execute(GameClient session, string[] pms)
        {
            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 = AzureEmulator.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;

            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);
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:30,代码来源:FaceLess.cs

示例2: MatchingPollResults

        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;
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:32,代码来源:StartQuestion.cs

示例3: GetServerMessage

 internal ServerMessage GetServerMessage(ServerMessage message, RoomItem item)
 {
     var cracks = 0;
     var cracks_max = MaxCracks(item.GetBaseItem().Name);
     if (AzureEmulator.IsNum(item.ExtraData))
         cracks = Convert.ToInt16(item.ExtraData);
     var state = "0";
     if (cracks >= cracks_max)
         state = "14";
     else if (cracks >= cracks_max * 6 / 7)
         state = "12";
     else if (cracks >= cracks_max * 5 / 7)
         state = "10";
     else if (cracks >= cracks_max * 4 / 7)
         state = "8";
     else if (cracks >= cracks_max * 3 / 7)
         state = "6";
     else if (cracks >= cracks_max * 2 / 7)
         state = "4";
     else if (cracks >= cracks_max * 1 / 7)
         state = "2";
     message.AppendInteger(7);
     message.AppendString(state); //state (0-7)
     message.AppendInteger(cracks); //actual
     message.AppendInteger(cracks_max); //max
     return message;
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:27,代码来源:CrackableEggHandler.cs

示例4: SerializeSearchResultListFlatcats

        /// <summary>
        ///     Serializes the search result list flatcats.
        /// </summary>
        /// <param name="flatCatId">The flat cat identifier.</param>
        /// <param name="direct">if set to <c>true</c> [direct].</param>
        /// <param name="message">The message.</param>
        internal static void SerializeSearchResultListFlatcats(int flatCatId, bool direct, ServerMessage message)
        {
            var flatCat = Azure.GetGame().GetNavigator().GetFlatCat(flatCatId);

            if (flatCat == null)
                return;

            message.AppendString($"category__{flatCat.Caption}");
            message.AppendString(flatCat.Caption);
            message.AppendInteger(0);
            message.AppendBool(true);
            message.AppendInteger(-1);

            try
            {
                var rooms = Azure.GetGame().GetRoomManager().GetActiveRooms();
                Azure.GetGame()
                    .GetNavigator()
                    .SerializeNavigatorPopularRoomsNews(ref message, rooms, flatCatId, direct);
            }
            catch
            {
                message.AppendInteger(0);
            }
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:31,代码来源:SearchResultList.cs

示例5: Execute

        public override void Execute(GameClient session, string[] pms)
        {
            var room = session.GetHabbo().CurrentRoom;

            var user = room.GetRoomUserManager().GetRoomUserByHabbo(pms[0]);
            if (user == null)
            {
                session.SendWhisper(TextManager.GetText("user_not_found"));
            }

            var gender = user.GetClient().GetHabbo().Gender;
            var look = user.GetClient().GetHabbo().Look;
            session.GetHabbo().Gender = gender;
            session.GetHabbo().Look = look;
            using (var adapter = AzureEmulator.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();
            }

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

            var 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());
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:35,代码来源:CopyLook.cs

示例6: Serialize

 internal void Serialize(ref ServerMessage message)
 {
     Habbo habbo = AzureEmulator.GetHabboById(UserId);
     message.AppendInteger(AzureEmulator.DifferenceInMilliSeconds(TimeStamp, DateTime.Now));
     message.AppendInteger(UserId);
     message.AppendString(habbo == null ? "*User not found*" : habbo.UserName);
     message.AppendString(Message);
     message.AppendBool(true);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:9,代码来源:Chatlog.cs

示例7: GenerateMessage

 internal void GenerateMessage(ServerMessage message)
 {
     message.Init(LibraryParser.OutgoingRequest("TargetedOfferMessageComposer"));
     message.AppendInteger(1);//show
     message.AppendInteger(Id);
     message.AppendString(Identifier);
     message.AppendString(Identifier);
     message.AppendInteger(CostCredits);
     if (CostDiamonds > 0)
     {
         message.AppendInteger(CostDiamonds);
         message.AppendInteger(105);
     }
     else
     {
         message.AppendInteger(CostDuckets);
         message.AppendInteger(0);
     }
     message.AppendInteger(PurchaseLimit);
     var TimeLeft = ExpirationTime - AzureEmulator.GetUnixTimeStamp();
     message.AppendInteger(TimeLeft);
     message.AppendString(Title);
     message.AppendString(Description);
     message.AppendString(Image);
     message.AppendString("");
     message.StartArray();
     foreach (string Product in Products)
     {
         message.AppendString(Product);
         message.SaveArray();
     }
     message.EndArray();
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:33,代码来源:TargetedOffers.cs

示例8: Serialize

 /// <summary>
 ///     Serializes the specified composer.
 /// </summary>
 /// <param name="composer">The composer.</param>
 /// <returns>ServerMessage.</returns>
 internal ServerMessage Serialize(ServerMessage composer)
 {
     composer.AppendInteger(_index);
     composer.AppendString(_header);
     composer.AppendString(_body);
     composer.AppendString(_button);
     composer.AppendInteger(_inGamePromo);
     composer.AppendString(_specialAction);
     composer.AppendString(_image);
     return composer;
 }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:16,代码来源:SmallPromo.cs

示例9: Searialize

 /// <summary>
 /// Searializes the specified reply.
 /// </summary>
 /// <param name="reply">The reply.</param>
 internal void Searialize(ServerMessage reply)
 {
     reply.AppendInteger(UserId);
     reply.AppendString(UserName);
     reply.AppendString(Motto);
     reply.AppendBool(AzureEmulator.GetGame().GetClientManager().GetClient(UserId) != null);
     reply.AppendBool(false);
     reply.AppendString(string.Empty);
     reply.AppendInteger(0);
     reply.AppendString(Look);
     reply.AppendString(LastOnline);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:16,代码来源:SearchResult.cs

示例10: Compose

 /// <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;
 }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:31,代码来源:QuestCompletedComposer.cs

示例11: Compose

 /// <summary>
 /// Composes the specified songs.
 /// </summary>
 /// <param name="songs">The songs.</param>
 /// <returns>ServerMessage.</returns>
 public static ServerMessage Compose(List<SongData> songs)
 {
     var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("SongsMessageComposer"));
     serverMessage.AppendInteger(songs.Count);
     foreach (SongData current in songs)
     {
         serverMessage.AppendInteger(current.Id);
         serverMessage.AppendString(current.CodeName);
         serverMessage.AppendString(current.Name.Replace("_", " "));
         serverMessage.AppendString(current.Data);
         serverMessage.AppendInteger(current.LengthMiliseconds);
         serverMessage.AppendString(current.Artist);
     }
     return serverMessage;
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:20,代码来源:JukeboxComposer.cs

示例12: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            using (var adapter = Azure.GetDatabaseManager().GetQueryReactor())
            {
                FurniDataParser.SetCache();
                Azure.GetGame().GetItemManager().LoadItems(adapter);
                Azure.GetGame().GetCatalog().Initialize(adapter);
                Azure.GetGame().ReloadItems();
                FurniDataParser.Clear();
            }
            Azure.GetGame()
                .GetClientManager()
                .QueueBroadcaseMessage(
                    new ServerMessage(LibraryParser.OutgoingRequest("PublishShopMessageComposer")));
            var message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
            message.AppendString("ninja_promo_LTD");
            message.AppendInteger(4);
            message.AppendString("title");
            message.AppendString("Novo Raro Limitado!");
            message.AppendString("message");
            message.AppendString(
                "<i><h1>Como Assim?</h1>, Um Novo Raro Limitado foi Adicionado na Loja!<br> Descubra como ele é Abrindo a Loja!</br>");
            message.AppendString("linkUrl");
            message.AppendString("event:catalog/open/ultd_furni");
            message.AppendString("linkTitle");
            message.AppendString("Ver o Raro");

            Azure.GetGame().GetClientManager().QueueBroadcaseMessage(message);
            return true;
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:30,代码来源:LTD.cs

示例13: SmallPromoComposer

 /// <summary>
 ///     Smalls the promo composer.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <returns>ServerMessage.</returns>
 internal ServerMessage SmallPromoComposer(ServerMessage message)
 {
     message.AppendInteger(HotelViewPromosIndexers.Count);
     foreach (var current in HotelViewPromosIndexers)
         current.Serialize(message);
     return message;
 }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:12,代码来源:HotelView.cs

示例14: Serialize

        /// <summary>
        ///     Serializes the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        internal void Serialize(ServerMessage message)
        {
            message.StartArray();
            foreach (
                var item1 in
                    Clothing.Select(clothing1 => Azure.GetGame().GetClothingManager().GetClothesInFurni(clothing1)))
            {
                foreach (var clothe in item1.Clothes)
                    message.AppendInteger(clothe);

                message.SaveArray();
            }
            message.EndArray();
            message.StartArray();

            foreach (
                var item2 in
                    Clothing.Select(clothing2 => Azure.GetGame().GetClothingManager().GetClothesInFurni(clothing2)))
            {
                foreach (var clothe in item2.Clothes)
                    message.AppendString(item2.ItemName);
                message.SaveArray();
            }

            message.EndArray();
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:30,代码来源:UserClothing.cs

示例15: Execute

        public override void Execute(GameClient session, string[] pms)
        {
            ushort result;
            ushort.TryParse(pms[0], out result);

            if (result > 4)
            {
                session.SendWhisper(TextManager.GetText("command_dance_false"));
                result = 0;
            }
            var message = new ServerMessage();
            message.Init(LibraryParser.OutgoingRequest("DanceStatusMessageComposer"));
            message.AppendInteger(session.CurrentRoomUserId);
            message.AppendInteger(result);
            session.GetHabbo().CurrentRoom.SendMessage(message);
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:16,代码来源:Dance.cs


注:本文中的Azure.Messages.ServerMessage.AppendInteger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。