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


C# ServerMessage.AppendString方法代码示例

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


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

示例1: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            if (!session.GetHabbo().Look.Contains("hd-"))
                return true;

            string head = session.GetHabbo().Look.Split('.').FirstOrDefault(element => element.StartsWith("hd-"));
            string 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 (IQueryAdapter dbClient = Yupi.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery(
                    "UPDATE users SET look = @look WHERE id = " + session.GetHabbo().Id);
                dbClient.AddParameter("look", session.GetHabbo().Look);
                dbClient.RunQuery();
            }
            Room room = session.GetHabbo().CurrentRoom;
            RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
            if (user == null) return true;

            ServerMessage 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;
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:35,代码来源:FaceLess.cs

示例2: GenerateMessage

        internal static void GenerateMessage(Pet pet, ServerMessage message, bool levelAfterName = false)
        {
            message.AppendInteger(pet.PetId);
            message.AppendString(pet.Name);

            if (levelAfterName)
                message.AppendInteger(pet.Level);

            message.AppendInteger(pet.RaceId);
            message.AppendInteger(pet.Race);
            message.AppendString(pet.Type == "pet_monster" ? "ffffff" : pet.Color);
            message.AppendInteger(pet.Type == "pet_monster" ? 0u : pet.RaceId);

            if (pet.Type == "pet_monster" && pet.MoplaBreed != null)
            {
                string[] array = pet.MoplaBreed.PlantData.Substring(12).Split(' ');
                string[] array2 = array;

                foreach (string s in array2)
                    message.AppendInteger(int.Parse(s));

                message.AppendInteger(pet.MoplaBreed.GrowingStatus);

                return;
            }

            message.AppendInteger(0);
            message.AppendInteger(0);
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:29,代码来源:SerializePetInventoryComposer.cs

示例3: MatchingPollResults

        internal static void MatchingPollResults(GameClient client, Poll poll)
        {
            Room room = client.GetHabbo().CurrentRoom;
            if (poll == null || poll.Type != PollType.Matching || room == null)
                return;

            HashSet<RoomUser> users = room.GetRoomUserManager().GetRoomUsers();

            for (int i = 0; i < 10; i++)
            {
                Thread.Sleep(1000);
                foreach (RoomUser roomUser in users)
                {
                    Habbo user = Yupi.GetHabboById(roomUser.UserId);
                    if (user.AnsweredPool)
                    {
                        ServerMessage 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 (RoomUser roomUser in users)
                Yupi.GetHabboById(roomUser.UserId).AnsweredPool = false;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:32,代码来源:StartQuestion.cs

示例4: Compose

        /// <summary>
        ///     Composes the specified session.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="talent">The Talent.</param>
        /// <returns>ServerMessage.</returns>
        internal static ServerMessage Compose(GameClient session, Talent talent)
        {
            ServerMessage 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);
            }

            return serverMessage;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:31,代码来源:AchievementTalentComposer.cs

示例5: Serialize

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

示例6: Execute

        public override bool Execute(GameClient client, string[] pms)
        {
            ServerMessage message =
                new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));

            message.AppendString("Yupi");
            message.AppendInteger(4);
            message.AppendString("title");
            message.AppendString("Yupi");
            message.AppendString("message");
            StringBuilder info = new StringBuilder();
            info.Append("<h5><b>Yupi - Based on Azure Emulator</b><h5></br></br>");
            info.Append("<br />");
            info.AppendFormat(
                "<b><br />Developed by:</b> <br />Kessiler Rodrigues (Kessiler)<br />Claudio Santoro (sant0ro/bi0s) <br />Rafael Oliveira (iPlezier) <br /><br /> ");
            info.AppendFormat(
                "<b>Thanks to:</b> <br />Jamal, Mike Santifort, Martinmine, Rockster, The old Azure Team, Bruna F., and to all people that uses Yupi.<br /> <br /> ");
            info.AppendFormat("<b>Warning:</b><br />1. This emulator was planned to be used for ManiaHotel (maniahotel.com.br)  <br />2. Please don't sell this emulator or earn money with it<br />3. All rights reserved to Sulake Corporation Oy<br />4. All Emulator rights for Mania Dev<br />");
            message.AppendString(info.ToString());
            message.AppendString("linkUrl");
            message.AppendString("event:");
            message.AppendString("linkTitle");
            message.AppendString("ok");
            client.SendMessage(message);

            return true;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:27,代码来源:About.cs

示例7: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
            {
                FurnitureDataManager.SetCache();
                Yupi.GetGame().GetItemManager().LoadItems(adapter);
                Yupi.GetGame().GetCatalog().Initialize(adapter);
                Yupi.GetGame().ReloadItems();
                FurnitureDataManager.Clear();
            }
            Yupi.GetGame()
                .GetClientManager()
                .QueueBroadcaseMessage(
                    new ServerMessage(LibraryParser.OutgoingRequest("PublishShopMessageComposer")));
            ServerMessage 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");

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

示例8: Compose

        /// <summary>
        ///     Composes the specified session.
        /// </summary>
        /// <param name="group"></param>
        /// <param name="groupForum"></param>
        /// <param name="requesterId"></param>
        /// <returns>ServerMessage.</returns>
        internal static ServerMessage Compose(Group group, GroupForum groupForum, uint requesterId)
        {
            string string1 = string.Empty, string2 = string.Empty, string3 = string.Empty, string4 = string.Empty;

            ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("GroupForumDataMessageComposer"));

            message.AppendInteger(group.Id);
            message.AppendString(group.Name);
            message.AppendString(group.Description);
            message.AppendString(group.Badge);
            message.AppendInteger(0);
            message.AppendInteger(0);
            message.AppendInteger(groupForum.ForumMessagesCount);
            message.AppendInteger(0);
            message.AppendInteger(0);
            message.AppendInteger(groupForum.ForumLastPosterId);
            message.AppendString(groupForum.ForumLastPosterName);
            message.AppendInteger(groupForum.ForumLastPostTime);
            message.AppendInteger(groupForum.WhoCanRead);
            message.AppendInteger(groupForum.WhoCanPost);
            message.AppendInteger(groupForum.WhoCanThread);
            message.AppendInteger(groupForum.WhoCanMod);

            if (groupForum.WhoCanRead == 1 && !group.Members.ContainsKey(requesterId))
                string1 = "not_member";
            if (groupForum.WhoCanRead == 2 && !group.Admins.ContainsKey(requesterId))
                string1 = "not_admin";
            if (groupForum.WhoCanPost == 1 && !group.Members.ContainsKey(requesterId))
                string2 = "not_member";
            if (groupForum.WhoCanPost == 2 && !group.Admins.ContainsKey(requesterId))
                string2 = "not_admin";
            if (groupForum.WhoCanPost == 3 && requesterId != group.CreatorId)
                string2 = "not_owner";
            if (groupForum.WhoCanThread == 1 && !group.Members.ContainsKey(requesterId))
                string3 = "not_member";
            if (groupForum.WhoCanThread == 2 && !group.Admins.ContainsKey(requesterId))
                string3 = "not_admin";
            if (groupForum.WhoCanThread == 3 && requesterId != group.CreatorId)
                string3 = "not_owner";
            if (groupForum.WhoCanMod == 2 && !group.Admins.ContainsKey(requesterId))
                string4 = "not_admin";
            if (groupForum.WhoCanMod == 3 && requesterId != group.CreatorId)
                string4 = "not_owner";

            message.AppendString(string1);
            message.AppendString(string2);
            message.AppendString(string3);
            message.AppendString(string4);
            message.AppendString(string.Empty);
            message.AppendBool(requesterId == group.CreatorId);
            message.AppendBool(true);

            return message;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:61,代码来源:ForumDataMessageComposer.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(Yupi.GetGame().GetClientManager().GetClient(UserId) != null);
     reply.AppendBool(false);
     reply.AppendString(string.Empty);
     reply.AppendInteger(0);
     reply.AppendString(Look);
     reply.AppendString(LastOnline);
 }
开发者ID:sgf,项目名称:Yupi,代码行数:16,代码来源:SearchResult.cs

示例10: SerializePromotionsResultListFlatcats

        /// <summary>
        ///     Serializes the promotions 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 SerializePromotionsResultListFlatcats(int flatCatId, bool direct, ServerMessage message)
        {
            PublicCategory flatCat = Yupi.GetGame().GetNavigator().GetFlatCat(flatCatId);

            message.AppendString("new_ads");
            message.AppendString(flatCat.Caption);
            message.AppendInteger(0);
            message.AppendBool(true);
            message.AppendInteger(-1);

            KeyValuePair<RoomData, uint>[] rooms = Yupi.GetGame().GetRoomManager().GetEventRooms();
            Yupi.GetGame().GetNavigator().SerializeNavigatorPopularRoomsNews(ref message, rooms, flatCatId, direct);
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:19,代码来源:SearchResultList.cs

示例11: MatchingPollAnswer

 internal static void MatchingPollAnswer(GameClient client, Poll poll)
 {
     if (poll == null || poll.Type != PollType.Matching)
         return;
     ServerMessage 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:sgf,项目名称:Yupi,代码行数:15,代码来源:StartQuestion.cs

示例12: 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)
        {
            PublicCategory flatCat = Yupi.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);

            KeyValuePair<RoomData, uint>[] rooms = Yupi.GetGame().GetRoomManager().GetActiveRooms();
            Yupi.GetGame().GetNavigator().SerializeNavigatorPopularRoomsNews(ref message, rooms, flatCatId, direct);
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:22,代码来源:SearchResultList.cs

示例13: GetServerMessage

        internal ServerMessage GetServerMessage(ServerMessage message, RoomItem item)
        {
            int cracks = 0;
            int cracksMax = MaxCracks(item.GetBaseItem().Name);

            if (Yupi.IsNum(item.ExtraData))
                cracks = Convert.ToInt16(item.ExtraData);

            string state = "0";

            if (cracks >= cracksMax)
                state = "14";
            else if (cracks >= cracksMax*6/7)
                state = "12";
            else if (cracks >= cracksMax*5/7)
                state = "10";
            else if (cracks >= cracksMax*4/7)
                state = "8";
            else if (cracks >= cracksMax*3/7)
                state = "6";
            else if (cracks >= cracksMax*2/7)
                state = "4";
            else if (cracks >= cracksMax*1/7)
                state = "2";

            message.AppendInteger(7);
            message.AppendString(state); //state (0-7)
            message.AppendInteger(cracks); //actual
            message.AppendInteger(cracksMax); //max

            return message;
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:32,代码来源:CrackableEggHandler.cs

示例14: AppendEntrySubmitMessage

        internal ServerMessage AppendEntrySubmitMessage(ServerMessage message, int status, Room room = null)
        {
            message.Init(LibraryParser.OutgoingRequest("CompetitionEntrySubmitResultMessageComposer"));

            message.AppendInteger(Id);
            message.AppendString(Name);
            message.AppendInteger(status);
            // 0 : roomSent - 1 : send room - 2 : confirm register - 3 : neededFurnis - 4 : doorClosed - 6 : acceptRules

            if (status != 3)
            {
                message.AppendInteger(0);
                message.AppendInteger(0);
            }
            else
            {
                message.StartArray();

                foreach (string furni in RequiredFurnis)
                {
                    message.AppendString(furni);
                    message.SaveArray();
                }

                message.EndArray();

                if (room == null)
                    message.AppendInteger(0);
                else
                {
                    message.StartArray();

                    foreach (string furni in RequiredFurnis)
                    {
                        if (!room.GetRoomItemHandler().HasFurniByItemName(furni))
                        {
                            message.AppendString(furni);
                            message.SaveArray();
                        }
                    }

                    message.EndArray();
                }
            }

            return message;
        }
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:47,代码来源:RoomCompetitionManager.cs

示例15: Compose

        /// <summary>
        /// Composes the specified songs.
        /// </summary>
        /// <param name="songs">The songs.</param>
        /// <returns>ServerMessage.</returns>
        public static ServerMessage Compose(List<SongData> songs)
        {
            ServerMessage 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);
                serverMessage.AppendString(current.Data);
                serverMessage.AppendInteger(current.LengthMiliseconds);
                serverMessage.AppendString(current.Artist);
            }

            return serverMessage;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:22,代码来源:SoundMachineComposer.cs


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