From 95b71c79d44c3e0718a726e550715b7dbc699e7e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 16 Dec 2020 20:31:13 -0300 Subject: Do not declare ws at init phase --- game/03_init.rpy | 2 -- game/script.rpy | 17 ++--------------- 2 files changed, 2 insertions(+), 17 deletions(-) (limited to 'game') diff --git a/game/03_init.rpy b/game/03_init.rpy index 1125462..66b05a3 100644 --- a/game/03_init.rpy +++ b/game/03_init.rpy @@ -309,5 +309,3 @@ init python: MUSIC_PROLOGUE02=RetString("sfx/prologue.mp3") MUSIC_PROLOGUE03=RetString("sfx/shining.mp3") - ws = None - diff --git a/game/script.rpy b/game/script.rpy index b224474..dd3ee56 100644 --- a/game/script.rpy +++ b/game/script.rpy @@ -34,20 +34,7 @@ label start: #"We shall now begin testing a websocket" python: - # FIXME: Broken code - if (ws is not None): - stdout("Socket exists, trying to reuse connection...") - try: - boom = send_packet_now("ping") - if not boom: - del boom - raise - del boom - except: - ws = None - - if ws is None: - try: + try: # server, sock, address # on_open=None, on_message=None, on_error=None, # on_close=None, on_ping=None, on_pong=None, @@ -66,7 +53,7 @@ label start: on_message=onmsg) ws.on_open = onopen renpy.invoke_in_thread(ws.run_forever) - except: + except: # Enter in infinite loop, this will never resolve stdout("Unrecoverable error, the program is dead.") tr_load=False -- cgit v1.2.3-60-g2f50