本文整理匯總了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 );
}
}