diff --git a/core/allnet.py b/core/allnet.py index 9eb6595..43dde1f 100644 --- a/core/allnet.py +++ b/core/allnet.py @@ -349,12 +349,22 @@ class AllnetServlet: not self.config.allnet.allow_online_updates or not self.config.allnet.update_cfg_folder ): - return PlainTextResponse(urllib.parse.unquote(urllib.parse.urlencode(vars(resp))) + "\n") + resp = urllib.parse.unquote(urllib.parse.urlencode(vars(resp))) + "\n" + if is_dfi: + return PlainTextResponse( + self.to_dfi(resp) + b"\r\n", headers={ "Pragma": "DFI" } + ) + return PlainTextResponse(resp) else: machine = await self.data.arcade.get_machine(req.serial) if not machine or not machine['ota_enable'] or not machine['is_cab'] or machine['is_blacklisted']: - return PlainTextResponse(urllib.parse.unquote(urllib.parse.urlencode(vars(resp))) + "\n") + resp = urllib.parse.unquote(urllib.parse.urlencode(vars(resp))) + "\n" + if is_dfi: + return PlainTextResponse( + self.to_dfi(resp) + b"\r\n", headers={ "Pragma": "DFI" } + ) + return PlainTextResponse(resp) if path.exists( f"{self.config.allnet.update_cfg_folder}/{req.game_id}-{req.ver.replace('.', '')}-app.ini" @@ -744,7 +754,7 @@ class AllnetDownloadOrderRequest: self.encode = req.get("encode", "") class AllnetDownloadOrderResponse: - def __init__(self, stat: int = 1, serial: str = "", uri: str = "") -> None: + def __init__(self, stat: int = 1, serial: str = "", uri: str = "null") -> None: self.stat = stat self.serial = serial self.uri = uri