forked from ArchipelagoMW/Archipelago
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TLOZ: Conversion to use BizHawkClient
First steps: - Create worlds/tloz/Client.py, currently able to patch .aptloz files, vailidate ROM on connection, and successfuly connect to a multiworld server with BizHawkClient - import Client to __init__.py so it properly loads - Remove Zelda1Client from LauncherComponents.py - Update inno_setup.iss to delete old Zelda1Client and connector_tloz.lua, as well as associate .aptloz files with BizhHawkClient instead of Zelda1Client
- Loading branch information
1 parent
6c5f825
commit 2fde3a1
Showing
4 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import logging | ||
from worlds._bizhawk.client import BizHawkClient | ||
from worlds._bizhawk import read | ||
|
||
logger = logging.getLogger("Client") | ||
|
||
class TLOZClient(BizHawkClient): | ||
system = "NES" | ||
patch_suffix = ".aptloz" | ||
game = "The Legend of Zelda" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
async def validate_rom(self, ctx): | ||
game_name = await read(ctx.bizhawk_ctx, [(0x0, 3, "PRG ROM")]) | ||
game_name = game_name[0].decode("ascii") | ||
if game_name in "LOZ": | ||
ctx.game = self.game | ||
ctx.items_handling = 0b101 # get sent remote and starting items | ||
return True | ||
return False | ||
|
||
async def set_auth(self, ctx): | ||
auth_name = await read(ctx.bizhawk_ctx, [(0x20, 16, "PRG ROM")]) | ||
auth_name = auth_name[0].decode("ascii").split("\x00")[0] | ||
ctx.auth = auth_name | ||
|
||
async def game_watcher(self, ctx): | ||
#TODO | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters