Provides data for CommandManager.CommandCalling event. Cancelable.
Inheritance: CommandCalledEventArgs, ICancelableEvent
コード例 #1
0
ファイル: CommandManager.cs プロジェクト: fragmer/fCraft
 internal static bool RaiseCommandCallingEvent([NotNull] CommandReader cmd, [NotNull] Player player) {
     var h = CommandCalling;
     if (h == null) return false;
     var e = new CommandCallingEventArgs(cmd, player);
     h(null, e);
     return e.Cancel;
 }
コード例 #2
0
ファイル: CommandManager.cs プロジェクト: venofox/AtomicCraft
 internal static bool RaiseCommandCallingEvent( Command cmd, CommandDescriptor descriptor, Player player )
 {
     var h = CommandCalling;
     if ( h == null ) return false;
     var e = new CommandCallingEventArgs( cmd, descriptor, player );
     h( null, e );
     return e.Cancel;
 }
コード例 #3
0
ファイル: Events.cs プロジェクト: Jonty800/Guilds
 private static void CommandCalling( object sender, CommandCallingEventArgs e )
 {
     if ( e.Player.World == null )
         return;
     Command cmd = e.Command;
     if ( cmd == null )
         return;
     if ( Cache.ForbiddenCommands.Contains( cmd.Name.ToLower() ) ) {
         e.Player.Message( "Use of this command is forbidden when running Au70 Guilds" );
         e.Cancel = true;
     }
 }