From 25215ea41a8153613e2720d66b99a02ecc66b05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Gro=C3=9F?= Date: Fri, 16 Jun 2023 11:16:29 +0200 Subject: [PATCH] Make paths absolute to fix permissions issues on Android --- JobServer.gd | 2 +- Main.gd | 5 ++--- example-config.cfg | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/JobServer.gd b/JobServer.gd index 334895f..18ce403 100644 --- a/JobServer.gd +++ b/JobServer.gd @@ -49,7 +49,7 @@ func PollWebsocket(): print("trying to open " + result_path) var resut_file = FileAccess.open(result_path,FileAccess.READ) result_value = "{path}:{data}".format({ - "path":result_path, + "path": result_path.get_file(), "data": Marshalls.raw_to_base64(resut_file.get_buffer(resut_file.get_length())) }) var debugFile = FileAccess.open("user://debug.log", FileAccess.WRITE) diff --git a/Main.gd b/Main.gd index 429d984..530fdb1 100644 --- a/Main.gd +++ b/Main.gd @@ -23,9 +23,8 @@ func _ready(): print("Starting render node") - var directory = DirAccess.open(".") - directory.make_dir(output_dir) - directory.make_dir(cache_dir) + DirAccess.make_dir_absolute(output_dir) + DirAccess.make_dir_absolute(cache_dir) $JobServer.InitWebsocket() func FinishedRendering(): diff --git a/example-config.cfg b/example-config.cfg index 43340b8..7287147 100644 --- a/example-config.cfg +++ b/example-config.cfg @@ -2,6 +2,6 @@ auth_key=ay1234 websocket_url="ws://localhost:6980" public_path="http://localhost:8899/" -output_dir="./output" -cache_dir="./cache" +output_dir="user://output" +cache_dir="user://cache" serve_mode="local"