Skip to content

Commit

Permalink
Fix URL location variable setting to happen late enough that it actua…
Browse files Browse the repository at this point in the history
…lly gets used.
  • Loading branch information
chrisl8 committed Dec 17, 2023
1 parent cef28a0 commit a890293
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions startup.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ var _instance_socket: TCPServer


func _init() -> void:
if OS.is_debug_build() and run_server_in_debug:
Globals.url = debug_server_url
else:
Globals.url = production_server_url
if OS.is_debug_build():
# Check if this is the first instance of a debug run, so only one attempts to be the server
# It also provides us with a unique "instance number" for each debug instance of the game run by the editor
Expand Down Expand Up @@ -112,6 +108,11 @@ func _ready() -> void:
# https://docs.godotengine.org/en/stable/tutorials/inputs/handling_quit_requests.html
get_tree().set_auto_accept_quit(false)

if OS.is_debug_build() and run_server_in_debug:
Globals.url = debug_server_url
else:
Globals.url = production_server_url

Network.reset.connect(connection_reset)
Network.close_popup.connect(force_close_popup)
if (
Expand Down

0 comments on commit a890293

Please sign in to comment.