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


C# ServerMessage.Clear方法代码示例

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


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

示例1: SerializeNewStaffPicks

        internal ServerMessage SerializeNewStaffPicks()
        {
            ServerMessage message = new ServerMessage();
            message.StartArray();
            foreach (PublicItem item in _publicItems.Values.Where(t => t.ParentId == -2))
            {
                message.Clear();
                if (item.RoomData == null) continue;

                item.RoomData.Serialize(message, false);
                message.SaveArray();
            }

            message.EndArray();
            return message;
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:16,代码来源:Navigator.cs

示例2: SerializeSongInventory

        /// <summary>
        /// Serializes the song inventory.
        /// </summary>
        /// <param name="songs">The songs.</param>
        /// <returns>ServerMessage.</returns>
        internal static ServerMessage SerializeSongInventory(HybridDictionary songs)
        {
            var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("SongsLibraryMessageComposer"));

            if (songs == null)
            {
                serverMessage.AppendInteger(0);

                return serverMessage;
            }

            serverMessage.StartArray();

            foreach (UserItem userItem in songs.Values)
            {
                if (userItem == null)
                {
                    serverMessage.Clear();
                    continue;
                }

                serverMessage.AppendInteger(userItem.Id);

                var song = SoundMachineSongManager.GetSong(userItem.SongCode);
                serverMessage.AppendInteger(song?.Id ?? 0);

                serverMessage.SaveArray();
            }

            serverMessage.EndArray();
            return serverMessage;
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:37,代码来源:SoundMachineComposer.cs

示例3: SerializeFlatCategories

        /// <summary>
        /// Serializes the flat categories.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <returns>ServerMessage.</returns>
        internal ServerMessage SerializeFlatCategories(GameClient session)
        {
            ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("FlatCategoriesMessageComposer"));
            serverMessage.StartArray();
            foreach (FlatCat flatCat in PrivateCategories.Values)
            {
                serverMessage.Clear();
                if (flatCat == null) continue;

                serverMessage.AppendInteger(flatCat.Id);
                serverMessage.AppendString(flatCat.Caption);
                serverMessage.AppendBool(flatCat.MinRank <= session.GetHabbo().Rank);
                serverMessage.AppendBool(false);
                serverMessage.AppendString("NONE");
                serverMessage.AppendString(string.Empty);
                serverMessage.AppendBool(false);

                serverMessage.SaveArray();
            }

            serverMessage.EndArray();
            return serverMessage;
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:28,代码来源:Navigator.cs


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