/// <summary> /// 移除服务端命令 /// </summary> /// <param name="command">命令</param> /// <returns>是否存在</returns> public Boolean removeCommand(Command command) { try { foreach (Command c in Console.Commands.Keys) { if (c.Equals(command)) { Console.Commands.Remove(c); } } return true; } catch (ArgumentNullException) { return false; } }
/// <summary> /// 构造服务器接收命令事件 /// </summary> public ServerCommandReciver(Senders.ServerConsole sender, Command command, String[] args) { this.Sender = sender; this.Command = command; this.Args = args; }
/// <summary> /// 添加服务端命令 /// </summary> /// <param name="command">命令</param> /// <param name="annotation">说明</param> /// <returns>是否成功</returns> public Boolean addCommand(ConsolePlugin plugin, Command command) { try { Console.Commands.Add(command, plugin); return true; } catch (ArgumentException) { Console.Out.println(Level.Severe, "命令 [" + command + "] 已存在!"); return false; } }
/// <summary> /// 命令信息 /// </summary> /// <param name="command"></param> /// <param name="args"></param> public ServerExecutedCommandArg(Command command, String[] args) { this.Command = command; this.Args = args; }