diff options
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() |