diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-05-08 05:17:08 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-05-08 05:17:08 -0300 |
commit | fd986bd1b312a07898f3dbd217825351a0c6f881 (patch) | |
tree | 5d00295696b825ea6c05bde2302cd608d2a0ff72 /game | |
parent | 70af0220ba9dec5a19677a10ec924efe034314da (diff) | |
download | renpy-fd986bd1b312a07898f3dbd217825351a0c6f881.tar.gz renpy-fd986bd1b312a07898f3dbd217825351a0c6f881.tar.bz2 renpy-fd986bd1b312a07898f3dbd217825351a0c6f881.tar.xz renpy-fd986bd1b312a07898f3dbd217825351a0c6f881.zip |
Bugfixes and retrieve commandline passwords
Diffstat (limited to 'game')
-rw-r--r-- | game/core.rpy | 2 | ||||
-rw-r--r-- | game/discord.rpy | 4 | ||||
-rw-r--r-- | game/renpy.rpy | 34 |
3 files changed, 31 insertions, 9 deletions
diff --git a/game/core.rpy b/game/core.rpy index 86ee150..11cca64 100644 --- a/game/core.rpy +++ b/game/core.rpy @@ -35,7 +35,7 @@ init -3 python: if (persistent.client is None): persistent.client = "manaplus" if (persistent.iconify is None): - persistent.iconify = True + persistent.iconify = False ############################################################################# #, "themanaworld.org", "germantmw.de", "moubootaurlegends.org"] diff --git a/game/discord.rpy b/game/discord.rpy index d8b9c06..6d80063 100644 --- a/game/discord.rpy +++ b/game/discord.rpy @@ -20,7 +20,7 @@ init -2 python: errno, errmsg )) - def RPCUpdate(title, subtitle, image): + def RPCUpdate(title, image): if not persistent.discord: stdout("Discord RPC disabled, update skipped") return @@ -29,11 +29,11 @@ init -2 python: discord_rpc.update_presence( **{ 'details': title, - 'state': subtitle, 'start_timestamp': float(now()), 'large_image_key': image } ) + # 'state': subtitle, discord_rpc.update_connection() discord_rpc.run_callbacks() diff --git a/game/renpy.rpy b/game/renpy.rpy index dcfaf92..d147257 100644 --- a/game/renpy.rpy +++ b/game/renpy.rpy @@ -62,12 +62,11 @@ label start: scene black show TMW2 at truecenter with Dissolve(0.5) - pause 1.5 + pause 1.0 hide TMW2 with dissolve #centered "Error" - $ RPCUpdate("Moubootaur Legends", "Main Menu", "tmw2") - if config.developer: - "User ID: [vaultId]" + #if config.developer: + # "User ID: [vaultId]" while True: $ renpy.block_rollback() call screen mirrorlake @@ -80,20 +79,43 @@ label start: scene black show TMW2 at truecenter with None + pause 0.01 python: + # TODO: use the proper discord RPC image + RPCUpdate(persistent.serverlist[_return]["Name"], "tmw2") HOST=persistent.serverlist[_return]["Host"] PORT=persistent.serverlist[_return]["Port"] CMD=handle_client(launch=True) OPT="-s %s -y evol2 -p %s" % (HOST, PORT) - # TODO: Obtain access token from Vault stdout("%s %s" % (CMD, OPT)) + + ## Obtain access token from vault + ## TODO: Only skip failure if not dev + auth = {"vaultId": vaultId, + "token": vaultToken, + "world": persistent.serverlist[_return]["UUID"]} + r=requests.post(VAULT_HOST+"/world_pass", json=auth, timeout=15.0) + if r.status_code != 200: + stdout("Get World Auth - Returned error code %d" % r.status_code) + PWD="" + else: + auth2=r.json() + PWD=" -U %s -P %s" % (auth2["user"], auth2["pass"]) + + ## Minimize to tray if set if not renpy.mobile and persistent.iconify: renpy.iconify() - execute("%s %s" % (CMD, OPT), shell=True) + + ## Launch your prefered game client, wait for it to finish + execute("%s %s%s" % (CMD, OPT, PWD), shell=True) + # NOTE: Now we would like to un-minimize ourselves # But we cannot =/ # There's a few tricks but not very nice... # https://stackoverflow.com/questions/45426203/minimize-window-with-python (Linux) # https://stackoverflow.com/questions/2791489/how-do-i-take-out-the-focus-or-minimize-a-window-with-python/2792059 (Windows) + + # Clean discord RPC and go back to main menu + RPCUpdate("Main Menu", "tmw2") return |