From 8560c05928e40a71acdd334d6ff767421a98cd0a Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Thu, 9 Nov 2023 11:55:49 -0500 Subject: [PATCH] sao: remove hostname/port config, fix allnet uri --- example_config/sao.yaml | 9 ++++++--- titles/sao/config.py | 12 ------------ titles/sao/index.py | 7 ++++--- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/example_config/sao.yaml b/example_config/sao.yaml index 7e3ecf2..bfb1c08 100644 --- a/example_config/sao.yaml +++ b/example_config/sao.yaml @@ -1,6 +1,9 @@ server: - hostname: "localhost" enable: True loglevel: "info" - port: 9000 - auto_register: True \ No newline at end of file + auto_register: True + +crypt: + enable: False + key: "" + iv: "" diff --git a/titles/sao/config.py b/titles/sao/config.py index aa0adbd..1ef9991 100644 --- a/titles/sao/config.py +++ b/titles/sao/config.py @@ -5,12 +5,6 @@ class SaoServerConfig: def __init__(self, parent_config: "SaoConfig"): self.__config = parent_config - @property - def hostname(self) -> str: - return CoreConfig.get_config_field( - self.__config, "sao", "server", "hostname", default="localhost" - ) - @property def enable(self) -> bool: return CoreConfig.get_config_field( @@ -25,12 +19,6 @@ class SaoServerConfig: ) ) - @property - def port(self) -> int: - return CoreConfig.get_config_field( - self.__config, "sao", "server", "port", default=9000 - ) - @property def auto_register(self) -> bool: """ diff --git a/titles/sao/index.py b/titles/sao/index.py index 177f668..daa9b32 100644 --- a/titles/sao/index.py +++ b/titles/sao/index.py @@ -52,7 +52,7 @@ class SaoServlet(BaseServlet): def get_endpoint_matchers(self) -> Tuple[List[Tuple[str, str, Dict]], List[Tuple[str, str, Dict]]]: return ( [], - [("render_POST", "/dev/proto/if/{category}/{endpoint}", {})] + [("render_POST", "/{datecode}/proto/if/{category}/{endpoint}", {})] ) @classmethod @@ -70,9 +70,10 @@ class SaoServlet(BaseServlet): return True def get_allnet_info(self, game_code: str, game_ver: int, keychip: str) -> Tuple[str, str]: + tport = Utils.get_title_port(self.core_cfg) return ( - f"http://{self.game_cfg.server.hostname}:{self.game_cfg.server.port}/", - f"{self.game_cfg.server.hostname}/", + f"http://{self.core_cfg.title.hostname}:{tport}/", + f"{self.core_cfg.title.hostname}/", ) def get_mucha_info(self, core_cfg: CoreConfig, cfg_dir: str) -> Tuple[bool, str]: