diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-16 16:28:16 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-16 16:28:16 -0300 |
commit | 2c9a0e2b6afb2642e548bed3d7143018c3378488 (patch) | |
tree | f07d63746e875ed7795751671d31de8045d7cc9d /game | |
parent | 2b7a89b054a5c95e012ce16d266b979061bc4659 (diff) | |
download | client-2c9a0e2b6afb2642e548bed3d7143018c3378488.tar.gz client-2c9a0e2b6afb2642e548bed3d7143018c3378488.tar.bz2 client-2c9a0e2b6afb2642e548bed3d7143018c3378488.tar.xz client-2c9a0e2b6afb2642e548bed3d7143018c3378488.zip |
Try to improve error handling for when socket dies, but...
...Right now, you need to issue a -9 to the program if that happen o.o
Diffstat (limited to 'game')
-rw-r--r-- | game/script.rpy | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/game/script.rpy b/game/script.rpy index 456f4f8..7638ac8 100644 --- a/game/script.rpy +++ b/game/script.rpy @@ -61,7 +61,14 @@ init python: stdout("ERROR RECEIVED") stdout("More details: %s" % repr(err)) stdout("An error happened: %s" % str(err)) - renpy.full_restart() # maybe renpy.quit(relaunch=True) ? + # FIXME: If such error happen, the game never dies + # This is a huge problem o.o + while True: + renpy.call_screen("msgbox", + "An unrecoverable error happened.\nPress OK to return to main menu screen.") + # FIXME: Not working, and the loop also does not work + #renpy.quit(relaunch=True, status=1) + sdelay(1.0) # Inform you are now ingame label start: @@ -95,6 +102,7 @@ label start: ws = None if ws is None: + try: # server, sock, address # on_open=None, on_message=None, on_error=None, # on_close=None, on_ping=None, on_pong=None, @@ -113,6 +121,10 @@ label start: on_message=onmsg) ws.on_open = onopen renpy.invoke_in_thread(ws.run_forever) + except: + # Enter in infinite loop, this will never resolve + tr_load=False + stdout("Unrecoverable error, the program is dead.") while not tr_load: sdelay() |