From 0ccafaccddcabb32eaa5bf2a8d46ea73f161302e Mon Sep 17 00:00:00 2001 From: Jakob Friedl <71284620+jakobfriedl@users.noreply.github.com> Date: Thu, 21 Aug 2025 17:08:46 +0200 Subject: [PATCH] Cleaned up utils.nim by removing unnecessary functions. --- src/server/core/agent.nim | 5 +++-- src/server/core/server.nim | 2 +- src/server/utils.nim | 6 ------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/server/core/agent.nim b/src/server/core/agent.nim index b7d8588..6990046 100644 --- a/src/server/core/agent.nim +++ b/src/server/core/agent.nim @@ -123,7 +123,8 @@ proc agentInteract*(cq: Conquest, name: string) = while command.replace(" ", "") != "back": command = cq.prompt.readLine() - cq.withOutput(handleAgentCommand, command) - + cq.handleAgentCommand(command) + + # Reset interactAgent field after interaction with agent is ended using 'back' command cq.interactAgent = nil diff --git a/src/server/core/server.nim b/src/server/core/server.nim index 716582c..b98881a 100644 --- a/src/server/core/server.nim +++ b/src/server/core/server.nim @@ -172,4 +172,4 @@ proc startServer*(profilePath: string) = cq.prompt.showPrompt() var command: string = cq.prompt.readLine() - cq.withOutput(handleConsoleCommand, command) + cq.handleConsoleCommand(command) diff --git a/src/server/utils.nim b/src/server/utils.nim index 7a35ced..18ebe5a 100644 --- a/src/server/utils.nim +++ b/src/server/utils.nim @@ -11,12 +11,6 @@ proc validatePort*(portStr: string): bool = except ValueError: return false -# Overwrite withOutput function to handle function arguments -proc withOutput*(cq: Conquest, outputFunction: proc(cq: Conquest, args: string), args: string) = - cq.prompt.hidePrompt() - outputFunction(cq, args) - cq.prompt.showPrompt() - # Table border characters type Cell = object