summaryrefslogtreecommitdiff
path: root/game/script.rpy
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-18 15:13:42 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-18 15:13:42 -0300
commit86af710bbb6ebfc4360f4c767eb4c94028739ba3 (patch)
treea5ef24cbc104903093ef0e37857b789958c3dcfe /game/script.rpy
parent736ba7a21e98debafd1cce8ff0b22e46562d5c61 (diff)
downloadclient-86af710bbb6ebfc4360f4c767eb4c94028739ba3.tar.gz
client-86af710bbb6ebfc4360f4c767eb4c94028739ba3.tar.bz2
client-86af710bbb6ebfc4360f4c767eb4c94028739ba3.tar.xz
client-86af710bbb6ebfc4360f4c767eb4c94028739ba3.zip
Actually, why not - run the game updater before the socket connection is
even established. Updater is the slowest part of startup.
Diffstat (limited to 'game/script.rpy')
-rw-r--r--game/script.rpy13
1 files changed, 5 insertions, 8 deletions
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