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


C# ServerMessage.AppendBoolean方法代码示例

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


在下文中一共展示了ServerMessage.AppendBoolean方法的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(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

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

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

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

示例6: SerializeUpdate

        internal static ServerMessage SerializeUpdate(MessengerBuddy friend)
        {
            ServerMessage reply = new ServerMessage(13);
            reply.AppendInt32(0);
            reply.AppendInt32(1);
            reply.AppendInt32(0);

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

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

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

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

示例9: RemoveAllFurniture

        internal List<RoomItem> RemoveAllFurniture(GameClient Session)
        {
            List<RoomItem> ReturnList = new List<RoomItem>();
            foreach (RoomItem Item in mFloorItems.Values.ToArray())
            {
                Item.Interactor.OnRemove(Session, Item);
                ServerMessage Message = new ServerMessage(94);
                Message.AppendRawUInt(Item.Id);
                Message.AppendStringWithBreak("");
                Message.AppendBoolean(false);
                room.SendMessage(Message);

                //mFloorItems.Remove(Item.Id);

                ReturnList.Add(Item);
            }

            foreach (RoomItem Item in mWallItems.Values.ToArray())
            {
                Item.Interactor.OnRemove(Session, Item);
                ServerMessage Message = new ServerMessage(84);
                Message.AppendRawUInt(Item.Id);
                Message.AppendStringWithBreak("");
                Message.AppendBoolean(false);
                room.SendMessage(Message);
                //mWallItems.Remove(Item.Id);

                ReturnList.Add(Item);
            }

            mWallItems.Clear();
            mFloorItems.Clear();

            mRemovedItems.Clear();

            mMovedItems.Clear();
            mAddedItems.Clear();
            mRollers.QueueDelegate(new onCycleDoneDelegate(ClearRollers));

            using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("DELETE FROM items_rooms WHERE room_id = " + room.RoomId);
            }

            room.GetGameMap().GenerateMaps();
            room.GetRoomUserManager().UpdateUserStatusses();

            if (room.GotWired())
            {
                room.GetWiredHandler().OnPickall();
            }

            return ReturnList;
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:54,代码来源:RoomItemHandling.cs

示例10: Serialize

 internal void Serialize(int Rank, ServerMessage Message)
 {
     Message.AppendBoolean(Visible);
     Message.AppendInt32(IconColor);
     Message.AppendInt32(IconImage);
     Message.AppendInt32(Id);
     Message.AppendStringWithBreak(Caption);
     Message.AppendInt32(PiciEnvironment.GetGame().GetCatalog().GetTreeSize(Rank, Id));
 }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:9,代码来源:CatalogPage.cs

示例11: SerializeQuest

        internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
        {
            int AmountInCat = PiciEnvironment.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.AppendStringWithBreak(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.AppendStringWithBreak(Quest == null ? string.Empty : Quest.ActionName);
            Message.AppendStringWithBreak(Quest == null ? string.Empty : Quest.DataBit);
            Message.AppendInt32(Quest == null ? 0 : Quest.Reward);
            Message.AppendStringWithBreak(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:habb0,项目名称:PiciEmulator,代码行数:25,代码来源:QuestListComposer.cs

示例12: Serialize

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

            if (Event == null || !ShowEvents)
            {
                Message.AppendInt32(0);
                Message.AppendStringWithBreak(Name);
                Message.AppendStringWithBreak(Owner);
                Message.AppendInt32(State); // room state
                Message.AppendInt32(UsersNow);
                Message.AppendInt32(UsersMax);
                Message.AppendStringWithBreak(Description);
                Message.AppendInt32(0); // dunno!
                Message.AppendBoolean(true); // can trade?
                Message.AppendInt32(Score);
                Message.AppendInt32(Category);
                Message.AppendStringWithBreak(string.Empty);
                Message.AppendInt32(TagCount);

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

                foreach (string Tag in Event.Tags.ToArray())
                {
                    Message.AppendStringWithBreak(Tag);
                }
            }

            Icon.Serialize(Message);

            Message.AppendBoolean(AllowPets);
            Message.AppendBoolean(AllowPetsEating);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:52,代码来源:RoomData.cs

示例13: SerializeFriends

        internal ServerMessage SerializeFriends()
        {
            ServerMessage reply = new ServerMessage(12);
            reply.AppendInt32(600);
            reply.AppendInt32(200);
            reply.AppendInt32(600);
            reply.AppendInt32(900);
            reply.AppendBoolean(false);
            reply.AppendInt32(friends.Count);

            foreach (MessengerBuddy friend in friends.Values)
            {
                friend.Serialize(reply);
            }

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

示例14: OnCycle

        internal void OnCycle(ref int idleCount)
        {
            ToRemove.Clear();
            int userCounter = 0;

            foreach (RoomUser User in UserList.Values)
            {
                if (!isValid(User))
                {
                    if (User.GetClient() != null)
                        RemoveUserFromRoom(User.GetClient(), false, false);
                    else
                        RemoveRoomUser(User);
                }

                bool updated = false;
                User.IdleTime++;

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

                    ServerMessage FallAsleep = new ServerMessage(486);
                    FallAsleep.AppendInt32(User.VirtualId);
                    FallAsleep.AppendBoolean(true);
                    room.SendMessage(FallAsleep);
                }

                if (User.NeedsAutokick && !ToRemove.Contains(User))
                {
                    ToRemove.Add(User);
                    continue;
                }

                if (User.CarryItemID > 0)
                {
                    User.CarryTimer--;
                    if (User.CarryTimer <= 0)
                        User.CarryItem(0);
                }

                if (room.GotFreeze())
                {
                    room.GetFreeze().CycleUser(User);
                }

                if (User.isFlying)
                    User.OnFly();

                if (User.SetStep)
                {
                    if (room.GetGameMap().CanWalk(User.SetX, User.SetY, User.AllowOverride))
                    {
                        room.GetGameMap().UpdateUserMovement(new Point(User.Coordinate.X, User.Coordinate.Y), new Point(User.SetX, User.SetY), User);
                        List<RoomItem> items = room.GetGameMap().GetCoordinatedItems(new Point(User.X, User.Y));

                        User.X = User.SetX;
                        User.Y = User.SetY;
                        User.Z = User.SetZ;
                        if (User.isFlying)
                            User.Z += 4 + 0.5 * Math.Sin(0.7 * User.flyk);

                        foreach (RoomItem item in items)
                        {
                            item.UserWalksOffFurni(User);
                        }

                        if (User.X == room.GetGameMap().Model.DoorX && User.Y == room.GetGameMap().Model.DoorY && !ToRemove.Contains(User) && !User.IsBot)
                        {
                            ToRemove.Add(User);
                            continue;
                        }

                        if (room.IsPublic)
                        {
                            room.GetGameMap().HandleRoomLinks(User);
                        }

                        UpdateUserStatus(User, true);
                    }
                    User.SetStep = false;
                }

                if (User.IsWalking && !User.Freezed)
                {
                    Gamemap map = room.GetGameMap();
                    SquarePoint Point = DreamPathfinder.GetNextStep(User.X, User.Y, User.GoalX, User.GoalY, map.GameMap, map.ItemHeightMap,
                        map.Model.MapSizeX, map.Model.MapSizeY, User.AllowOverride, map.DiagonalEnabled);

                    if (Point.X == User.X && Point.Y == User.Y) //No path found, or reached goal (:
                    {
                        User.IsWalking = false;
                        User.RemoveStatus("mv");

                        UpdateUserStatus(User, false);
                    }
                    else
                    {
                        int nextX = Point.X;
                        int nextY = Point.Y;
//.........这里部分代码省略.........
开发者ID:habb0,项目名称:PiciEmulator,代码行数:101,代码来源:RoomUserManager.cs

示例15: SerializeWall

        //internal void Serialize(ServerMessage Message)
        //{
        //    Message.Append(Id);
        //    Message.Append(0);
        //    if (mBaseItem == null)
        //        Logging.LogException("Unknown base: " + BaseItem);
        //    Message.Append(mBaseItem.Type.ToString().ToUpper());
        //    Message.Append(Id);
        //    Message.Append(mBaseItem.SpriteId);
        //    if (mBaseItem.Name.Contains("a2"))
        //        Message.Append(3);
        //    else if (mBaseItem.Name.Contains("wallpaper"))
        //        Message.Append(2);
        //    else if (mBaseItem.Name.Contains("landscape"))
        //        Message.Append(4);
        //    else
        //        Message.Append(0);
        //    Message.Append(ExtraData);
        //    Message.Append(mBaseItem.AllowRecycle);
        //    Message.Append(mBaseItem.AllowTrade);
        //    Message.Append(mBaseItem.AllowInventoryStack);
        //    Message.Append(Marketplace.CanSellItem(this));
        //    Message.Append(-1);
        //    if (mBaseItem.Type == 's')
        //    {
        //        Message.Append("");
        //        Message.Append(-1);
        //    }
        //}
        internal void SerializeWall(ServerMessage Message, Boolean Inventory)
        {
            Message.AppendUInt(Id);
            Message.AppendStringWithBreak(mBaseItem.Type.ToString().ToUpper());
            Message.AppendUInt(Id);
            Message.AppendInt32(GetBaseItem().SpriteId);

            if (GetBaseItem().Name.Contains("a2"))
            {
                Message.AppendInt32(3);
            }
            else if (GetBaseItem().Name.Contains("wallpaper"))
            {
                Message.AppendInt32(2);
            }
            else if (GetBaseItem().Name.Contains("landscape"))
            {
                Message.AppendInt32(4);
            }
            else
            {
                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);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:60,代码来源:UserItem.cs


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