summaryrefslogtreecommitdiff
path: root/game/client.rpy
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-06-06 14:35:03 -0300
committerJesusaves <cpntb1@ymail.com>2021-06-06 14:35:03 -0300
commit19484f5a4e84f402f96d15233a09ec5e73444ee8 (patch)
tree8ccfa9f3c8ad6440cc88b0d88dc2af99859c412f /game/client.rpy
parentf2a1dcee69af446cd34815e80daed06a29c2ee27 (diff)
downloadrenpy-19484f5a4e84f402f96d15233a09ec5e73444ee8.tar.gz
renpy-19484f5a4e84f402f96d15233a09ec5e73444ee8.tar.bz2
renpy-19484f5a4e84f402f96d15233a09ec5e73444ee8.tar.xz
renpy-19484f5a4e84f402f96d15233a09ec5e73444ee8.zip
Mirror Lake Seamless Transition (already with -S flag!)
Diffstat (limited to 'game/client.rpy')
-rw-r--r--game/client.rpy41
1 files changed, 34 insertions, 7 deletions
diff --git a/game/client.rpy b/game/client.rpy
index e01d0b3..1d3d680 100644
--- a/game/client.rpy
+++ b/game/client.rpy
@@ -22,7 +22,7 @@ init 2 python:
return f
def launch_game(idx):
- global progress, responsive, statusmsg
+ global progress, responsive, statusmsg, MLP_DEST
########################################################################
## Setup
RPCUpdate(persistent.serverlist[idx]["Name"], persistent.serverlist[idx]["Back"])
@@ -84,11 +84,11 @@ init 2 python:
renpy.iconify()
## Sanitize input to avoid arbitrary code execution
- CMD=CMD.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "")
- OPT=OPT.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "")
- PWD=PWD.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "")
+ CMD=CMD.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "").replace("$", "")
+ OPT=OPT.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "").replace("$", "")
+ PWD=PWD.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "").replace("$", "")
- ## Launch your prefered game client, wait for it to finish
+ ## Launch your preferred game client, wait for it to finish
if renpy.windows:
app=execute("\"%s\" %s%s" % (CMD, OPT, PWD), shell=True)
else:
@@ -96,11 +96,38 @@ init 2 python:
## Determine error messages
if app == 7:
- stdout("[CLIENT] Mirror Lake trigger.")
+ stdout("[CLIENT] Mirror Lake triggered.")
## Give "plenty" time to ensure data will be available
statusmsg=_("Synchronizing data...")
time.sleep(0.5)
-
+ try:
+ r=vault.post(VAULT_HOST+"/getlake", json=auth, timeout=15.0)
+ ## We got the access credentials
+ if r.status_code == 200:
+ goto=r.json()["world"]
+ stdout("MLP Target: %s" % str(goto))
+ if goto == "" or goto.lower() == "vault":
+ stdout("Mirror Lake False Positive")
+ else:
+ MLP_DEST=goto
+ progress=100
+ return
+ ## We were refused by Vault
+ elif r.status_code == 403:
+ stdout("Warning: Connection was refused (Vault logout?)")
+ statusmsg=_("You're not logged in.")
+ time.sleep(1.0)
+ responsive = False
+ return
+ else:
+ stdout("[CLIENT] Sync error code %d." % r.status_code)
+ statusmsg=_("Synchronization error.") # 500 = No Lake
+ time.sleep(1.0)
+ except:
+ traceback.print_exc()
+ stdout("[CLIENT] Sync failed.")
+ statusmsg=_("Synchronization error.")
+ time.sleep(1.0)
elif app:
traceback.print_exc()
stdout("[CLIENT] An error happened: %d" % app)