1
0
mirror of synced 2024-11-28 07:50:48 +01:00

add special-case ping handlers to mai2, ongeki and chuni

This commit is contained in:
Hay1tsme 2023-03-09 10:52:49 -05:00
parent 6dcd7b67ef
commit c8d4bc6109
5 changed files with 9 additions and 6 deletions

View File

@ -21,9 +21,6 @@ class ChuniBase():
self.game = ChuniConstants.GAME_CODE
self.version = ChuniConstants.VER_CHUNITHM
def handle_ping_request(self, data: Dict) -> Dict:
return {"returnCode": 1}
def handle_game_login_api_request(self, data: Dict) -> Dict:
#self.data.base.log_event("chuni", "login", logging.INFO, {"version": self.version, "user": data["userId"]})
return { "returnCode": 1 }

View File

@ -86,6 +86,9 @@ class ChuniServlet():
return (True, f"http://{core_cfg.title.hostname}/{game_code}/$v/", "")
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_split = url_path.split("/")
encrtped = False

View File

@ -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)

View File

@ -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("/")

View File

@ -72,6 +72,9 @@ class OngekiServlet():
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_split = url_path.split("/")
internal_ver = 0