summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-16 18:59:36 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-16 18:59:36 -0300
commitb7d3dc7914aeb50b8beeee40fa9231edce198840 (patch)
tree3272c35547840ef743ff9a39dacb683891c9d2af
parent76ddabf046d50f8010ea41be1bd4d1e0ec75b289 (diff)
downloadclient-b7d3dc7914aeb50b8beeee40fa9231edce198840.tar.gz
client-b7d3dc7914aeb50b8beeee40fa9231edce198840.tar.bz2
client-b7d3dc7914aeb50b8beeee40fa9231edce198840.tar.xz
client-b7d3dc7914aeb50b8beeee40fa9231edce198840.zip
Remove deprecated Pinger function
-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()