From 70b40ce99284587d110ee5fd8fa269da2f2409ae Mon Sep 17 00:00:00 2001 From: roaz Date: Tue, 21 May 2024 04:07:17 +0000 Subject: [PATCH] chuni: Fix endpoint for older version of SDGS (#141) Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/141 Co-authored-by: roaz Co-committed-by: roaz --- readme.md | 1 + titles/chuni/index.py | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/readme.md b/readme.md index 114fef5..505f241 100644 --- a/readme.md +++ b/readme.md @@ -10,6 +10,7 @@ Games listed below have been tested and confirmed working. Only game versions ol + CHUNITHM INTL + SUPERSTAR + + SUPERSTAR PLUS + NEW + NEW PLUS + SUN diff --git a/titles/chuni/index.py b/titles/chuni/index.py index f781898..f0f1eac 100644 --- a/titles/chuni/index.py +++ b/titles/chuni/index.py @@ -195,11 +195,11 @@ class ChuniServlet(BaseServlet): internal_ver = ChuniConstants.VER_CHUNITHM_NEW_PLUS elif version >= 210 and version < 215: # SUN internal_ver = ChuniConstants.VER_CHUNITHM_SUN - elif version >= 215: # SUN + elif version >= 215: # SUN PLUS internal_ver = ChuniConstants.VER_CHUNITHM_SUN_PLUS elif game_code == "SDGS": # Int - if version < 110: # SUPERSTAR - internal_ver = ChuniConstants.VER_CHUNITHM_PARADISE # FIXME: Not sure what was intended to go here? was just "PARADISE" + if version < 110: # SUPERSTAR / SUPERSTAR PLUS + internal_ver = ChuniConstants.VER_CHUNITHM_PARADISE # SUPERSTAR / SUPERSTAR PLUS worked fine with it elif version >= 110 and version < 115: # NEW internal_ver = ChuniConstants.VER_CHUNITHM_NEW elif version >= 115 and version < 120: # NEW PLUS!! @@ -272,11 +272,13 @@ class ChuniServlet(BaseServlet): self.logger.info(f"v{version} {endpoint} request from {client_ip}") self.logger.debug(req_data) - endpoint = ( - endpoint.replace("C3Exp", "") - if game_code == "SDGS" - else endpoint - ) + if game_code == "SDGS" and version >= 110: + endpoint = endpoint.replace("C3Exp", "") + elif game_code == "SDGS" and version < 110: + endpoint = endpoint.replace("Exp", "") + else: + endpoint = endpoint + func_to_find = "handle_" + inflection.underscore(endpoint) + "_request" handler_cls = self.versions[internal_ver](self.core_cfg, self.game_cfg)