summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--game/defs.rpy4
-rw-r--r--game/player.rpy19
-rw-r--r--game/script.rpy9
3 files changed, 5 insertions, 27 deletions
diff --git a/game/defs.rpy b/game/defs.rpy
index 543cbe9..54b94fc 100644
--- a/game/defs.rpy
+++ b/game/defs.rpy
@@ -124,7 +124,7 @@ init -3 python:
# Smart wait
def sdelay(delta=0.02):
try:
- renpy.pause(delta)
+ renpy.pause(delta, hard=True)
except:
time.sleep(delta)
return
@@ -440,6 +440,8 @@ init -1 python:
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
diff --git a/game/player.rpy b/game/player.rpy
index 0f7d9ff..1d74189 100644
--- a/game/player.rpy
+++ b/game/player.rpy
@@ -125,25 +125,8 @@ init python:
return True
# Ping function, it keeps the connection alive.
+ # DEPRECATED
def ping_routine():
- global Pinger, OFFLINEMSG
-
- pinged=send_packet_now("ping", legacy=True)
-
- # Something went wrong
- if pinged != "pong":
- stdout("ERROR, Unexpected reply: %s (expected: pong)" % pinged)
- # Connection is already dead; Why bothering
- if pinged == OFFLINEMSG:
- return
- # TODO: Terminate connection on our end?
- timetowait=60.0
- else:
- timetowait=300.0
-
- Pinger=Timer(float(timetowait), ping_routine)
- Pinger.daemon=True
- Pinger.start()
return
# Techinically a battle function, readjusts a value
diff --git a/game/script.rpy b/game/script.rpy
index 50e4bad..6009b2d 100644
--- a/game/script.rpy
+++ b/game/script.rpy
@@ -55,7 +55,7 @@ init python:
tr_load=True
tr_val=""
tr_busy=False
- self.send("Ping")
+ self.send("PING")
def onerror(self, err):
stdout("ERROR RECEIVED")
@@ -400,13 +400,6 @@ label prologue:
label quit:
$ stdout("Received quit signal!")
python:
- # Delete pinger
- try:
- Pinger.stop()
- del Pinger
- except:
- pass
-
# Delete ApTimer
try:
ApTimer.cancel()