/// <summary> /// Handle the entered command /// </summary> public void Handle(string[] fullCommand) { if (fullCommand.Length < 2) { return; } var moduleName = fullCommand[1]; var module = CommandHelper.GetByName(ModuleManager, moduleName); if (module == null) { return; } var console = module.Console; if (console == null) { return; } switch (fullCommand[0]) { case "enter": ModuleSpecificConsole(module); break; default: ModuleCommandExecutor(fullCommand, module); break; } }
/// <summary> /// Handle the entered command /// </summary> public void Handle(string[] fullCommand) { if (fullCommand.Length < 2) { Console.WriteLine("Service name must be specified!"); return; } if (fullCommand[0] == "reinc") { // Reincarnate of specific service var module = CommandHelper.GetByName(ModuleManager, fullCommand[1]); if (module != null) { ModuleManager.ReincarnateModule(module); } } if (fullCommand[0] == "conf") { // Confirm possible errors var module = CommandHelper.GetByName(ModuleManager, fullCommand[1]); foreach (var notification in module.Notifications.ToArray()) { notification.Confirm(); } // Invoke init - this will get failed modules back to ready ModuleManager.InitializeModule(module); } }
/// <summary> /// Handle the entered command /// </summary> public void Handle(string[] fullCommand) { if (fullCommand.Length == 1 || fullCommand[1] == "all") { ModuleManager.StartModules(); } else { // Start of specific service var module = CommandHelper.GetByName(ModuleManager, fullCommand[1]); if (module != null) { ModuleManager.StartModule(module); } } }
/// <summary> /// Handle the entered command /// </summary> public void Handle(string[] fullCommand) { if (fullCommand.Length == 1 || fullCommand[1] == "all") { foreach (var module in ModuleManager.AllModules) { PrintServerModule(module, null); } } else if (fullCommand.Length >= 2) { var module = CommandHelper.GetByName(ModuleManager, fullCommand[1]); if (module != null) { PrintServerModule(module, fullCommand.Skip(2)); } } else { Console.WriteLine("Invalid syntax for \"print\" command!"); } }