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


C# ServerMessage.AppendUInt方法代码示例

本文整理汇总了C#中Firewind.Messages.ServerMessage.AppendUInt方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendUInt方法的具体用法?C# ServerMessage.AppendUInt怎么用?C# ServerMessage.AppendUInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Firewind.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(Outgoing.TradeStart);
            Message.AppendUInt(UserOneId);
            Message.AppendInt32(1); // ready
            Message.AppendUInt(UserTwoId);
            Message.AppendInt32(1); // ready
            SendMessageToUsers(Message);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数: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:TheNaked,项目名称:Firewind,代码行数:14,代码来源:JukeboxDiscksComposer.cs

示例3: Serialize

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

示例4: Serialize

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

            Request.AppendUInt(FromUser);
            Request.AppendString(mUsername);
            Habbo user = FirewindEnvironment.getHabboForName(mUsername);
            Request.AppendString((user != null) ? user.Look : "");
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:9,代码来源:MessengerRequest.cs

示例5: SerializeFloor

        internal void SerializeFloor(ServerMessage Message, Boolean Inventory)
        {
            Message.AppendUInt(Id);
            Message.AppendString(mBaseItem.Type.ToString().ToUpper());
            Message.AppendUInt(Id);
            Message.AppendInt32(GetBaseItem().SpriteId);
            Message.AppendInt32(Extra); // extra

            Message.AppendInt32(Data.GetTypeID());
            Data.AppendToMessage(Message);

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

示例6: 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:TheNaked,项目名称:Firewind,代码行数:23,代码来源:JukeboxDiscksComposer.cs

示例7: Searialize

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

            bool Online = (FirewindEnvironment.GetGame().GetClientManager().GetClientByUserID(userID) != null);

            reply.AppendBoolean(Online);

            reply.AppendBoolean(false);

            reply.AppendString(string.Empty);
            reply.AppendInt32(0);
            reply.AppendString(look);
            reply.AppendString(last_online);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:17,代码来源:SearchResult.cs

示例8: Compose

 internal static ServerMessage Compose(Achievement Achievement, int Level, int PointReward, int PixelReward)
 {
     ServerMessage Message = new ServerMessage(Outgoing.UnlockAchievement);
     Message.AppendUInt(Achievement.Id);                                           // Achievement ID
     Message.AppendInt32(Level);                                                     // Achieved level
     Message.AppendInt32(144);                                                         // Unknown. Random useless number.
     Message.AppendString(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.AppendString(Level > 1 ? Achievement.GroupName + (Level - 1) : string.Empty);
     Message.AppendString(Achievement.Category);
     Message.AppendString(String.Empty);
     Message.AppendInt32(0);
     Message.AppendInt32(0);
     return Message;
 }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:19,代码来源:AchievementUnlockedComposer.cs

示例9: Compose

 internal static ServerMessage Compose(Achievement Achievement, int TargetLevel, AchievementLevel TargetLevelData,
     int TotalLevels, UserAchievement UserData)
 {
     ServerMessage Message = new ServerMessage(Outgoing.AchievementProgress);
     Message.AppendUInt(Achievement.Id);                                               // Unknown (ID?)
     Message.AppendInt32(TargetLevel);                                                   // Target level
     Message.AppendString(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(0); // ?
     Message.AppendInt32(UserData != null ? UserData.Progress : 0);                      // Current progress
     Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false);  // Set 100% completed(??)
     Message.AppendString(Achievement.Category);                               // Category
     Message.AppendString(String.Empty);
     Message.AppendInt32(TotalLevels);                                                   // Total amount of levels
     Message.AppendInt32(0);
     return Message;
 }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:19,代码来源:AchievementProgressComposer.cs

示例10: Compose

        internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
        {
            ServerMessage Message = new ServerMessage(Outgoing.AchievementList); //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.AppendString(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(0);
                Message.AppendInt32(UserData != null ? UserData.Progress : 0);                      // Current progress
                Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false);  // Set 100% completed(??)
                Message.AppendString(Achievement.Category);                                // Category
                Message.AppendString(String.Empty);
                Message.AppendInt32(TotalLevels);                                                   // Total amount of levels
                Message.AppendInt32(0);
            }
            Message.AppendBoolean(false);
            Message.AppendBoolean(false);
            return Message;
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:36,代码来源:AchievementListComposer.cs

示例11: SerializeOffers

        internal static ServerMessage SerializeOffers(int MinCost, int MaxCost, String SearchQuery, int FilterMode)
        {
            // IgI`UJUIIY~JX]gXoAJISA

            DataTable Data = new DataTable();
            StringBuilder WhereClause = new StringBuilder();
            string OrderMode = "";

            WhereClause.Append("WHERE state = '1' AND timestamp >= " + FormatTimestampString());

            if (MinCost >= 0)
            {
                WhereClause.Append(" AND total_price > " + MinCost);
            }

            if (MaxCost >= 0)
            {
                WhereClause.Append(" AND total_price < " + MaxCost);
            }

            switch (FilterMode)
            {
                case 1:
                default:

                    OrderMode = "ORDER BY asking_price DESC";
                    break;

                case 2:

                    OrderMode = "ORDER BY asking_price ASC";
                    break;
            }

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                if (SearchQuery.Length >= 1)
                    WhereClause.Append(" AND public_name LIKE @search_query");

                dbClient.setQuery("SELECT offer_id, item_type, sprite_id, total_price FROM catalog_marketplace_offers " + WhereClause.ToString() + " " + OrderMode + " LIMIT 100");
                dbClient.addParameter("search_query", SearchQuery + "%");

                Data = dbClient.getTable();
            }

            ServerMessage Message = new ServerMessage(615);

            if (Data != null)
            {
                Message.AppendInt32(Data.Rows.Count);

                foreach (DataRow Row in Data.Rows)
                {
                    Message.AppendUInt(Convert.ToUInt32(Row["offer_id"]));
                    Message.AppendInt32(1);
                    Message.AppendInt32(int.Parse(Row["item_type"].ToString()));
                    Message.AppendInt32((int)Row["sprite_id"]); // Sprite ID
                    Message.AppendString(""); // Extra Chr (R52)
                    Message.AppendInt32((int)Row["total_price"]); // Price
                    Message.AppendInt32((int)Row["sprite_id"]); // ??
                    Message.AppendInt32((int)Row["total_price"]); // Avg
                    Message.AppendInt32(0); // Offers
                }
            }
            else
            {
                Message.AppendInt32(0);
            }

            return Message;
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:71,代码来源:Marketplace.cs

示例12: SerializeOwnOffers

        internal static ServerMessage SerializeOwnOffers(int HabboId)
        {
            int Profits = 0;
            DataTable Data;
            String RawProfit;

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("SELECT timestamp, state, offer_id, item_type, sprite_id, total_price FROM catalog_marketplace_offers WHERE user_id = " + HabboId);
                Data = dbClient.getTable();

                dbClient.setQuery("SELECT SUM(asking_price) FROM catalog_marketplace_offers WHERE state = '2' AND user_id = " + HabboId);
                RawProfit = dbClient.getRow()[0].ToString();
            }

            if (RawProfit.Length > 0)
                Profits = int.Parse(RawProfit);

            ServerMessage Message = new ServerMessage(616);
            Message.AppendInt32(Profits);

            if (Data != null)
            {
                Message.AppendInt32(Data.Rows.Count);

                foreach (DataRow Row in Data.Rows)
                {
                    int MinutesLeft = (int)Math.Floor((((Double)Row["timestamp"] + 172800) - FirewindEnvironment.GetUnixTimestamp()) / 60);
                    int state = int.Parse(Row["state"].ToString());

                    if (MinutesLeft <= 0)
                    {
                        state = 3;
                        MinutesLeft = 0;
                    }

                    Message.AppendUInt(Convert.ToUInt32(Row["offer_id"]));
                    Message.AppendInt32(state); // 1 = active, 2 = sold, 3 = expired
                    Message.AppendInt32(int.Parse(Row["item_type"].ToString())); // always 1 (??)
                    Message.AppendInt32((int)Row["sprite_id"]);
                    Message.AppendString(""); // Extra Chr (R52)
                    Message.AppendInt32((int)Row["total_price"]); // ??
                    Message.AppendInt32(MinutesLeft);
                    Message.AppendInt32((int)Row["sprite_id"]);
                }
            }
            else
                Message.AppendInt32(0);

            return Message;
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:51,代码来源:Marketplace.cs

示例13: SerializeQuest

        internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
        {
            int AmountInCat = FirewindEnvironment.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Category);
            int Number = Quest == null ? AmountInCat : Quest.Number - 1;
            int UserProgress = Quest == null ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);

            if (Quest != null && Quest.IsCompleted(UserProgress))
            {
                Number++;
            }

            Message.AppendString(Category);
            Message.AppendInt32(Number); // Quest progress in this cat
            Message.AppendInt32(AmountInCat); // Total quests in this cat
            Message.AppendInt32((int)QuestRewardType.Pixels); // Reward type (1 = Snowflakes, 2 = Love hearts, 3 = Pixels, 4 = Seashells, everything else is pixels
            Message.AppendUInt(Quest == null ? 0 : Quest.Id); // Quest id
            Message.AppendBoolean(Quest == null ? false : Session.GetHabbo().CurrentQuestId == Quest.Id); // Quest started
            Message.AppendString(Quest == null ? string.Empty : Quest.ActionName);
            Message.AppendString(Quest == null ? string.Empty : Quest.DataBit);
            Message.AppendInt32(Quest == null ? 0 : Quest.Reward);
            Message.AppendString(Quest == null ? string.Empty : Quest.Name);
            Message.AppendInt32(UserProgress); // Current progress
            Message.AppendUInt(Quest == null ? 0 : Quest.GoalData); // Target progress
            Message.AppendInt32(0); // "Next quest available countdown" in seconds
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:25,代码来源:QuestListComposer.cs

示例14: SerializeClub

        internal void SerializeClub()
        {
            GameClient Client = GetClient();
            ServerMessage club = new ServerMessage(Outgoing.SerializeClub);
            club.AppendString("club_habbo");

            if (GetSubscriptionManager().HasSubscription("habbo_vip"))
            {
                Double Expire = GetSubscriptionManager().GetSubscription("habbo_vip").ExpireTime;
                Double TimeLeft = Expire - FirewindEnvironment.GetUnixTimestamp();
                int TotalDaysLeft = (int)Math.Ceiling(TimeLeft / 86400);
                int MonthsLeft = TotalDaysLeft / 31;

                if (MonthsLeft >= 1) MonthsLeft--;

                club.AppendInt32(TotalDaysLeft - (MonthsLeft * 31));
                club.AppendInt32(2); // ??
                club.AppendInt32(MonthsLeft);
                club.AppendInt32(1); // type
                club.AppendBoolean(true);
                club.AppendBoolean(true);
                club.AppendInt32(0);
                club.AppendInt32(0); // days i have on hc
                club.AppendInt32(0); // days i have on vip
            }
            else
            {
                club.AppendInt32(0);
                club.AppendInt32(0); // ??
                club.AppendInt32(0);
                club.AppendInt32(0); // type
                club.AppendBoolean(false);
                club.AppendBoolean(true);
                club.AppendInt32(0);
                club.AppendInt32(0); // days i have on hc
                club.AppendInt32(0); // days i have on vip
            }

            Client.SendMessage(club);

            ServerMessage fuserights = new ServerMessage(Outgoing.Fuserights);
            if (GetSubscriptionManager().HasSubscription("habbo_vip")) // VIP
                fuserights.AppendInt32(2);
            else if (GetSubscriptionManager().HasSubscription("habbo_club")) // HC
                fuserights.AppendInt32(1);
            else
                fuserights.AppendInt32(0);
            fuserights.AppendUInt(Rank);

            Client.SendMessage(fuserights);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:51,代码来源:Habbo.cs

示例15: SerializeMusicDiscs

        internal ServerMessage SerializeMusicDiscs()
        {
            ServerMessage Message = new ServerMessage(333);
            Message.AppendInt32(discs.Count);

            foreach (UserItem SongDisk in discs.Values)
            {
                uint SongId = 0;
                uint.TryParse(SongDisk.Data.ToString(), out SongId);

                Message.AppendUInt(SongDisk.Id);
                Message.AppendUInt(SongId);
            }

            return Message;
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:16,代码来源:InventoryComponent.cs


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