diff options
Diffstat (limited to 'game/04_init.rpy')
-rw-r--r-- | game/04_init.rpy | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/game/04_init.rpy b/game/04_init.rpy index 85e153b..6724720 100644 --- a/game/04_init.rpy +++ b/game/04_init.rpy @@ -103,19 +103,23 @@ init python: global ws, tr_load, tr_val, tr_busy, TERMINATE, CLOSING stdout("Sending: %s" % packet) - try: - ws.send(get_token() + ";" + packet + ";" + args) - except: - traceback.print_exc() - stdout("FATAL ERROR, packet was not sent!") + cnt = 0 + while cnt < MAX_RETRIES: + cnt+=1 try: - renpy.call_screen("msgbox", - "An unrecoverable error happened.\nPlease close and re-open the app.") + ws.send(get_token() + ";" + packet + ";" + args) + break # Success attained, continue except: - pass - TERMINATE=True - if not CLOSING: - renpy.quit(relaunch=True) + traceback.print_exc() + stdout("FATAL ERROR, packet was not sent!") + try: + renpy.call_screen("msgbox", + "An unrecoverable error happened.\nPlease close and re-open the app.") + except: + pass + TERMINATE=True + if not CLOSING: + renpy.quit(relaunch=True) return |