chu: improve endpoint replace code

This commit is contained in:
zaphkito 2024-04-14 19:54:09 +08:00
parent f5d78225e3
commit 270f46947f
1 changed files with 5 additions and 1 deletions

View File

@ -272,7 +272,11 @@ 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
endpoint = (
endpoint.replace("C3Exp", "")
if game_code == "SDGS"
else endpoint
)
func_to_find = "handle_" + inflection.underscore(endpoint) + "_request"
handler_cls = self.versions[internal_ver](self.core_cfg, self.game_cfg)