diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-05-18 00:03:46 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-05-18 00:03:46 -0300 |
commit | 57cbea204d0ee66509783664af9757f9273fa254 (patch) | |
tree | f4973b78d8f3040354901bad54568622c64a8fee /game/client.rpy | |
parent | 1555f32044278603b892e500b5d52a00561e715e (diff) | |
download | renpy-57cbea204d0ee66509783664af9757f9273fa254.tar.gz renpy-57cbea204d0ee66509783664af9757f9273fa254.tar.bz2 renpy-57cbea204d0ee66509783664af9757f9273fa254.tar.xz renpy-57cbea204d0ee66509783664af9757f9273fa254.zip |
Create mySoul structure and make the /souldata request
Diffstat (limited to 'game/client.rpy')
-rw-r--r-- | game/client.rpy | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/game/client.rpy b/game/client.rpy index 9b5a8fe..9a26ea3 100644 --- a/game/client.rpy +++ b/game/client.rpy @@ -138,8 +138,26 @@ init 2 python: ############################################ # TODO: Launch thread requesting /soul data def load_souldata(): - global progress - progress = 100 + global progress, responsive, vaultId, vaultToken, mySoul + try: + auth = {"vaultId": vaultId, + "token": vaultToken} + + ## Make the POST request + r=vault.post(VAULT_HOST+"/souldata", json=auth, timeout=15.0) + if r.status_code != 200: + raise Exception("Request error: %d" % r.status_code) + dat=r.json() + + ## Update mySoul + mySoul={} + mySoul["level"]=dat["soulv"] + mySoul["exp"]=dat["soulx"] + progress = 100 + except: + traceback.print_exc() + mySoul = None + responsive = False return |