From 2cba83a80aecc5b2f00aa65baa28adf07a3db51c Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 30 Aug 2021 13:05:06 -0300 Subject: Fix bugs (specially when switching between M+ and MV) --- game/3rdparty/manaverse.rpy | 6 +++--- game/client.rpy | 15 ++++++++++++--- rparse.py | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/game/3rdparty/manaverse.rpy b/game/3rdparty/manaverse.rpy index 7ae498a..cceaf26 100644 --- a/game/3rdparty/manaverse.rpy +++ b/game/3rdparty/manaverse.rpy @@ -49,7 +49,7 @@ init 1 python: ## Detect your plataform ######################################################### if renpy.linux: - if not download_manaplus("ManaVerse.AppImage"): + if not download_manaverse("ManaVerse.AppImage"): return False status_update("Marking as executable...", 72) @@ -57,7 +57,7 @@ init 1 python: status_update("Installation successful!", 75) ######################################################### elif renpy.windows: - if not download_manaplus("ManaPlus.zip"): + if not download_manaverse("ManaPlus.zip"): return False status_update("Unzipping file...", 72) @@ -97,7 +97,7 @@ init 1 python: return False try: - if not install_manaplus(): + if not install_manaverse(): # Delete the failed attempt before raising the exception shutil.rmtree(get_path("manaplus")) #os.rmdir(get_path("manaplus")) diff --git a/game/client.rpy b/game/client.rpy index 461c7a8..cd23d52 100644 --- a/game/client.rpy +++ b/game/client.rpy @@ -155,18 +155,26 @@ init 2 python: def md5check_client(silent=False): renpy.notify("Checking md5sum...") + ## Theirs try: - installdir=get_path(persistent.evol2cli) + installdir=get_path("manaplus") fname=handle_client(launch=True, download=False).split("/").pop() r=requests.get(persistent.host+"/%s.md5" % fname, timeout=10.0) md5up=r.text.replace("\n", "") + except: + traceback.print_exc() + if not silent: + renpy.notify("An error happened.") + return + ## Ours + try: md5us=md5sum(installdir+"/%s" % fname) if md5up != md5us: stdout("MD5 Mismatch: hashes differ", True) stdout("Ours: %s" % md5us, True) stdout("Them: %s" % md5up, True) - shutil.rmtree(get_path(persistent.evol2cli)) + shutil.rmtree(get_path("manaplus")) if not silent: renpy.notify("Files are outdated!") else: @@ -174,8 +182,9 @@ init 2 python: renpy.notify("All files up to date!") except: traceback.print_exc() + shutil.rmtree(get_path("manaplus")) if not silent: - renpy.notify("An error happened.") + renpy.notify("An error happened (outdated?)") return ############################################ diff --git a/rparse.py b/rparse.py index 2df997e..224f745 100644 --- a/rparse.py +++ b/rparse.py @@ -6,4 +6,4 @@ def fm(f): for f in os.listdir(os.getcwd()): subprocess.run("mv %s %s" % (fm(f), fm(f.replace(".rpy", ".py"))), shell=True) -subprocess.run("ls %s" % os.getcwd(), shell=True) +subprocess.call("ls %s" % os.getcwd(), shell=True) -- cgit v1.2.3-70-g09d2