Core remove legacy patch (#1047)

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
Fabian Dill
2022-09-30 00:36:30 +02:00
committed by GitHub
parent 8ab0b410c3
commit 61e39f355d
22 changed files with 259 additions and 491 deletions

View File

@@ -15,10 +15,13 @@ import typing
from json import loads, dumps
from Utils import init_logging, messagebox
# CommonClient import first to trigger ModuleUpdater
from CommonClient import CommonContext, server_loop, ClientCommandProcessor, gui_enabled, get_base_parser
import Utils
if __name__ == "__main__":
init_logging("SNIClient", exception_logger="Client")
Utils.init_logging("SNIClient", exception_logger="Client")
import colorama
import websockets
@@ -28,10 +31,9 @@ from worlds.alttp import Regions, Shops
from worlds.alttp.Rom import ROM_PLAYER_LIMIT
from worlds.sm.Rom import ROM_PLAYER_LIMIT as SM_ROM_PLAYER_LIMIT
from worlds.smz3.Rom import ROM_PLAYER_LIMIT as SMZ3_ROM_PLAYER_LIMIT
import Utils
from CommonClient import CommonContext, server_loop, ClientCommandProcessor, gui_enabled, get_base_parser
from Patch import GAME_ALTTP, GAME_SM, GAME_SMZ3, GAME_DKC3, GAME_SMW
snes_logger = logging.getLogger("SNES")
from MultiServer import mark_raw
@@ -1336,20 +1338,18 @@ async def main():
try:
meta, romfile = Patch.create_rom_file(args.diff_file)
except Exception as e:
messagebox('Error', str(e), True)
Utils.messagebox('Error', str(e), True)
raise
if "server" in meta:
args.connect = meta["server"]
args.connect = meta["server"]
logging.info(f"Wrote rom file to {romfile}")
if args.diff_file.endswith(".apsoe"):
import webbrowser
webbrowser.open("http://www.evermizer.com/apclient/" +
(f"#server={meta['server']}" if "server" in meta else ""))
webbrowser.open(f"http://www.evermizer.com/apclient/#server={meta['server']}")
logging.info("Starting Evermizer Client in your Browser...")
import time
time.sleep(3)
sys.exit()
elif args.diff_file.endswith((".apbp", ".apz3", ".aplttp")):
elif args.diff_file.endswith(".aplttp"):
adjustedromfile, adjusted = get_alttp_settings(romfile)
asyncio.create_task(run_game(adjustedromfile if adjusted else romfile))
else: