/// <summary> /// Handles a console command. /// </summary> /// <param name="sender">The sending object.</param> /// <param name="e">The event data.</param> public void CommandInputHandle(object sender, ConsoleCommandEventArgs e) { Schedule.ScheduleSyncTask(() => { Commands.ExecuteCommands(e.Command); }); }
internal void InvokeConsoleCommandEvent(Player player, string command) { var ev = new ConsoleCommandEventArgs { Command = command, Player = player }; ConsoleCommandEvent?.Invoke(ev); }
private void OnCommandEntered(ConsoleCommandEventArgs eventArgs) { var handler = CommandEntered; try { if (handler != null) handler(this, eventArgs); } catch (Exception exception) { // We catch all exceptions and print them. WriteLine(exception.Message); } // At last call default interpreter. Interpreter.Interpret(eventArgs); }
void HandleConsoleCommand(ConsoleCommandEventArgs args) { //var id = args.Id; //if (args.Id == GetType().Name) HandleInput(args.Command); }