diff --git a/core/title.py b/core/title.py index 552a919..3fdb30c 100644 --- a/core/title.py +++ b/core/title.py @@ -74,11 +74,11 @@ class BaseServlet: """ return (False, "") - def render_POST(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes: self.logger.warn(f"{game_code} Does not dispatch POST") return None - def render_GET(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_GET(self, request: Request, game_code: str, matchers: Dict) -> bytes: self.logger.warn(f"{game_code} Does not dispatch GET") return None diff --git a/titles/chuni/index.py b/titles/chuni/index.py index 1d8b38c..03be049 100644 --- a/titles/chuni/index.py +++ b/titles/chuni/index.py @@ -146,7 +146,7 @@ class ChuniServlet(BaseServlet): return (f"http://{self.core_cfg.title.hostname}/{game_ver}/", "") - def render_POST(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes: endpoint = matchers['endpoint'] version = int(matchers['version']) diff --git a/titles/cm/index.py b/titles/cm/index.py index 9b6c099..ce11f39 100644 --- a/titles/cm/index.py +++ b/titles/cm/index.py @@ -72,7 +72,7 @@ class CardMakerServlet(BaseServlet): return True - def render_POST(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes: version = int(matchers['version']) endpoint = matchers['endpoint'] req_raw = request.content.getvalue() diff --git a/titles/diva/index.py b/titles/diva/index.py index 334a99d..b4ba73e 100644 --- a/titles/diva/index.py +++ b/titles/diva/index.py @@ -78,7 +78,7 @@ class DivaServlet(BaseServlet): return True - def render_POST(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes: req_raw = request.content.getvalue() url_header = request.getAllHeaders() diff --git a/titles/idz/index.py b/titles/idz/index.py index 599b117..39d21c2 100644 --- a/titles/idz/index.py +++ b/titles/idz/index.py @@ -157,7 +157,7 @@ class IDZServlet(BaseServlet): self.logger.info(f"UserDB Listening on port {self.game_cfg.ports.userdb}") - def render_GET(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_GET(self, request: Request, game_code: str, matchers: Dict) -> bytes: url_path = matchers['endpoint'] self.logger.info(f"IDZ GET request: {url_path}") request.responseHeaders.setRawHeaders( diff --git a/titles/mai2/index.py b/titles/mai2/index.py index cd5f910..d83e12b 100644 --- a/titles/mai2/index.py +++ b/titles/mai2/index.py @@ -155,7 +155,7 @@ class Mai2Servlet(BaseServlet): f"Failed to make movie upload directory at {self.game_cfg.uploads.movies_dir}" ) - def handle_mai2(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def handle_mai2(self, request: Request, game_code: str, matchers: Dict) -> bytes: endpoint = matchers['endpoint'] version = int(matchers['version']) if endpoint.lower() == "ping": diff --git a/titles/ongeki/index.py b/titles/ongeki/index.py index 4c5cc0a..97c49b9 100644 --- a/titles/ongeki/index.py +++ b/titles/ongeki/index.py @@ -132,7 +132,7 @@ class OngekiServlet(BaseServlet): f"{self.core_cfg.title.hostname}/", ) - def render_POST(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes: endpoint = matchers['endpoint'] version = matchers['version'] if endpoint.lower() == "ping": diff --git a/titles/pokken/index.py b/titles/pokken/index.py index fac2456..f887cd1 100644 --- a/titles/pokken/index.py +++ b/titles/pokken/index.py @@ -108,7 +108,7 @@ class PokkenServlet(BaseServlet): self.game_cfg.ports.admission, PokkenAdmissionFactory(self.core_cfg, self.game_cfg) ) - def render_POST(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes: content = request.content.getvalue() if content == b"": self.logger.info("Empty request") @@ -137,7 +137,7 @@ class PokkenServlet(BaseServlet): ret = handler(pokken_request) return ret - def handle_matching(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def handle_matching(self, request: Request, game_code: str, matchers: Dict) -> bytes: if not self.game_cfg.server.enable_matching: return b"" diff --git a/titles/sao/index.py b/titles/sao/index.py index 9ff1995..a7de92a 100644 --- a/titles/sao/index.py +++ b/titles/sao/index.py @@ -81,7 +81,7 @@ class SaoServlet(BaseServlet): return (True, "SAO1") - def render_POST(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes: req_url = request.uri.decode() if req_url == "/matching": self.logger.info("Matching request") diff --git a/titles/wacca/index.py b/titles/wacca/index.py index 0eea926..29779c9 100644 --- a/titles/wacca/index.py +++ b/titles/wacca/index.py @@ -64,8 +64,10 @@ class WaccaServlet: def get_endpoint_matchers(self) -> Tuple[List[Tuple[str, str, Dict]], List[Tuple[str, str, Dict]]]: return ( [], - [("render_POST", "/WaccaServlet/api/{api}/{endpoint}", {}), - ("render_POST", "/WaccaServlet/api/{api}/{branch}/{endpoint}", {}),] + [ + ("render_POST", "/WaccaServlet/api/{api}/{endpoint}", {}), + ("render_POST", "/WaccaServlet/api/{api}/{branch}/{endpoint}", {}) + ] ) @classmethod @@ -91,7 +93,7 @@ class WaccaServlet: return (True, f"http://{self.core_cfg.title.hostname}/{game_code}/$v", "") - def render_POST(self, request: Request, game_code: int, matchers: Dict) -> bytes: + def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes: def end(resp: Dict) -> bytes: hash = md5(json.dumps(resp, ensure_ascii=False).encode()).digest() request.responseHeaders.addRawHeader(b"X-Wacca-Hash", hash.hex().encode())