summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-18 22:15:00 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-18 22:15:00 -0300
commit2204b167074126540fd3955d08f6aee92a2256f2 (patch)
tree811aad270c53acbb0a4f1a5ed77814058e372610 /game
parentf4e235584e71309b411cd13880fee8897b6eb7f4 (diff)
downloadclient-2204b167074126540fd3955d08f6aee92a2256f2.tar.gz
client-2204b167074126540fd3955d08f6aee92a2256f2.tar.bz2
client-2204b167074126540fd3955d08f6aee92a2256f2.tar.xz
client-2204b167074126540fd3955d08f6aee92a2256f2.zip
Smoother error handling
Diffstat (limited to 'game')
-rw-r--r--game/01_init.rpy1
-rw-r--r--game/03_init.rpy9
2 files changed, 8 insertions, 2 deletions
diff --git a/game/01_init.rpy b/game/01_init.rpy
index 9d45917..15e8b2a 100644
--- a/game/01_init.rpy
+++ b/game/01_init.rpy
@@ -54,7 +54,6 @@ init -3 python:
allfiles=[]
HOST=str(persistent.host)
PORT=str(persistent.port)
- UPDP=10302
FAILUREMSG="Request failed, Please try again"
OFFLINEMSG="401 Unauthorized"
OKMSG="200 OK"
diff --git a/game/03_init.rpy b/game/03_init.rpy
index f082530..90b4b3b 100644
--- a/game/03_init.rpy
+++ b/game/03_init.rpy
@@ -251,7 +251,14 @@ init python:
f=open(get_path(addr), "w")
stdout("Downloading additional file: %s" % img.replace(" ", "_"))
- x=requests.get("http://%s:%d/%s?token=%s" % (HOST, UPDP, img.replace(" ", "_"), get_token())) # , timeout=8.0 → Need to handle sudden death
+ try:
+ x=requests.get("https://%s/%s?token=%s" % (HOST, img.replace(" ", "_"), get_token())) # , timeout=8.0 → Need to handle sudden death
+ except:
+ # Oh noes - something went *terribly* wrong
+ traceback.print_exc()
+ x=requests.Response()
+ x.status_code=403
+
if x.status_code == 200:
f.write(x.content)
f.close()