diff --git a/JobServer.gd b/JobServer.gd index 41747de..071c016 100644 --- a/JobServer.gd +++ b/JobServer.gd @@ -9,8 +9,13 @@ func InitWebsocket(): while socket.get_ready_state() != WebSocketPeer.STATE_OPEN: socket.poll() - - socket.send_text(str({"register": 1})) + var init_message = { + "register": { + "version": 1, + "auth_key": $"/root/Main".auth_key + } + } + socket.send_text(str(init_message)) print("Connected") while true: await PollWebsocket() diff --git a/Main.gd b/Main.gd index f60a531..ef2b90f 100644 --- a/Main.gd +++ b/Main.gd @@ -5,6 +5,7 @@ var config = ConfigFile.new() var websocket_url var public_path var output_dir +var auth_key var rendering = false signal finished_rendering @@ -14,6 +15,7 @@ func _ready(): websocket_url = config.get_value("core", "websocket_url") public_path = config.get_value("core", "public_path") output_dir = config.get_value("core", "output_dir") + auth_key = config.get_value("core", "auth_key") print("Starting render node") var directory = DirAccess.open(".") diff --git a/example-config.cfg b/example-config.cfg index 6099919..89adc07 100644 --- a/example-config.cfg +++ b/example-config.cfg @@ -1,4 +1,5 @@ [core] +auth_key=ay1234 websocket_url="ws://localhost:6980" public_path="http://localhost:8899/" output_dir="./output"