From 8ae0aba89cc80baed3e07e444104118d51fb2a28 Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Fri, 12 May 2023 22:05:05 -0400 Subject: [PATCH] mai2: update default config --- example_config/mai2.yaml | 5 +++++ titles/mai2/config.py | 8 +------- titles/mai2/index.py | 7 +++++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/example_config/mai2.yaml b/example_config/mai2.yaml index a04dda5..d89f5d7 100644 --- a/example_config/mai2.yaml +++ b/example_config/mai2.yaml @@ -1,3 +1,8 @@ server: enable: True loglevel: "info" + +deliver: + enable: False + udbdl_enable: False + content_folder: "" \ No newline at end of file diff --git a/titles/mai2/config.py b/titles/mai2/config.py index 91cdd87..d5ed41f 100644 --- a/titles/mai2/config.py +++ b/titles/mai2/config.py @@ -36,13 +36,7 @@ class Mai2DeliverConfig: ) @property - def list_folder(self) -> int: - return CoreConfig.get_config_field( - self.__config, "mai2", "server", "list_folder", default="" - ) - - @property - def list_folder(self) -> int: + def content_folder(self) -> int: return CoreConfig.get_config_field( self.__config, "mai2", "server", "content_folder", default="" ) diff --git a/titles/mai2/index.py b/titles/mai2/index.py index 0bb8b44..c4d6874 100644 --- a/titles/mai2/index.py +++ b/titles/mai2/index.py @@ -1,4 +1,5 @@ from twisted.web.http import Request +from twisted.web.server import NOT_DONE_YET import json import inflection import yaml @@ -229,8 +230,10 @@ class Mai2Servlet: return zlib.compress(b"ok") elif url_split[0] == "deliver": - if url_split[len(url_split) - 1] == "maimai_deliver.list": - self.logger.info(f"v{version} maimai_deliver.list inquire") + file = url_split[len(url_split) - 1] + self.logger.info(f"v{version} {file} deliver inquire") + + if not self.game_cfg.deliver.enable or not path.exists(f"{self.game_cfg.deliver.content_folder}/{file}"): return zlib.compress(b"") else: