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


C# ServerMessage.AddBoolean方法代码示例

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


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

示例1: SerializeWall

        internal void SerializeWall(ServerMessage Message, Boolean Inventory)
        {
            Message.AddUInt32(itemID);
			Message.AddChar(char.ToUpper(itemBase.Type));
            Message.AddUInt32(itemID);
            Message.AddInt32(GetBaseItem().SpriteId);

            if (GetBaseItem().Name.Contains("a2"))
                Message.AddInt32(3);
            else if (GetBaseItem().Name.Contains("wallpaper"))
                Message.AddInt32(2);
            else if (GetBaseItem().Name.Contains("landscape"))
                Message.AddInt32(4);
            else
                Message.AddInt32(1);

            Message.AddInt32(0);
            Message.AddString(extraData);
            Message.AddBoolean(false); //recycle
            Message.AddBoolean(GetBaseItem().AllowTrade);
            Message.AddBoolean(GetBaseItem().AllowInventoryStack);
            Message.AddBoolean(false); //marketplace
            Message.AddInt32(-1);
            Message.AddBoolean(false);
            Message.AddInt32(-1);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:26,代码来源:UserItem.cs

示例2: Searialize

        internal void Searialize(ServerMessage reply)
        {
            reply.AddInt32((int)userID);
            reply.AddString(username);
            reply.AddString(motto);

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

            reply.AddBoolean(Online);

            reply.AddBoolean(false);

            reply.AddString(string.Empty);
            reply.AddInt32(0);
            reply.AddString(Online ? look : "");
            reply.AddString(last_online);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:17,代码来源:SearchResult.cs

示例3: Serialize

 internal void Serialize(ref ServerMessage packet)
 {
     packet.AddInt32((int)ButterflyEnvironment.GetUnixTimestamp());
     packet.AddUInt32(userID);
     packet.AddString(username);
     packet.AddString(message);
     packet.AddBoolean(false); // reported msg
 }
开发者ID:BjkGkh,项目名称:R106,代码行数:8,代码来源:ChatMessage.cs

示例4: Serialize

        internal void Serialize(ServerMessage Message)
        {
            Message.AddInt32((int)this.ID);
            Message.AddString(this.catalogName);
            Message.AddBoolean(false);
            Message.AddInt32(this.creditCost);
			Message.AddInt32(diamondCost > 0 ? this.diamondCost : this.pixelCost);
            Message.AddInt32(diamondCost > 0 ? CURRENCY_USED : 0); // Pixel or diamonds?
            Message.AddBoolean(false); // Allow gift =)

            Message.AddInt32(baseID > 0 ? 1 : 0); // items on pack

			if (baseID > 0)
			{
				// and serialize it
				Message.AddString(GetBaseItem().Type.ToString());
				Message.AddInt32(GetBaseItem().SpriteId);
				// extradata
				if (catalogName.Contains("wallpaper_single") || catalogName.Contains("floor_single") || catalogName.Contains("landscape_single"))
				{
					string[] Analyze = catalogName.Split('_');
					Message.AddString(Analyze[2]);
				}
				else if (this.songID > 0 && GetBaseItem().InteractionType == InteractionType.musicdisc)
				{
					Message.AddString(songID.ToString());
				}
				else
				{
					Message.AddString(this.specialText);
				}
				Message.AddInt32(amount);
			}

            Message.AddBoolean(isLimited); // IsLimited

            if (isLimited)
            {
                Message.AddInt32(this.limitedInStock);
                Message.AddInt32(this.limitedInStock - this.limitedSold);
            }

            Message.AddInt32(0);
            Message.AddBoolean(allowMassBuy); // IsOffer
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:45,代码来源:CatalogItem.cs

示例5: SerializeQuest

        internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
        {
            int AmountInCat = ButterflyEnvironment.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.AddString(Category);
            Message.AddInt32(Number); // Quest progress in this cat
            Message.AddInt32(AmountInCat); // Total quests in this cat
            Message.AddInt32((int)QuestRewardType.Pixels); // Reward type (1 = Snowflakes, 2 = Love hearts, 3 = Pixels, 4 = Seashells, everything else is pixels
            Message.AddUInt32(Quest == null ? 0 : Quest.Id); // Quest id
            Message.AddBoolean(Quest == null ? false : Session.GetHabbo().CurrentQuestId == Quest.Id); // Quest started
            Message.AddString(Quest == null ? string.Empty : Quest.ActionName);
            Message.AddString(Quest == null ? string.Empty : Quest.DataBit);
            Message.AddInt32(Quest == null ? 0 : Quest.Reward);
            Message.AddString(Quest == null ? string.Empty : Quest.Name);
            Message.AddInt32(UserProgress); // Current progress
            Message.AddUInt32(Quest == null ? 0 : Quest.GoalData); // Target progress
            Message.AddInt32(0); // "Next quest available countdown" in seconds
            Message.AddString(string.Empty); //set_kuurna
            Message.AddString(string.Empty); // MAIN_CHAIN
            Message.AddBoolean(true); // Euh?
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:28,代码来源:QuestListComposer.cs

示例6: Serialize

        internal int Serialize(int Rank, ServerMessage Message)
        {
            Message.AddBoolean(Visible);
            Message.AddInt32(IconImage);
            Message.AddInt32(Id);
            Message.AddString(Layout);
            Message.AddString(Caption);
            Message.AddInt32(0);
            int k = ButterflyEnvironment.GetGame().GetCatalog().GetTreeSize(Rank, Id);
            Message.AddInt32(k);

            return k;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:13,代码来源:CatalogPage.cs

示例7: SerializeNavigatorRooms

        private void SerializeNavigatorRooms(ServerMessage reply, ISortable<RoomData>[] rooms, int count)
        {
            reply.AddString(string.Empty);
            reply.AddInt32(count);

            for (int i = 0; i < count; i++)
                rooms[i].GetValue().Serialize(reply, false);

            reply.AddBoolean(false);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:10,代码来源:Navigator.cs

示例8: Serialize

        internal void Serialize(ServerMessage Message)
        {
            Message.AddInt32(Id);
            Message.AddString(this.itemType != PublicItemType.PUBLIC_FLAT ? Caption : String.Empty);
            Message.AddString(Description); // description
            Message.AddInt32(Type); // image size
            Message.AddString(this.itemType == PublicItemType.PUBLIC_FLAT ? Caption : String.Empty);
            Message.AddString(Image);
            Message.AddInt32(ParentId > 0 ? ParentId : 0);
            Message.AddInt32(RoomInfo != null ? RoomInfo.UsersNow : 0);
            Message.AddInt32(itemType == PublicItemType.NONE ? 0 : (itemType == PublicItemType.TAG ? 1 : (itemType == PublicItemType.FLAT ? 2 : (itemType == PublicItemType.PUBLIC_FLAT ? 2 : (itemType == PublicItemType.CATEGORY ? 4 : 0)))));

            if (this.itemType == PublicItemType.TAG)
            {
                Message.AddString(TagsToSearch); return;
            }
            else if (this.itemType == PublicItemType.CATEGORY)
            {
                Message.AddBoolean(false); return;
            }
            else if (this.itemType == PublicItemType.FLAT)
            {
                this.RoomInfo.Serialize(Message, false);
            }
            else if (this.itemType == PublicItemType.PUBLIC_FLAT)
            {
                this.RoomInfo.Serialize(Message, false);
            }

            if ((this.itemType == PublicItemType.FLAT || this.itemType == PublicItemType.PUBLIC_FLAT) && Message == null)
            {
                Console.WriteLine("ID: " + Id + " is pointing to a room not existing");
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:34,代码来源:PublicItem.cs

示例9: Serialize

 internal void Serialize(ServerMessage reply)
 {
     reply.AddUInt32(UserId);
     reply.AddString(mUsername);
     reply.AddInt32(1);
     reply.AddBoolean(IsOnline);
     reply.AddBoolean(IsOnline ? InRoom : false);
     reply.AddString(IsOnline ? mLook : "");
     reply.AddInt32(0);
     reply.AddString(mMotto);
     reply.AddString(string.Empty);
     reply.AddString(string.Empty);
     reply.AddBoolean(false);//allow offline
     reply.AddBoolean(false);//dont know 
     reply.AddBoolean(false);//Is on phone
     reply.AddShort((Int16) relationship);
 }
开发者ID:BjkGkh,项目名称:R106,代码行数:17,代码来源:MessengerBuddy.cs

示例10: SerializeClub

        internal void SerializeClub(ServerMessage Message, GameClients.GameClient Session)
        {
            try
            {
                Message.AddInt32((int)this.ID);
                Message.AddString(catalogName);
                Message.AddInt32(this.creditCost);
                Message.AddBoolean(true); // don't know
                int Days = 0;
                int Months = 0;
                if (catalogName.Contains("HABBO_CLUB_VIP_"))
                {
                    if (catalogName.Contains("_DAY"))
                    {
                        Days = int.Parse(catalogName.Split('_')[3]);
                    }
                    else if (catalogName.Contains("_MONTH"))
                    {
                        Months = int.Parse(catalogName.Split('_')[3]);
                        Days = 31 * Months;
                    }
                }
                else if (catalogName.Equals("deal_vip_1_year_and_badge"))
                {
                    Months = 12;
                    Days = 31 * Months;
                }
                else if (catalogName.Equals("HABBO_CLUB_VIP_5_YEAR"))
                {
                    Months = 5 * 12;
                    Days = 31 * Months;
                }
                DateTime future = DateTime.Now;
                if (Session.GetHabboDataContainer().GetSubscriptionManager().HasSubscription())
                {
                    Double Expire = Session.GetHabboDataContainer().GetSubscriptionManager().GetSubscription().ExpireTime;
                    Double TimeLeft = Expire - ButterflyEnvironment.GetUnixTimestamp();
                    int TotalDaysLeft = (int)Math.Ceiling(TimeLeft / 86400);
                    future = DateTime.Now.AddDays(TotalDaysLeft);
                }
                future = future.AddDays(Days);
                Message.AddInt32(Months); // months
                Message.AddInt32(Days); // days
                Message.AddInt32(Days); // wtf
                Message.AddInt32(future.Year); // year
                Message.AddInt32(future.Month); // month
                Message.AddInt32(future.Day); // day
            }
            catch
            {
                //Console.WriteLine("Unable to load club item " + Id + ": " + Name);
            }

        }
开发者ID:BjkGkh,项目名称:R106,代码行数:54,代码来源:CatalogItem.cs

示例11: SerializeFloor

        internal void SerializeFloor(ServerMessage Message, Boolean Inventory)
        {
            if (GetBaseItem().IsGift)
            {
                if (giftData == null) LoadGift();

                string message = string.Empty;
                int spriteCode = 0;
                string figure = string.Empty;

                if (giftData != null)
                {
                    message = giftData.message;
                    spriteCode = (giftData.decorationType * 1000) + giftData.wrappingPaper;
                }

                Message.AddInt32((-1) * (int)this.itemID);
                Message.AddString(this.GetBaseItem().Type.ToString().ToUpper());
                Message.AddUInt32(this.itemID);
                Message.AddInt32(this.GetBaseItem().SpriteId);
                Message.AddInt32(9);
                Message.AddInt32(0);
                Message.AddString(message);
                Message.AddBoolean(false); // recycle
                Message.AddBoolean(this.GetBaseItem().AllowTrade);
                Message.AddBoolean(this.GetBaseItem().AllowInventoryStack);
                Message.AddBoolean(false); //marketplace
                Message.AddInt32(-1);
                Message.AddBoolean(false);
                Message.AddInt32(-1);
                Message.AddString("");
                Message.AddInt32(spriteCode);
            }
            else
            {
                Message.AddUInt32(this.itemID);
                Message.AddString(GetBaseItem().Type.ToString().ToUpper());
                Message.AddUInt32(this.itemID);
                Message.AddInt32(this.GetBaseItem().SpriteId);

                Message.AddInt32(1);

                if (GetBaseItem().InteractionType == InteractionType.badge_display)
                {
                    Message.AddInt32(2);
                    Message.AddInt32(4);

                    if (extraData != string.Empty)
                    {
                        Message.AddString("0"); // extradata check

                        for (int i = 0; i <= extraData.Split(Convert.ToChar(9)).Length - 1; i++)
                            Message.AddString(extraData.Split(Convert.ToChar(9))[i]);
                    }
                    else
                        Message.AddInt32(0);
                }
                else if (GetBaseItem().IsGroupItem && _extraData != null)
                {
                    uint groupID = TextHandling.ParseUInt32(_extraData.Split(':')[0]);
                    GroupData groupData = ButterflyEnvironment.GetGame().GetGroupManager().GetGroup(groupID);
                    if (groupData != null)
                    {
                        Message.AddInt32(2);
                        Message.AddInt32(5);
                        Message.AddString("0");
                        Message.AddString(groupID.ToString());
                        Message.AddString(groupData.image);
                        Message.AddString(groupData.htmlColorPrimary);
                        Message.AddString(groupData.htmlColorSecondary);
                    }
                    else
                    {
                        Message.AddInt32(0);
                        Message.AddString(extraData);
                    }
                }
                else
                {
                    Message.AddInt32(0);
                    Message.AddString(extraData);
                }

                Message.AddBoolean(false);
                Message.AddBoolean(this.GetBaseItem().AllowTrade);
                Message.AddBoolean(this.GetBaseItem().AllowInventoryStack);
                Message.AddBoolean(false);
                Message.AddInt32(-1); // secondsToExpiration
                Message.AddBoolean(false); // hasRentPeriodStarted
                Message.AddInt32(-1); // Roomid
                Message.AddString("S"); // slotId ??
                Message.AddInt32(0);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:94,代码来源:UserItem.cs


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