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


C# ServerMessage.AppendBoolean方法代码示例

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


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

示例1: Searialize

        internal void Searialize(ServerMessage reply)
        {
            reply.AppendInt32(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:Kristopher-RZ,项目名称:Firewind,代码行数:17,代码来源:SearchResult.cs

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

示例3: SerializeUpdate

        internal static ServerMessage SerializeUpdate(MessengerBuddy friend)
        {
            ServerMessage reply = new ServerMessage(Outgoing.FriendUpdate);
            reply.AppendInt32(0); // category
            reply.AppendInt32(1); // number of updates
            reply.AppendInt32(0); // don't know

            friend.Serialize(reply);
            reply.AppendBoolean(false);

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

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

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

示例6: Unidle

        internal void Unidle()
        {
            this.IdleTime = 0;

            if (this.IsAsleep)
            {
                this.IsAsleep = false;

                ServerMessage Message = new ServerMessage(Outgoing.IdleStatus);
                Message.AppendInt32(VirtualID);
                Message.AppendBoolean(false);

                GetRoom().SendMessage(Message);
            }
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:15,代码来源:RoomUser.cs

示例7: OnCycle

        internal override void OnCycle()
        {
            base.OnCycle();

            if (!IsValidUser())
            {
                if (GetClient() != null)
                   GetRoom().GetRoomUserManager().RemoveUserFromRoom(GetClient(), false, false);
                else
                    GetRoom().GetRoomUserManager().RemoveRoomUnit(this);
            }

            if (IsWalking && IsAsleep) // Unidle!
                Unidle();

            IdleTime++;
            if (!IsAsleep && IdleTime >= 600)
            {
                IsAsleep = true;

                ServerMessage FallAsleep = new ServerMessage(Outgoing.IdleStatus);
                FallAsleep.AppendInt32(VirtualID);
                FallAsleep.AppendBoolean(true);
                GetRoom().SendMessage(FallAsleep);
            }

            // TODO: Re-add idle kicking

            if (CarryItemID > 0)
            {
                CarryTimer--;
                if (CarryTimer <= 0)
                    CarryItem(0);
            }
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:35,代码来源:RoomUser.cs

示例8: SerializeNavigatorPopularRooms

 private void SerializeNavigatorPopularRooms(ref ServerMessage reply, KeyValuePair<RoomData, int>[] rooms, int Category)
 {
     reply.AppendInt32(rooms.Length);
     int i = 0;
     foreach (KeyValuePair<RoomData, int> pair in rooms)
     {
         RoomData data = pair.Key;
         if (data.Category.Equals(Category))
         {
             data.Serialize(reply, false);
             i++;
         }
         else
             continue;
     }
     //Logging.WriteLine("Rooms in this category: " + i);
     reply.setInt(i, 8 + Category.ToString().Length);
     reply.AppendBoolean(false);
 }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:19,代码来源:Navigator.cs

示例9: Serialize

        internal void Serialize(ServerMessage Message, Boolean ShowEvents)
        {
            Message.AppendUInt(Id);

            if (Event == null || !ShowEvents)
            {
                Message.AppendBoolean(false);
                Message.AppendString(Name);
                Message.AppendBoolean(Owner != "");
                Message.AppendInt32(OwnerId);
                Message.AppendString(Owner);
                Message.AppendInt32(State); // room state
                Message.AppendInt32(UsersNow);
                Message.AppendInt32(UsersMax);
                Message.AppendString(Description);
                Message.AppendInt32(0); // dunno!
                Message.AppendInt32(2); // can trade?
                Message.AppendInt32(Score);
                Message.AppendInt32(Category);
                Message.AppendInt32(Group != null ? Group.ID : 0); // group id
                Message.AppendString(Group != null ? Group.Name : ""); // group name
                Message.AppendString(Group != null ? Group.BadgeCode : ""); // group image
                //Message.AppendInt32(1);
                //Message.AppendString("GRP");
                //Message.AppendString("");
                Message.AppendString(""); // ???
                Message.AppendInt32(TagCount);

                foreach (string Tag in Tags)
                {
                    Message.AppendString(Tag);
                }
            }
            else
            {
                Message.AppendBoolean(true);
                Message.AppendString(Event.Name);
                Message.AppendString(Owner);
                Message.AppendInt32(State);
                Message.AppendInt32(UsersNow);
                Message.AppendInt32(UsersMax);
                Message.AppendString(Event.Description);
                Message.AppendBoolean(true);
                Message.AppendBoolean(true);
                Message.AppendInt32(Score);
                Message.AppendInt32(Event.Category);
                Message.AppendString(Event.StartTime);
                Message.AppendInt32(Event.Tags.Count);

                foreach (string Tag in Event.Tags.ToArray())
                {
                    Message.AppendString(Tag);
                }
            }
            Message.AppendInt32(0);
            Message.AppendInt32(0);
            Message.AppendInt32(0);
            Message.AppendBoolean(true);
            Message.AppendBoolean(true);
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:60,代码来源:RoomData.cs

示例10: SerializeNavigatorRooms

        private void SerializeNavigatorRooms(ref ServerMessage reply, List<RoomData> rooms)
        {
            reply.AppendString("");
            reply.AppendInt32(rooms.Count);

            bool headerSerialized = false;
            foreach (RoomData data in rooms)
            {

                data.Serialize(reply, false);
            }
            reply.AppendBoolean(false);

            //if (PublicRecommended.Count > 0)
            //{
            //    reply.AppendString("");

            //    foreach (PublicItem Pub in PublicRecommended.Values)
            //    {
            //        Pub.Serialize(reply);
            //    }
            //}
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:23,代码来源:Navigator.cs

示例11: Compose

        internal static ServerMessage Compose(GameClient Session, List<Quest> Quests, bool Send)
        {
            Dictionary<string, int> UserQuestGoals = new Dictionary<string, int>();
            Dictionary<string, Quest> UserQuests = new Dictionary<string, Quest>();

            foreach (Quest Quest in Quests)
            {
                if (!UserQuestGoals.ContainsKey(Quest.Category))
                {
                    UserQuestGoals.Add(Quest.Category, 1);
                    UserQuests.Add(Quest.Category, null);
                }

                if (Quest.Number >= UserQuestGoals[Quest.Category])
                {
                    int UserProgress = Session.GetHabbo().GetQuestProgress(Quest.Id);

                    if (Session.GetHabbo().CurrentQuestId != Quest.Id && UserProgress >= Quest.GoalData)
                    {
                        UserQuestGoals[Quest.Category] = Quest.Number + 1;
                    }
                }
            }

            foreach (Quest Quest in Quests)
            {
                foreach (KeyValuePair<string, int> Goal in UserQuestGoals)
                {
                    if (Quest.Category == Goal.Key && Quest.Number == Goal.Value)
                    {
                        UserQuests[Goal.Key] = Quest;
                        break;
                    }
                }
            }

            ServerMessage Message = new ServerMessage(800);
            Message.AppendInt32(UserQuests.Count);

            // Active ones first
            foreach (KeyValuePair<string, Quest> UserQuest in UserQuests)
            {
                if (UserQuest.Value == null)
                {
                    continue;
                }

                SerializeQuest(Message, Session, UserQuest.Value, UserQuest.Key);
            }

            // Dead ones last
            foreach (KeyValuePair<string, Quest> UserQuest in UserQuests)
            {
                if (UserQuest.Value != null)
                {
                    continue;
                }

                SerializeQuest(Message, Session, UserQuest.Value, UserQuest.Key);
            }

            Message.AppendBoolean(Send);
            return Message;
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:64,代码来源:QuestListComposer.cs

示例12: SendGroupList

        internal void SendGroupList()
        {
            List<Group> groups = FirewindEnvironment.GetGame().GetGroupManager().GetGroups(this.Groups);
            ServerMessage message = new ServerMessage(Outgoing.OwnGuilds);

            message.AppendInt32(groups.Count); // count
            foreach (Group group in groups)
            {
                message.AppendInt32(group.ID); // groupId
                message.AppendString(group.Name); // groupName
                message.AppendString(group.BadgeCode); // badge
                message.AppendString(group.Color1); // color 1
                message.AppendString(group.Color2); // color 2
                message.AppendBoolean(true); // favourite
            }

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

示例13: HandlePurchase


//.........这里部分代码省略.........

                if (GiftUserId == 0)
                {
                    Session.GetMessageHandler().GetResponse().Init(Outgoing.GiftError);
                    Session.GetMessageHandler().GetResponse().AppendString(GiftUser);
                    Session.GetMessageHandler().SendResponse();

                    return;
                }
            }

            Boolean CreditsError = false;
            Boolean PixelError = false;
            Boolean CrystalError = false;

            if (Session.GetHabbo().Credits < (Item.CreditsCost * finalAmount))
            {
                CreditsError = true;
            }

            if (Session.GetHabbo().VipPoints < (Item.CrystalCost * finalAmount))
            {
                CrystalError = true;
            }

            if (Session.GetHabbo().ActivityPoints < (Item.PixelsCost * finalAmount))
            {
                PixelError = true;
            }

            if (CreditsError || PixelError)
            {
                ServerMessage message = new ServerMessage(Outgoing.NotEnoughBalance);
                message.AppendBoolean(CreditsError);
                message.AppendBoolean(PixelError);
                Session.SendMessage(message);
                return;
            }

            if (Item.CrystalCost > 0)
            {
                int cost = Item.CrystalCost * finalAmount;
                if (Session.GetHabbo().VipPoints < cost)
                {
                    Session.SendNotif("You can't afford that item!");
                    Session.SendMessage(new ServerMessage(Outgoing.PurchaseError));
                    return;
                }

                Session.GetHabbo().VipPoints -= cost;
                Session.GetHabbo().UpdateActivityPointsBalance(true);

                using (IQueryAdapter adapter = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    adapter.runFastQuery("UPDATE users SET vip_points = " + Session.GetHabbo().VipPoints + " WHERE id = " + Session.GetHabbo().Id);
                }

            }

            if (Item.CreditsCost > 0 && !IsGift)
            {
                Session.GetHabbo().Credits -= (Item.CreditsCost * finalAmount);
                Session.GetHabbo().UpdateCreditsBalance();
            }

            if (Item.PixelsCost > 0 && !IsGift)
开发者ID:TheNaked,项目名称:Firewind,代码行数:67,代码来源:Catalog.cs

示例14: SerializeIndexForCache

        internal ServerMessage SerializeIndexForCache(int rank)
        {
            //ServerMessage Index = new ServerMessage(126);
            //Index.AppendBoolean(false);
            //Index.AppendInt32(0);
            //Index.AppendInt32(0);
            //Index.AppendInt32(-1);
            //Index.AppendString("");
            //Index.AppendBoolean(false);
            ServerMessage Index = new ServerMessage(Outgoing.OpenShop); //Fix for r61
            Index.AppendBoolean(true);
            Index.AppendInt32(0);
            Index.AppendInt32(0);
            Index.AppendInt32(-1);
            Index.AppendString("root");
            Index.AppendString("");
            Index.AppendInt32(GetTreeSize(rank, -1));

            foreach (CatalogPage Page in Pages.Values)
            {
                if (Page.ParentId != -1 || Page.MinRank > rank)
                    continue;

                Page.Serialize(rank, Index);

                foreach (CatalogPage _Page in Pages.Values)
                {
                    if (_Page.ParentId != Page.PageId)
                        continue;

                    _Page.Serialize(rank, Index);
                }
            }
            Index.AppendBoolean(false); // is updated
            return Index;
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:36,代码来源:Catalog.cs

示例15: UpdateUserStatus


//.........这里部分代码省略.........
                                    AvatarEffectsInventoryComponent efectmanager = User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent();

                                    if (User.team != Item.team)
                                    {
                                        if (t.CanEnterOnTeam(Item.team))
                                        {
                                            if (User.team != Team.none)
                                                t.OnUserLeave(User);
                                            User.team = Item.team;
                                            t.AddUser(User);

                                            if (efectmanager.CurrentEffect != effectID)
                                                efectmanager.ApplyCustomEffect(effectID);
                                        }
                                    }
                                    else
                                    {
                                        //usersOnTeam--;
                                        t.OnUserLeave(User);
                                        if (efectmanager.CurrentEffect == effectID)
                                            efectmanager.ApplyCustomEffect(0);
                                        User.team = Team.none;
                                    }
                                    //((StringData)Item.data).Data = usersOnTeam.ToString();
                                    //Item.UpdateState(false, true);
                                }
                                break;
                            }

                        case InteractionType.freezeyellowgate:
                        case InteractionType.freezeredgate:
                        case InteractionType.freezegreengate:
                        case InteractionType.freezebluegate:
                            {
                                if (cyclegameitems)
                                {
                                    int effectID = (int)Item.team + 39;
                                    TeamManager t = User.GetClient().GetHabbo().CurrentRoom.GetTeamManagerForFreeze();
                                    //int usersOnTeam = 0;
                                    //if (((StringData)Item.data).Data != "")
                                    //usersOnTeam = int.Parse(((StringData)Item.data).Data);
                                    AvatarEffectsInventoryComponent efectmanager = User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent();

                                    if (User.team != Item.team)
                                    {
                                        if (t.CanEnterOnTeam(Item.team))
                                        {
                                            if (User.team != Team.none)
                                                t.OnUserLeave(User);
                                            User.team = Item.team;
                                            t.AddUser(User);

                                            if (efectmanager.CurrentEffect != effectID)
                                                efectmanager.ApplyCustomEffect(effectID);
                                        }
                                    }
                                    else
                                    {
                                        //usersOnTeam--;
                                        t.OnUserLeave(User);
                                        if (efectmanager.CurrentEffect == effectID)
                                            efectmanager.ApplyCustomEffect(0);
                                        User.team = Team.none;
                                    }
                                    //((StringData)Item.data).Data = usersOnTeam.ToString();
                                    //Item.UpdateState(false, true);

                                    ServerMessage message = new ServerMessage(700);
                                    message.AppendBoolean((User.team != Team.none));

                                    User.GetClient().SendMessage(message);
                                }
                                break;
                            }

                        case InteractionType.banzaitele:
                            {
                                room.GetGameItemHandler().onTeleportRoomUserEnter(User, Item);
                                break;
                            }

                    }
                }

                if (cyclegameitems)
                {
                    if (room.GotSoccer())
                        room.GetSoccer().OnUserWalk(User);

                    if (room.GotBanzai())
                        room.GetBanzai().OnUserWalk(User);

                    //if (room.GotFreeze())
                    room.GetFreeze().OnUserWalk(User);
                }
            }
            catch (Exception e)
            {
            }
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:101,代码来源:RoomUserManager.cs


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