summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-16 21:26:53 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-16 21:26:53 -0300
commitc707470f1e3b5ddfe82ef09d9b79905d09684ebe (patch)
tree870bf76721fab43abd09f58c94d8bb6478511dc7 /game
parent95b71c79d44c3e0718a726e550715b7dbc699e7e (diff)
downloadclient-c707470f1e3b5ddfe82ef09d9b79905d09684ebe.tar.gz
client-c707470f1e3b5ddfe82ef09d9b79905d09684ebe.tar.bz2
client-c707470f1e3b5ddfe82ef09d9b79905d09684ebe.tar.xz
client-c707470f1e3b5ddfe82ef09d9b79905d09684ebe.zip
Move send_packet_now from block 2 to block 4
Diffstat (limited to 'game')
-rw-r--r--game/02_init.rpy15
-rw-r--r--game/04_init.rpy14
2 files changed, 12 insertions, 17 deletions
diff --git a/game/02_init.rpy b/game/02_init.rpy
index 6186e32..fb2749c 100644
--- a/game/02_init.rpy
+++ b/game/02_init.rpy
@@ -121,21 +121,6 @@ init -1 python:
pass
return Player["code"]
- def send_packet_now(packet, args="", legacy=False):
- global tr_load, tr_val, tr_busy
- global ws
-
- stdout("Sending: %s" % packet)
- try:
- ws.send(get_token() + ";" + packet + ";" + args)
- except:
- stdout("Failed to send message!!")
- # FIXME set tr_val/tr_load/tr_busy to good values
- return False
- # TODO: Wait for onmsg
- # TODO: ping packets
- return True
-
def send_packet(packet, args=""):
global tr_load, tr_val, tr_busy
# TODO: if tr_busy already true, wait until it is made false
diff --git a/game/04_init.rpy b/game/04_init.rpy
index b5449f5..2becb6f 100644
--- a/game/04_init.rpy
+++ b/game/04_init.rpy
@@ -62,7 +62,8 @@ init python:
# 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.")
+ "An unrecoverable error happened.\nPlease close and re-open the app.")
+ # "An unrecoverable error happened.\nPress OK to return to main menu screen.")
#raise KeyboardException(str(err))
#raise err
# FIXME: Not working, and the loop also does not work
@@ -70,6 +71,15 @@ init python:
# I wonder if I can/should run this in a non-daemon thread?
# But I sense the problem is not here but a level above
#renpy.quit(relaunch=True, status=1)
- sdelay(1.0)
+ sdelay(20.0)
return 1
+ # Be mindful of where/when using this function
+ # Or "onmsg" may accidentally not be cast =/
+ def send_packet_now(packet, args=""):
+ global ws, tr_load, tr_val, tr_busy
+
+ stdout("Sending: %s" % packet)
+ ws.send(get_token() + ";" + packet + ";" + args)
+ return
+