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


C# ServerMessage.AppendUInt方法代码示例

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


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

示例1: Trade

        internal Trade(UInt32 UserOneId, UInt32 UserTwoId, UInt32 RoomId)
        {
            this.oneId = UserOneId;
            this.twoId = UserTwoId;

            this.Users = new TradeUser[2];
            this.Users[0] = new TradeUser(UserOneId, RoomId);
            this.Users[1] = new TradeUser(UserTwoId, RoomId);
            this.TradeStage = 1;
            this.RoomId = RoomId;

            foreach (TradeUser User in Users)
            {
                if (!User.GetRoomUser().Statusses.ContainsKey("trd"))
                {
                    User.GetRoomUser().AddStatus("trd", "");
                    User.GetRoomUser().UpdateNeeded = true;
                }
            }

            ServerMessage Message = new ServerMessage(104);
            Message.AppendUInt(UserOneId);
            Message.AppendBoolean(true);
            Message.AppendUInt(UserTwoId);
            Message.AppendBoolean(true);
            SendMessageToUsers(Message);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:27,代码来源:Trade.cs

示例2: Compose

        internal static ServerMessage Compose(int PlaylistCapacity, List<SongInstance> Playlist)
        {
            ServerMessage Message = new ServerMessage(334);
            Message.AppendInt32(PlaylistCapacity);
            Message.AppendInt32(Playlist.Count);

            foreach (SongInstance Song in Playlist)
            {
                Message.AppendUInt(Song.DiskItem.itemID);
                Message.AppendUInt(Song.SongData.Id);
            }

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

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

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

示例5: DeliverInstantMessage

 internal void DeliverInstantMessage(string message, uint convoID)
 {
     ServerMessage InstantMessage = new ServerMessage(134);
     InstantMessage.AppendUInt(convoID);
     InstantMessage.AppendString(message);
     GetClient().SendMessage(InstantMessage);
 }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:7,代码来源:HabboMessenger.cs

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

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

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

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

示例10: ComposePlayingComposer

        public static ServerMessage ComposePlayingComposer(uint SongId, int PlaylistItemNumber, int SyncTimestampMs)
        {
            ServerMessage Message = new ServerMessage(327);

            if (SongId == 0)
            {
                Message.AppendInt32(-1);
                Message.AppendInt32(-1);
                Message.AppendInt32(-1);
                Message.AppendInt32(-1);
                Message.AppendInt32(0);
            }
            else
            {
                Message.AppendUInt(SongId);
                Message.AppendInt32(PlaylistItemNumber);
                Message.AppendUInt(SongId);
                Message.AppendInt32(0);
                Message.AppendInt32(SyncTimestampMs);
            }

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

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

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

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

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

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


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