public void HandleCommand(PendingCommand Command) { try { var matchedCommand = Parser.ParseCommand(Command); if (matchedCommand != null) { Core.ProcessPlayerCommand(matchedCommand.Command, matchedCommand.Matches[0], Command.Actor); } else { Core.SendMessage(Command.Actor, "I do not understand."); } } catch (Exception e) { Core.DiscardPendingMessages(); Core.SendMessage(Command.Actor, e.Message); } }
public void HandleCommand(Client Client, String Command) { try { var matchedCommand = Parser.ParseCommand(Command, Client.Player); if (matchedCommand != null) { matchedCommand.Command.Processor.Perform(matchedCommand.Match, Client.Player); } else { Client.Send("huh?"); } } catch (Exception e) { Mud.ClearPendingMessages(); Client.Send(e.Message); } }