forked from Hay1tsme/artemis
sao: fix allnet
This commit is contained in:
parent
9537331d1c
commit
580a9faae8
@ -41,7 +41,30 @@ class SaoServerConfig:
|
||||
self.__config, "sao", "server", "auto_register", default=True
|
||||
)
|
||||
|
||||
class SaoCryptConfig:
|
||||
def __init__(self, parent_config: "SaoConfig"):
|
||||
self.__config = parent_config
|
||||
|
||||
@property
|
||||
def enable(self) -> bool:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "sao", "crypt", "enable", default=False
|
||||
)
|
||||
|
||||
@property
|
||||
def key(self) -> str:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "sao", "crypt", "key", default=""
|
||||
)
|
||||
|
||||
@property
|
||||
def iv(self) -> str:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "sao", "crypt", "iv", default=""
|
||||
)
|
||||
|
||||
|
||||
class SaoConfig(dict):
|
||||
def __init__(self) -> None:
|
||||
self.server = SaoServerConfig(self)
|
||||
self.crypt = SaoCryptConfig(self)
|
||||
|
@ -4,6 +4,7 @@ import yaml
|
||||
import logging, coloredlogs
|
||||
from logging.handlers import TimedRotatingFileHandler
|
||||
from os import path
|
||||
from Crypto.Cipher import Blowfish
|
||||
|
||||
from core import CoreConfig, Utils
|
||||
from core.title import BaseServlet
|
||||
@ -70,8 +71,8 @@ class SaoServlet(BaseServlet):
|
||||
|
||||
def get_allnet_info(self, game_code: str, game_ver: int, keychip: str) -> Tuple[str, str]:
|
||||
return (
|
||||
f"http://{self.game_cfg.server.hostname}:{self.game_cfg.server.port}/SaoServlet/",
|
||||
f"{self.game_cfg.server.hostname}/SaoServlet/",
|
||||
f"http://{self.game_cfg.server.hostname}:{self.game_cfg.server.port}/",
|
||||
f"{self.game_cfg.server.hostname}/",
|
||||
)
|
||||
|
||||
def get_mucha_info(self, core_cfg: CoreConfig, cfg_dir: str) -> Tuple[bool, str]:
|
||||
|
Loading…
Reference in New Issue
Block a user