Skip to content

Commit

Permalink
move client to apworld
Browse files Browse the repository at this point in the history
note: the pkgutil call seems to currently not be working, probably because the surrounding functions want a different format than bytes it returns
  • Loading branch information
qwint committed Dec 4, 2024
1 parent e4b2d3f commit 6ba973c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 0 additions & 2 deletions worlds/LauncherComponents.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ def install_apworld(apworld_path: str = "") -> None:

#MegaMan Battle Network 3
Component('MMBN3 Client', 'MMBN3Client', file_identifier=SuffixIdentifier('.apbn3')),
# Rusted Moss
Component('Rusted Moss Client', 'RustedMossClient')
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import typing
import bsdiff4
import hashlib
import pkgutil

import Utils

Expand Down Expand Up @@ -37,7 +38,7 @@ def _cmd_patch(self, directory: str = ""):
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)")
else:
bsdiff4.file_patch_inplace(dataWinPath, os.path.join(os.getcwd(), "data/rusted_moss_patch.bsdiff"))
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())
Expand Down
11 changes: 11 additions & 0 deletions worlds/rusted_moss/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dataclasses import asdict
from typing import Dict, Any
from worlds.AutoWorld import World
from worlds.LauncherComponents import components, Component, launch_subprocess
from BaseClasses import ItemClassification, Region

from .Items import RustedMossItem, item_dict
Expand All @@ -9,6 +10,16 @@
from .LogicExtractor import extract_logic
from ..generic.Rules import set_rule


def launch_client(*args):
from .RustedMossClient import main
launch_subprocess(main, name="Rusted Moss Client")


# Add component to Launcher
components.append(Component('Rusted Moss Client', func=launch_client))


class RustedMossWorld(World):
"""
Rusted Moss is a metroidvania featuring an elastic physics-based grappling hook.
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 6ba973c

Please sign in to comment.