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


C# ServerMessage.AppendString方法代码示例

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


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

示例1: 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

示例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: 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

示例4: 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

示例5: Serialize

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

示例6: CompleteUserTalent

        /// <summary>
        /// Completes the user talent.
        /// </summary>
        /// <param name="Session">The session.</param>
        /// <param name="Talent">The talent.</param>
        internal void CompleteUserTalent(GameClient Session, Talent Talent)
        {
            if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().CurrentTalentLevel < Talent.Level || Session.GetHabbo().Talents.ContainsKey(Talent.Id))
                return;
            if (!LevelIsCompleted(Session, Talent.Type, Talent.Level))
                return;
            if (!string.IsNullOrEmpty(Talent.Prize) && Talent.PrizeBaseItem > 0u)
            {
                Item item = AzureEmulator.GetGame().GetItemManager().GetItem(Talent.PrizeBaseItem);
                AzureEmulator.GetGame().GetCatalog().DeliverItems(Session, item, 1, "", 0, 0, "");
            }
            var value = new UserTalent(Talent.Id, 1);
            Session.GetHabbo().Talents.Add(Talent.Id, value);
            using (IQueryAdapter queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
            {
                queryReactor.RunFastQuery(string.Concat("REPLACE INTO users_talents VALUES (", Session.GetHabbo().Id, ", ", Talent.Id, ", ", 1, ");"));
            }
            var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("TalentLevelUpMessageComposer"));
            serverMessage.AppendString(Talent.Type);
            serverMessage.AppendInteger(Talent.Level);
            serverMessage.AppendInteger(0);
            if (Talent.Type == "citizenship" && Talent.Level == 4)
            {
                serverMessage.AppendInteger(2);
                serverMessage.AppendString("HABBO_CLUB_VIP_7_DAYS");
                serverMessage.AppendInteger(7);
                serverMessage.AppendString(Talent.Prize);
                serverMessage.AppendInteger(0);
            }
            else
            {
                serverMessage.AppendInteger(1);
                serverMessage.AppendString(Talent.Prize);
                serverMessage.AppendInteger(0);
            }

            Session.SendMessage(serverMessage);

            if (Talent.Type == "citizenship")
            {
                if (Talent.Level == 3)
                    AzureEmulator.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_Citizenship", 1);
                else if (Talent.Level == 4)
                {
                    Session.GetHabbo().GetSubscriptionManager().AddSubscription(7);
                    using (IQueryAdapter queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
                    {
                        queryReactor.RunFastQuery(string.Concat(new object[]
                        {
                            "UPDATE users SET talent_status = 'helper' WHERE id = ",
                            Session.GetHabbo().Id,
                            ";"
                        }));
                    }
                }
            }
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:62,代码来源:TalentManager.cs

示例7: 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

示例8: Execute

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

示例9: 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:BjkGkh,项目名称:Azure2,代码行数:16,代码来源:SmallPromo.cs

示例10: 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

示例11: 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

示例12: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            session.GetHabbo().NewNavigator = !session.GetHabbo().NewNavigator;

            var msg = new ServerMessage(LibraryParser.OutgoingRequest("SendPerkAllowancesMessageComposer"));
            msg.AppendInteger(1);
            msg.AppendString("NAVIGATOR_PHASE_TWO_2014");
            msg.AppendString("");
            msg.AppendBool(session.GetHabbo().NewNavigator);

            session.SendMessage(msg);
            return true;
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:13,代码来源:Navigator.cs

示例13: MatchingPollAnswer

 internal static void MatchingPollAnswer(GameClient client, Poll poll)
 {
     if (poll == null || poll.Type != Poll.PollType.Matching)
         return;
     var message = new ServerMessage(LibraryParser.OutgoingRequest("MatchingPollMessageComposer"));
     message.AppendString("MATCHING_POLL");
     message.AppendInteger(poll.Id);
     message.AppendInteger(poll.Id);
     message.AppendInteger(15580);
     message.AppendInteger(poll.Id);
     message.AppendInteger(29);
     message.AppendInteger(5);
     message.AppendString(poll.PollName);
     client.GetHabbo().CurrentRoom.SendMessage(message);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:15,代码来源:StartQuestion.cs

示例14: 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

示例15: Execute

 public override void Execute(GameClient session, string[] pms)
 {
     var str = string.Join(" ", pms);
     var message = new ServerMessage(LibraryParser.OutgoingRequest("BroadcastNotifMessageComposer"));
     message.AppendString(string.Format("{0}\r\n- {1}", str, session.GetHabbo().UserName));
     AzureEmulator.GetGame().GetClientManager().QueueBroadcaseMessage(message);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:7,代码来源:HotelAlert.cs


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