summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-19 00:31:37 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-19 00:31:37 -0300
commite0a24b62090551fa0f79eaea64ad34a56e3e569f (patch)
tree8ccb8badc21301e63d021993899b65389a47595e
parenta2f84b028b463e2c9337edad08b173c6699fa558 (diff)
downloadclient-e0a24b62090551fa0f79eaea64ad34a56e3e569f.tar.gz
client-e0a24b62090551fa0f79eaea64ad34a56e3e569f.tar.bz2
client-e0a24b62090551fa0f79eaea64ad34a56e3e569f.tar.xz
client-e0a24b62090551fa0f79eaea64ad34a56e3e569f.zip
Add support to HTTP requests.
Python2.7 for Android is... not very good for HTTPS requests, that's all =/
-rw-r--r--game/01_init.rpy7
-rw-r--r--game/03_init.rpy2
2 files changed, 8 insertions, 1 deletions
diff --git a/game/01_init.rpy b/game/01_init.rpy
index 15e8b2a..0a71d63 100644
--- a/game/01_init.rpy
+++ b/game/01_init.rpy
@@ -129,6 +129,13 @@ init -3 python:
time.sleep(delta)
return
+ # IF Then Else (IFTE)
+ def ifte(ifs, then, elses):
+ if (ifs):
+ return then
+ else:
+ return elses
+
# Global classes
# We need to override standard list method. Original by Triptych (stackoverflow)
diff --git a/game/03_init.rpy b/game/03_init.rpy
index 9524dfa..2db95cd 100644
--- a/game/03_init.rpy
+++ b/game/03_init.rpy
@@ -252,7 +252,7 @@ init python:
f=open(get_path(addr), "w")
stdout("Downloading additional file: %s" % img.replace(" ", "_"))
try:
- x=requests.get("https://%s/assets/%s?token=%s" % (HOST, img.replace(" ", "_"), get_token()), verify=False) # , timeout=8.0 → Need to handle sudden death
+ x=requests.get("%s://%s/assets/%s?token=%s" % (ifte(persistent.ssl_enabled, "https", "http"), HOST, img.replace(" ", "_"), get_token()), verify=False) # , timeout=8.0 → Need to handle sudden death
except:
# Oh noes - something went *terribly* wrong
traceback.print_exc()