本文整理汇总了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 );
}
示例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());
}
}