Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move client to APworld #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
finish moving to pkgutil
qwint committed Dec 5, 2024
commit 2655d2336cc54504f59a4c087689f2e85c722dad
29 changes: 16 additions & 13 deletions worlds/rusted_moss/RustedMossClient.py
Original file line number Diff line number Diff line change
@@ -33,21 +33,24 @@ def _cmd_patch(self, directory: str = ""):
basemd5 = hashlib.md5()
with open(dataWinPath, "rb") as file:
base_data_bytes = bytes(file.read())
basemd5.update(base_data_bytes)
if RAWDATAHASH != basemd5.hexdigest():
self.output("ERROR: MD5 hash of data.win file does not match correct hash. Make sure you have downpatched to the correct version (1.47)")
return

modded_data = bsdiff4.patch(base_data_bytes, pkgutil.get_data(__name__, "data/rusted_moss_patch.bsdiff"))

with open(dataWinPath, "wb") as file:
file.write(modded_data)
moddedmd5 = hashlib.md5()
with open(dataWinPath, "rb") as file:
modded_data_bytes = bytes(file.read())
file.close()
basemd5.update(base_data_bytes)
if RAWDATAHASH != basemd5.hexdigest():
self.output("ERROR: MD5 hash of data.win file does not match correct hash. Make sure you have downpatched to the correct version (1.47)")
moddedmd5.update(modded_data_bytes)
if MODDEDDATAHASH != moddedmd5.hexdigest():
self.output("ERROR: MD5 hash of moddified data.win file does not match correct hash. Try again or contact mod owner.")
else:
bsdiff4.file_patch_inplace(dataWinPath, pkgutil.get_data(__name__, "data/rusted_moss_patch.bsdiff"))
moddedmd5 = hashlib.md5()
with open(dataWinPath, "rb") as file:
modded_data_bytes = bytes(file.read())
file.close()
moddedmd5.update(modded_data_bytes)
if MODDEDDATAHASH != moddedmd5.hexdigest():
self.output("ERROR: MD5 hash of moddified data.win file does not match correct hash. Try again or contact mod owner.")
else:
self.output("Patching successful")
self.output("Patching successful")

async def _cmd_deathlink(self):
"""Toggles deathlink on or off."""