本文整理汇总了C#中Server.Commands.Generic.BaseCommand.Flush方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCommand.Flush方法的具体用法?C# BaseCommand.Flush怎么用?C# BaseCommand.Flush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Commands.Generic.BaseCommand
的用法示例。
在下文中一共展示了BaseCommand.Flush方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunCommand
public void RunCommand( Mobile from, object obj, BaseCommand command, string[] args )
{
// try
// {
CommandEventArgs e = new CommandEventArgs( from, command.Commands[0], GenerateArgString( args ), args );
if ( !command.ValidateArgs( this, e ) )
return;
bool flushToLog = false;
if ( obj is ArrayList )
{
ArrayList list = (ArrayList)obj;
if ( list.Count > 20 )
CommandLogging.Enabled = false;
else if ( list.Count == 0 )
command.LogFailure( "Nothing was found to use this command on." );
command.ExecuteList( e, list );
if ( list.Count > 20 )
{
flushToLog = true;
CommandLogging.Enabled = true;
}
}
else if ( obj != null )
{
if ( command.ListOptimized )
{
ArrayList list = new ArrayList();
list.Add( obj );
command.ExecuteList( e, list );
}
else
{
command.Execute( e, obj );
}
}
command.Flush( from, flushToLog );
// }
// catch ( Exception ex )
// {
// from.SendMessage( ex.Message );
// }
}
示例2: RunCommand
public void RunCommand( Mobile from, object obj, BaseCommand command, string[] args )
{
try
{
if (command is GetCommand && obj is ArrayList && ((ArrayList)obj).Count > 20000)
{
throw new Exception("Get command has too many potential target: " + ((ArrayList)obj).Count);
}
if (LoggingCustom.CommandDebug) LoggingCustom.LogCommandDebug( "RunCommand\t" + command.Commands[0] + "\t");
CommandEventArgs e = new CommandEventArgs( from, command.Commands[0], GenerateArgString( args ), args );
if ( !command.ValidateArgs( this, e ) )
return;
bool flushToLog = false;
if ( obj is ArrayList )
{
if (LoggingCustom.CommandDebug) LoggingCustom.LogCommandDebug( "objArrayList\t");
ArrayList list = (ArrayList)obj;
if ( list.Count > 20 )
CommandLogging.Enabled = false;
else if ( list.Count == 0 )
command.LogFailure( "Nothing was found to use this command on." );
command.ExecuteList( e, list );
if ( list.Count > 20 )
{
flushToLog = true;
CommandLogging.Enabled = true;
}
}
else if ( obj != null )
{
if (LoggingCustom.CommandDebug) LoggingCustom.LogCommandDebug( "obj\t");
if ( command.ListOptimized )
{
ArrayList list = new ArrayList();
list.Add( obj );
command.ExecuteList( e, list );
}
else
{
command.Execute( e, obj );
}
}
if (LoggingCustom.CommandDebug) LoggingCustom.LogCommandDebug( "flush\t");
command.Flush( from, flushToLog );
}
catch ( Exception ex )
{
if (from != null) from.SendMessage( ex.Message );
}
}