From 97e3f1af0160a13b652d872b546018cfe3221460 Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Thu, 13 Apr 2023 22:22:28 +0200 Subject: [PATCH] mai2: cardmaker festival support --- titles/cm/index.py | 7 ++++++- titles/cm/read.py | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/titles/cm/index.py b/titles/cm/index.py index d544e59..3a56566 100644 --- a/titles/cm/index.py +++ b/titles/cm/index.py @@ -12,6 +12,7 @@ from twisted.web.http import Request from logging.handlers import TimedRotatingFileHandler from core.config import CoreConfig +from core.utils import Utils from titles.cm.config import CardMakerConfig from titles.cm.const import CardMakerConstants from titles.cm.base import CardMakerBase @@ -82,6 +83,7 @@ class CardMakerServlet: url_split = url_path.split("/") internal_ver = 0 endpoint = url_split[len(url_split) - 1] + client_ip = Utils.get_ip_addr(request) print(f"version: {version}") @@ -107,7 +109,10 @@ class CardMakerServlet: req_data = json.loads(unzip) - self.logger.info(f"v{version} {endpoint} request - {req_data}") + self.logger.info( + f"v{version} {endpoint} request from {client_ip}" + ) + self.logger.debug(req_data) func_to_find = "handle_" + inflection.underscore(endpoint) + "_request" diff --git a/titles/cm/read.py b/titles/cm/read.py index f27b40b..93ff203 100644 --- a/titles/cm/read.py +++ b/titles/cm/read.py @@ -80,7 +80,7 @@ class CardMakerReader(BaseReader): for dir in data_dirs: self.read_chuni_card(f"{dir}/CHU/card") self.read_chuni_gacha(f"{dir}/CHU/gacha") - + self.read_mai2_card(f"{dir}/MAI/card") self.read_ongeki_gacha(f"{dir}/MU3/gacha") def read_chuni_card(self, base_dir: str) -> None: @@ -206,6 +206,7 @@ class CardMakerReader(BaseReader): "1.15": Mai2Constants.VER_MAIMAI_DX_SPLASH_PLUS, "1.20": Mai2Constants.VER_MAIMAI_DX_UNIVERSE, "1.25": Mai2Constants.VER_MAIMAI_DX_UNIVERSE_PLUS, + "1.30": Mai2Constants.VER_MAIMAI_DX_FESTIVAL, } for root, dirs, files in os.walk(base_dir):