2023-02-17 06:02:21 +00:00
|
|
|
from core.config import CoreConfig
|
|
|
|
|
2023-02-18 20:01:31 +00:00
|
|
|
|
2023-03-09 16:38:58 +00:00
|
|
|
class DivaServerConfig:
|
2023-02-17 06:02:21 +00:00
|
|
|
def __init__(self, parent_config: "DivaConfig") -> None:
|
|
|
|
self.__config = parent_config
|
2023-02-18 20:01:31 +00:00
|
|
|
|
2023-02-17 06:02:21 +00:00
|
|
|
@property
|
|
|
|
def enable(self) -> bool:
|
2023-03-09 16:38:58 +00:00
|
|
|
return CoreConfig.get_config_field(
|
|
|
|
self.__config, "diva", "server", "enable", default=True
|
|
|
|
)
|
2023-02-18 20:01:31 +00:00
|
|
|
|
2023-02-17 06:02:21 +00:00
|
|
|
@property
|
|
|
|
def loglevel(self) -> int:
|
2023-03-09 16:38:58 +00:00
|
|
|
return CoreConfig.str_to_loglevel(
|
|
|
|
CoreConfig.get_config_field(
|
|
|
|
self.__config, "diva", "server", "loglevel", default="info"
|
|
|
|
)
|
|
|
|
)
|
2023-02-17 06:02:21 +00:00
|
|
|
|
2024-06-29 22:23:10 +00:00
|
|
|
@property
|
2024-06-30 10:54:44 +00:00
|
|
|
def festa_enable(self) -> bool:
|
2024-06-29 22:23:10 +00:00
|
|
|
return CoreConfig.get_config_field(
|
2024-06-30 10:54:44 +00:00
|
|
|
self.__config, "diva", "server", "festa_enable", default=True
|
2024-06-29 22:23:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
@property
|
2024-06-30 10:54:44 +00:00
|
|
|
def festa_add_VP(self) -> str:
|
2024-06-29 22:23:10 +00:00
|
|
|
return CoreConfig.get_config_field(
|
2024-06-30 10:54:44 +00:00
|
|
|
self.__config, "diva", "server", "festa_add_VP", default="20,5"
|
2024-06-29 22:23:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
@property
|
2024-06-30 10:54:44 +00:00
|
|
|
def festa_multiply_VP(self) -> str:
|
2024-06-29 22:23:10 +00:00
|
|
|
return CoreConfig.get_config_field(
|
2024-06-30 10:54:44 +00:00
|
|
|
self.__config, "diva", "server", "festa_multiply_VP", default="1,2"
|
2024-06-29 22:23:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
@property
|
2024-06-30 10:54:44 +00:00
|
|
|
def festa_end_time(self) -> str:
|
2024-06-29 22:23:10 +00:00
|
|
|
return CoreConfig.get_config_field(
|
2024-06-30 10:54:44 +00:00
|
|
|
self.__config, "diva", "server", "festa_end_time", default="2029-01-01 00:00:00.0"
|
2024-06-29 22:23:10 +00:00
|
|
|
)
|
2023-02-18 20:01:31 +00:00
|
|
|
|
2023-03-09 16:38:58 +00:00
|
|
|
class DivaModsConfig:
|
2023-02-18 20:01:31 +00:00
|
|
|
def __init__(self, parent_config: "DivaConfig") -> None:
|
|
|
|
self.__config = parent_config
|
|
|
|
|
|
|
|
@property
|
|
|
|
def unlock_all_modules(self) -> bool:
|
2023-03-09 16:38:58 +00:00
|
|
|
return CoreConfig.get_config_field(
|
|
|
|
self.__config, "diva", "mods", "unlock_all_modules", default=True
|
|
|
|
)
|
2023-02-18 20:01:31 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
def unlock_all_items(self) -> bool:
|
2023-03-09 16:38:58 +00:00
|
|
|
return CoreConfig.get_config_field(
|
|
|
|
self.__config, "diva", "mods", "unlock_all_items", default=True
|
|
|
|
)
|
2023-02-18 20:01:31 +00:00
|
|
|
|
|
|
|
|
2023-02-17 06:02:21 +00:00
|
|
|
class DivaConfig(dict):
|
|
|
|
def __init__(self) -> None:
|
2023-02-18 20:01:31 +00:00
|
|
|
self.server = DivaServerConfig(self)
|
|
|
|
self.mods = DivaModsConfig(self)
|