diff options
-rw-r--r-- | game/04_init.rpy | 12 | ||||
-rw-r--r-- | game/misc.rpy | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/game/04_init.rpy b/game/04_init.rpy index edb5e16..03ca68f 100644 --- a/game/04_init.rpy +++ b/game/04_init.rpy @@ -21,15 +21,20 @@ init python: # FIXME: Drop dead if session_id mismatches (new "token") # Same as ondata? + # FIXME: onmsg() runs within the thread, not the main app + # This means def onmsg(self, message): global tr_load, tr_val, tr_busy stdout("Server : " + str(message)) # Wait wait, it might have been a SERVNOTICE! try: - if (message.split(':')[0] == "NOTICE"): + if (message.split(':')[0] == "NOTICE"): + # FIXME + raise NotImplemented("You cannot call screens from threads!") renpy.call_screen("msgbox", - "{b}SERVER NOTICE{b}\n\n%s" % str(":".join(command.split(':')[1:]))) + #renpy.call_in_new_context("msgbox_label", + "{b}SERVER NOTICE{b}\n\n%s" % str(":".join(message.split(':')[1:]))) return except: stdout("Error displaying SERVNOTICE") @@ -70,6 +75,7 @@ init python: stdout("An error happened: %s" % str(err)) # FIXME: If such error happen, the game never dies # This is a huge problem o.o + # Now it might die suddenly... In case it is already exiting... try: renpy.call_screen("msgbox", "An unrecoverable error happened.\nPlease close and re-open the app.") @@ -83,7 +89,7 @@ init python: # FIXME: renpy.quit() throws an exception - which in a thread is obviously not gonna work... #renpy.quit(relaunch=True, status=1) except: - sdelay(20.0) + pass return 1 class GameClient(WebSocketClient): diff --git a/game/misc.rpy b/game/misc.rpy index 8b9fe6f..ec504da 100644 --- a/game/misc.rpy +++ b/game/misc.rpy @@ -167,6 +167,10 @@ init python: # Weekly event switcher (Raids, etc. → events.py) """ +label msgbox_label(msgcode): + call screen msgbox(msgcode) + return + label clear_all: python: rl=False |