mai2: update default config

This commit is contained in:
Hay1tsme 2023-05-12 22:05:05 -04:00
parent 49166c1a7b
commit 8ae0aba89c
3 changed files with 11 additions and 9 deletions

View File

@ -1,3 +1,8 @@
server:
enable: True
loglevel: "info"
deliver:
enable: False
udbdl_enable: False
content_folder: ""

View File

@ -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=""
)

View File

@ -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: