diff options
author | metamuffin <metamuffin@disroot.org> | 2025-07-07 19:42:57 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-07-07 19:42:57 +0200 |
commit | c5e2de764bb1ce1d38726b80636c3fa45b06c05e (patch) | |
tree | 7606abe3b47d123abb9cafe9c1bb7920aa3d3c7f /client/service/service.gd | |
parent | 9be9937f75c2711d5d7fd9759ed615397fff5c7f (diff) | |
download | hurrycurry-c5e2de764bb1ce1d38726b80636c3fa45b06c05e.tar hurrycurry-c5e2de764bb1ce1d38726b80636c3fa45b06c05e.tar.bz2 hurrycurry-c5e2de764bb1ce1d38726b80636c3fa45b06c05e.tar.zst |
implement discover tool as service.gd class
Diffstat (limited to 'client/service/service.gd')
-rw-r--r-- | client/service/service.gd | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/client/service/service.gd b/client/service/service.gd index f19364c7..9695714f 100644 --- a/client/service/service.gd +++ b/client/service/service.gd @@ -56,6 +56,7 @@ func start(): if state != State.STOPPED and state != State.FAILED: push_error(name() + " can't be started") return + print(name() + ": Starting...") state = State.STARTING thread = Thread.new() thread.start(_server_exec) @@ -64,13 +65,14 @@ func stop(): if state != State.RUNNING: push_error(name() + " can't be stopped") return + print(name() + ": Stopping...") OS.kill(pid) func _test_server(): var output = [] - print(name() + ": Binary path is " + exe_path()) + print(name() + ": Testing executable " + exe_path()) thread_result = OS.execute(exe_path(), ["-v"], output, true, false) - print(output) + print(name() + ": Version = " + output[0].strip_edges()) sem.post() func _server_exec(): @@ -118,5 +120,5 @@ func _process(_delta): pid = null func _exit_tree(): - if pid != null: OS.kill(pid) + if state == State.RUNNING: stop() if thread != null: thread.wait_to_finish() |