From 86af710bbb6ebfc4360f4c767eb4c94028739ba3 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 18 Dec 2020 15:13:42 -0300 Subject: Actually, why not - run the game updater before the socket connection is even established. Updater is the slowest part of startup. --- game/script.rpy | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'game') diff --git a/game/script.rpy b/game/script.rpy index c479932..63c7071 100644 --- a/game/script.rpy +++ b/game/script.rpy @@ -32,27 +32,24 @@ label start: # Initial configuration call prestart - #"We shall now begin testing a websocket" + # Run updater + $ renpy.invoke_in_thread(GAME_UPDATER) + + # Estabilish the connection to server python: try: - # server, sock, address - # on_open=None, on_message=None, on_error=None, - # on_close=None, on_ping=None, on_pong=None, - # on_data=None): renpy.invoke_in_thread(supervisor, persistent.ssl_enabled) except: # Enter in infinite loop, this will never resolve stdout("Unrecoverable error, the program is dead.") tr_load=False + # Block the main thread until the socket connection is done while not tr_load: sdelay() $ stdout("Connection established!") - # Run updater - $ renpy.invoke_in_thread(GAME_UPDATER) - # Open game scene bg town with Dissolve(0.3) pause 0.1 -- cgit v1.2.3-70-g09d2