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


C# ServerMessage.AppendStringWithBreak方法代码示例

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


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

示例1: Compose

        internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
        {
            ServerMessage Message = new ServerMessage(436); //436
            Message.AppendInt32(Achievements.Count);

            foreach (Achievement Achievement in Achievements)
            {
                UserAchievement UserData = Session.GetHabbo().GetAchievementData(Achievement.GroupName);
                int TargetLevel = (UserData != null ? UserData.Level + 1 : 1);
                int TotalLevels = Achievement.Levels.Count;

                if (TargetLevel > TotalLevels)
                {
                    TargetLevel = TotalLevels;
                }

                AchievementLevel TargetLevelData = Achievement.Levels[TargetLevel];

                Message.AppendUInt(Achievement.Id);                                                           // Unknown (ID?)
                Message.AppendInt32(TargetLevel);                                                   // Target level
                Message.AppendStringWithBreak(Achievement.GroupName + TargetLevel);                 // Target name/desc/badge
                Message.AppendInt32(TargetLevelData.Requirement);                                   // Progress req/target
                Message.AppendInt32(TargetLevelData.RewardPixels);                                   // Pixel reward
                Message.AppendInt32(TargetLevelData.RewardPoints);                                  // Unknown(??)
                Message.AppendInt32(UserData != null ? UserData.Progress : 0);                      // Current progress
                Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false);  // Set 100% completed(??)
                Message.AppendStringWithBreak(Achievement.Category);                                // Category
                Message.AppendInt32(TotalLevels);                                                   // Total amount of levels
            }

            return Message;
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:32,代码来源:AchievementListComposer.cs

示例2: Serialize

        internal void Serialize(ServerMessage Request)
        {
            // [email protected]22033860

            Request.AppendUInt(FromUser);
            Request.AppendStringWithBreak(mUsername);
            Request.AppendStringWithBreak(FromUser.ToString());
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:8,代码来源:MessengerRequest.cs

示例3: Serialize

 internal void Serialize(ref ServerMessage packet)
 {
     packet.AppendInt32(timeSpoken.Hour);
     packet.AppendInt32(timeSpoken.Minute);
     packet.AppendUInt(userID);
     packet.AppendStringWithBreak(username);
     packet.AppendStringWithBreak(message);
 }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:8,代码来源:ChatMessage.cs

示例4: MoveBall

        internal void MoveBall(RoomItem item, GameClient mover, int newX, int newY)
        {
            if (item == null || mover == null)
                return;

            if (!room.GetGameMap().itemCanBePlacedHere(newX, newY))
                return;

            Point oldRoomCoord = item.Coordinate;
            bool itemIsOnGameItem = GameItemOverlaps(item);

            Double NewZ = room.GetGameMap().Model.SqFloorHeight[newX, newY];

            ServerMessage Message = new ServerMessage(95);
            Message.AppendUInt(item.Id);
            Message.AppendInt32(3508);
            Message.AppendInt32(item.Coordinate.X);
            Message.AppendInt32(item.Coordinate.Y);
            Message.AppendInt32(newX);
            Message.AppendInt32(newY);
            Message.AppendInt32(4);
            Message.AppendStringWithBreak(NewZ.ToString());
            Message.AppendStringWithBreak("H11");
            Message.AppendInt32(-1);
            Message.AppendInt32(0);
            room.SendMessage(Message);

            ServerMessage mMessage = new ServerMessage();
            mMessage.Init(230); // Cf
            mMessage.AppendInt32(item.Coordinate.X);
            mMessage.AppendInt32(item.Coordinate.Y);
            mMessage.AppendInt32(newX);
            mMessage.AppendInt32(newY);
            mMessage.AppendInt32(1);
            mMessage.AppendUInt(item.Id);
            mMessage.AppendStringWithBreak(item.GetZ.ToString().Replace(',', '.'));
            mMessage.AppendStringWithBreak(NewZ.ToString().Replace(',', '.'));
            mMessage.AppendInt32(0);
            room.SendMessage(mMessage);

            if (oldRoomCoord.X == newX && oldRoomCoord.Y == newY)
                return;

            room.GetRoomItemHandler().SetFloorItem(mover, item, newX, newY, item.Rot, false, false, false, false);

            if (!itemIsOnGameItem)
                HandleFootballGameItems(new Point(newX, newY), room.GetRoomUserManager().GetRoomUserByHabbo(mover.GetHabbo().Id));
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:48,代码来源:Soccer.cs

示例5: SerializeTopic

 internal static ServerMessage SerializeTopic(HelpTopic Topic)
 {
     ServerMessage Top = new ServerMessage(520);
     Top.AppendUInt(Topic.TopicId);
     Top.AppendStringWithBreak(Topic.Body);
     return Top;
 }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:7,代码来源:HelpTool.cs

示例6: Compose

        public static ServerMessage Compose(List<SongData> Songs)
        {
            ServerMessage Message = new ServerMessage(300);
            Message.AppendInt32(Songs.Count);

            foreach (SongData Song in Songs)
            {
                Message.AppendUInt(Song.Id);
                Message.AppendStringWithBreak(Song.Name);
                Message.AppendStringWithBreak(Song.Data);
                Message.AppendInt32(Song.LengthMiliseconds);
                Message.AppendStringWithBreak(Song.Artist);
            }

            return Message;
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:16,代码来源:JukeboxDiscksComposer.cs

示例7: Compose

 internal static ServerMessage Compose(Achievement Achievement, int Level, int PointReward, int PixelReward)
 {
     ServerMessage Message = new ServerMessage(437);
     Message.AppendUInt(Achievement.Id);                                           // Achievement ID
     Message.AppendInt32(Level);                                                     // Achieved level
     Message.AppendInt32(144);                                                         // Unknown. Random useless number.
     Message.AppendStringWithBreak(Achievement.GroupName + Level);                   // Achieved name
     Message.AppendInt32(PointReward);                                               // Point reward
     Message.AppendInt32(PixelReward);                                               // Pixel reward
     Message.AppendInt32(0);                                                         // Unknown.
     Message.AppendInt32(10);                                                         // Unknown.
     Message.AppendInt32(21);                                                         // Unknown. (Extra reward?)
     Message.AppendStringWithBreak(Level > 1 ? Achievement.GroupName + (Level - 1) : string.Empty);
     Message.AppendStringWithBreak(Achievement.Category);
     return Message;
 }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:16,代码来源:AchievementUnlockedComposer.cs

示例8: Compose

        internal static ServerMessage Compose(List<Achievement> Achievements)
        {
            ServerMessage Message = new ServerMessage(627); //627
            Message.AppendInt32(Achievements.Count);

            foreach (Achievement Achievement in Achievements)
            {
                string DisplayName = Achievement.GroupName;

                if (DisplayName.StartsWith("ACH_"))
                {
                    DisplayName = DisplayName.Substring(4);
                }

                Message.AppendStringWithBreak(DisplayName);
                Message.AppendInt32(Achievement.Levels.Count);

                foreach (AchievementLevel Level in Achievement.Levels.Values)
                {
                    Message.AppendInt32(Level.Level);
                    Message.AppendInt32(Level.Requirement);
                }
            }

            return Message;
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:26,代码来源:AchievementDataListComposer.cs

示例9: Compose

 internal static ServerMessage Compose(Achievement Achievement, int TargetLevel, AchievementLevel TargetLevelData,
     int TotalLevels, UserAchievement UserData)
 {
     ServerMessage Message = new ServerMessage(913);
     Message.AppendUInt(Achievement.Id);                                               // Unknown (ID?)
     Message.AppendInt32(TargetLevel);                                                   // Target level
     Message.AppendStringWithBreak(Achievement.GroupName + TargetLevel);                 // Target name/desc/badge
     Message.AppendInt32(TargetLevelData.Requirement);                                   // Progress req/target
     Message.AppendInt32(TargetLevelData.RewardPixels);                                   // Pixel reward
     Message.AppendInt32(TargetLevelData.RewardPoints);                                  // Unknown(??)
     Message.AppendInt32(UserData != null ? UserData.Progress : 0);                      // Current progress
     Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false);  // Set 100% completed(??)
     Message.AppendStringWithBreak(Achievement.Category);                                // Category
     Message.AppendInt32(TotalLevels);                                                   // Total amount of levels
     return Message;
 }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:16,代码来源:AchievementProgressComposer.cs

示例10: SerializeSearchResults

        internal static ServerMessage SerializeSearchResults(string Query)
        {
            DataTable Results = null;

            using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
            {
                if (dbClient.dbType == Pici.Storage.Database.DatabaseType.MySQL)
                    dbClient.setQuery("SELECT id,title FROM help_topics WHERE title LIKE @query OR body LIKE @query LIMIT 25");
                else
                    dbClient.setQuery("SELECT TOP 25 id,title FROM help_topics WHERE title LIKE @query OR body LIKE @query");
                dbClient.addParameter("query", Query + "%");
                Results = dbClient.getTable();
            }

            // HII[KBCan I pay to be unbanned?

            ServerMessage Search = new ServerMessage(521);

            if (Results == null)
            {
                Search.AppendBoolean(false);
                return Search;
            }

            Search.AppendInt32(Results.Rows.Count);

            foreach (DataRow Row in Results.Rows)
            {
                Search.AppendUInt(Convert.ToUInt32(Row["id"]));
                Search.AppendStringWithBreak((string)Row["title"]);
            }

            return Search;
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:34,代码来源:HelpTool.cs

示例11: SerializeFloor

        internal void SerializeFloor(ServerMessage Message, Boolean Inventory)
        {
            Message.AppendUInt(Id);
            Message.AppendStringWithBreak(mBaseItem.Type.ToString().ToUpper());
            Message.AppendUInt(Id);
            Message.AppendInt32(GetBaseItem().SpriteId);
            Message.AppendInt32(1);
            Message.AppendStringWithBreak(ExtraData);

            Message.AppendBoolean(GetBaseItem().AllowRecycle);
            Message.AppendBoolean(GetBaseItem().AllowTrade);
            Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
            Message.AppendBoolean(Marketplace.CanSellItem(this));
            Message.AppendInt32(-1);
            Message.AppendStringWithBreak("");
            Message.AppendInt32(0);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:17,代码来源:UserItem.cs

示例12: Serialize

        internal void Serialize(ServerMessage Message)
        {
            try
            {
                Message.AppendUInt(Id);
                Message.AppendStringWithBreak(Name);
                Message.AppendInt32(CreditsCost);

                if (CrystalCost > 0)
                {
                    Message.AppendInt32(CrystalCost);
                    Message.AppendInt32(4); // Hearts
                }
                else
                {
                    Message.AppendInt32(PixelsCost);
                    Message.AppendInt32(0); // Page Type; 0 = nothing, 1 = Snowflakes, 2 = hearts, 3 = ?
                }
                Message.AppendInt32(1);
                Message.AppendStringWithBreak(GetBaseItem().Type.ToString());
                Message.AppendInt32(GetBaseItem().SpriteId);

                if (Name.Contains("wallpaper_single") || Name.Contains("floor_single") || Name.Contains("landscape_single"))
                {
                    string[] Analyze = Name.Split('_');
                    Message.AppendStringWithBreak(Analyze[2]);
                }
                else if (this.songID > 0 && GetBaseItem().InteractionType == InteractionType.musicdisc)
                {
                    Message.AppendStringWithBreak(songID.ToString());
                }
                else
                {
                    Message.AppendStringWithBreak(string.Empty);
                }
                Message.AppendInt32(Amount);
                Message.AppendInt32(-1);
                Message.AppendInt32(0);
            }
            catch
            {
                Console.WriteLine("Unable to load furniture item " + Id + ": " + Name);
            }
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:44,代码来源:CatalogItem.cs

示例13: Handle

        public bool Handle(RoomUser user, Team team, RoomItem item)
        {
            if (user != null && !user.IsBot && user.GetClient() != null)
            {
                ServerMessage servermsg = new ServerMessage();
                servermsg.Init(25);
                servermsg.AppendInt32(user.VirtualId);
                servermsg.AppendStringWithBreak(message);
                servermsg.AppendBoolean(false);

                user.GetClient().SendMessage(servermsg);
                handler.OnEvent(itemID);
                return true;
            }

            return false;
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:17,代码来源:ShowMessage.cs

示例14: Serialize

        internal ServerMessage Serialize(GameClient Session)
        {
            ServerMessage Message = new ServerMessage(370);
            Message.AppendStringWithBreak(Session.GetHabbo().Id + "");
            Message.AppendStringWithBreak(Session.GetHabbo().Username);
            Message.AppendStringWithBreak(RoomId + "");
            Message.AppendInt32(Category);
            Message.AppendStringWithBreak(Name);
            Message.AppendStringWithBreak(Description);
            Message.AppendStringWithBreak(StartTime);
            Message.AppendInt32(Tags.Count);

            foreach (string Tag in Tags.ToArray())
            {
                Message.AppendStringWithBreak(Tag);
            }
            return Message;
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:18,代码来源:RoomEvent.cs

示例15: Searialize

        internal void Searialize(ServerMessage reply)
        {
            reply.AppendUInt(userID);
            reply.AppendStringWithBreak(username);
            reply.AppendStringWithBreak(motto);

            bool Online = (PiciEnvironment.GetGame().GetClientManager().GetClient(userID) != null);

            reply.AppendBoolean(Online);

            reply.AppendBoolean(false);

            reply.AppendStringWithBreak(string.Empty);
            reply.AppendBoolean(false);
            reply.AppendStringWithBreak(look);
            reply.AppendStringWithBreak(last_online);
            reply.AppendStringWithBreak(string.Empty);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:18,代码来源:SearchResult.cs


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