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


C# BinaryFileWriter.WriteMobileList方法代码示例

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


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

示例1: Serialize

		public virtual void Serialize( BinaryFileWriter writer )
		{
			writer.Write( (int)0 );

			//version 0
			writer.WriteMobileList<Mobile>( _buddyList, true );
			writer.Write( _client );
			writer.WriteMobileList<Mobile>( _ignoreList, true );
			writer.Write( _visible );
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:10,代码来源:ChatInfo.cs

示例2: EventSink_WorldSave

        private static void EventSink_WorldSave( WorldSaveEventArgs e )
        {
            DateTime start = DateTime.Now;
            Console.WriteLine( "processing additional components." );
            Console.WriteLine( "Forums: Saving..." );

            if( AutoCleanup )
                Console.Write( "Auto Cleanup is checking posts..." );
            else
                Console.Write( "Checking deletion queue..." );

            int queue = 0;
            int deleted = RemovedDeletedQueue(out queue);

            if( queue == 0 )
                Console.Write( "Empty Queue..." );
            else
                Console.Write( "{1} Queued...{0} Deleted...", deleted, queue );
            
            string SavePath = Path.Combine( m_SavePath, "forumdata.sig" );

            if( !Directory.Exists( m_SavePath ) )
                Directory.CreateDirectory( m_SavePath );

            GenericWriter bin = new BinaryFileWriter( SavePath, true );
            
            try
            {
                bin.Write( ( int )0 );//Versioning

                WritePlayerStatistics( bin );
            
                bin.Write( ( int )( m_Threads.Count ) );
                foreach( ThreadEntry te in m_Threads )
                {
                    te.Serialize( bin );
                }

                bin.WriteMobileList( m_Moderators );
                bin.Write( ( int )m_ThreadDeleteAccessLevel );
                bin.Write( ( int )m_ThreadLockAccesLevel );
                bin.Write( ( bool )m_AutoCleanup );
                bin.Write( ( int )m_AutoCleanupDays );
                bin.Write( ( int )m_MinPostCharactersCount );
                bin.Write( ( int )m_MaxPostCharactersCount );
                bin.Close();
                
                DateTime end = DateTime.Now;
                Console.WriteLine( "done in {0:F1} seconds.", ( end - start ).TotalSeconds );
                Console.Write( "World: " );
            }
            catch( Exception err )
            {
                bin.Close();

                Console.Write( "An error occurred while trying to save the forums. {0}", err.ToString());
            }
        }        
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:58,代码来源:ForumCore.cs


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