mirror of
https://gitea.tendokyu.moe/Hay1tsme/artemis.git
synced 2026-02-13 11:17:28 +08:00
add special-case ping handlers to mai2, ongeki and chuni
This commit is contained in:
@@ -16,9 +16,6 @@ class Mai2Base():
|
||||
self.data = Mai2Data(cfg)
|
||||
self.logger = logging.getLogger("mai2")
|
||||
|
||||
def handle_ping_request(self, data: Dict) -> Dict:
|
||||
return {"returnCode": 1}
|
||||
|
||||
def handle_get_game_setting_api_request(self, data: Dict):
|
||||
reboot_start = date.strftime(datetime.now() + timedelta(hours=3), Mai2Constants.DATE_TIME_FORMAT)
|
||||
reboot_end = date.strftime(datetime.now() + timedelta(hours=4), Mai2Constants.DATE_TIME_FORMAT)
|
||||
|
||||
@@ -69,6 +69,9 @@ class Mai2Servlet():
|
||||
return (True, f"http://{core_cfg.title.hostname}/{game_code}/$v/", f"{core_cfg.title.hostname}/")
|
||||
|
||||
def render_POST(self, request: Request, version: int, url_path: str) -> bytes:
|
||||
if url_path == "/ping":
|
||||
return zlib.compress(json.dumps({'returnCode': 1}, ensure_ascii=False).encode("utf-8"))
|
||||
|
||||
req_raw = request.content.getvalue()
|
||||
url = request.uri.decode()
|
||||
url_split = url_path.split("/")
|
||||
|
||||
Reference in New Issue
Block a user