From eb10bc2560b14992ab900491bbe469be639fdbd7 Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Wed, 8 Nov 2023 23:54:35 -0500 Subject: [PATCH] idz: fix news url --- titles/idz/handlers/load_server_info.py | 7 +++++-- titles/idz/index.py | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/titles/idz/handlers/load_server_info.py b/titles/idz/handlers/load_server_info.py index ef6e81c..4c60dd7 100644 --- a/titles/idz/handlers/load_server_info.py +++ b/titles/idz/handlers/load_server_info.py @@ -1,5 +1,6 @@ import struct +from core.utils import Utils from .base import IDZHandlerBase from core.config import CoreConfig from ..config import IDZConfig @@ -20,9 +21,11 @@ class IDZHandlerLoadServerInfo(IDZHandlerBase): offset = 0 if self.version >= IDZConstants.VER_IDZ_210: offset = 2 + + t_port = Utils.get_title_port(self.core_config) - news_str = f"http://{self.core_config.title.hostname}:{self.core_config.title.port}/SDDF/230/news/news80**.txt" - err_str = f"http://{self.core_config.title.hostname}:{self.core_config.title.port}/SDDF/230/error" + news_str = f"http://{self.core_config.title.hostname}:{t_port}/idz/news/news80**.txt" + err_str = f"http://{self.core_config.title.hostname}:{t_port}/idz/error" len_hostname = len(self.core_config.title.hostname) len_news = len(news_str) diff --git a/titles/idz/index.py b/titles/idz/index.py index 39d21c2..62473f9 100644 --- a/titles/idz/index.py +++ b/titles/idz/index.py @@ -85,7 +85,8 @@ class IDZServlet(BaseServlet): def get_endpoint_matchers(self) -> Tuple[List[Tuple[str, str, Dict]], List[Tuple[str, str, Dict]]]: return[ - [("render_GET", "/{game}/{version}/{endpoint:.*?}", {'game': R'S...'})], # TODO: Slim this down to only the news stuff + [("render_GET", "/idz/news/{endpoint:.*?}", {}), + ("render_GET", "/idz/error", {})], [] ]