Client: CommandValidator and initialRequest were added,fixed behaviour if server is unreachable; Server: GetCommandsCommand was added

This commit is contained in:
2026-04-13 21:54:43 +03:00
parent d97bbed00f
commit f088d05731
6 changed files with 128 additions and 92 deletions
+1
View File
@@ -67,6 +67,7 @@ fun registerServerCommands(
AddIfMaxCommand(manager),
AddIfMinCommand(manager),
HistoryCommand(invoker),
GetCommandsCommand(invoker),
SumOfMinutesCommand(manager),
MinByNameCommand(manager),
PrintDescendingMinutesCommand(manager),
@@ -0,0 +1,15 @@
package commands
import models.HumanBeing
import runner.CommandInvoker
class GetCommandsCommand (
private val invoker: CommandInvoker
): Command {
override val name: String = "GetCommands"
override val description: String = "Получает все доступные с сервера команды"
override fun execute(args: List<String>, humanBeing: HumanBeing?): String {
return invoker.getCommands().toString()
}
}