forked from Hay1tsme/artemis
ongeki: add option to use https for red and beyond
This commit is contained in:
parent
cb8eaae2c0
commit
94c326a27d
@ -1,6 +1,7 @@
|
|||||||
server:
|
server:
|
||||||
enable: True
|
enable: True
|
||||||
loglevel: "info"
|
loglevel: "info"
|
||||||
|
use_https: False
|
||||||
|
|
||||||
gachas:
|
gachas:
|
||||||
enabled_gachas:
|
enabled_gachas:
|
||||||
|
@ -21,6 +21,12 @@ class OngekiServerConfig:
|
|||||||
self.__config, "ongeki", "server", "loglevel", default="info"
|
self.__config, "ongeki", "server", "loglevel", default="info"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def use_https(self) -> bool:
|
||||||
|
return CoreConfig.get_config_field(
|
||||||
|
self.__config, "ongeki", "server", "use_https", default=False
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class OngekiGachaConfig:
|
class OngekiGachaConfig:
|
||||||
|
@ -127,15 +127,18 @@ class OngekiServlet(BaseServlet):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def get_allnet_info(self, game_code: str, game_ver: int, keychip: str) -> Tuple[str, str]:
|
def get_allnet_info(self, game_code: str, game_ver: int, keychip: str) -> Tuple[str, str]:
|
||||||
if not self.core_cfg.server.is_using_proxy and Utils.get_title_port(self.core_cfg) != 80:
|
title_port_int = Utils.get_title_port(self.core_cfg)
|
||||||
return (
|
proto = "https" if self.game_cfg.server.use_https and game_ver >= 120 else "http"
|
||||||
f"http://{self.core_cfg.title.hostname}:{Utils.get_title_port(self.core_cfg)}/{game_code}/{game_ver}/",
|
|
||||||
f"{self.core_cfg.title.hostname}:{Utils.get_title_port(self.core_cfg)}/",
|
if proto == "https":
|
||||||
)
|
t_port = f":{title_port_int}" if title_port_int != 443 and not self.core_cfg.server.is_using_proxy else ""
|
||||||
|
|
||||||
|
else:
|
||||||
|
t_port = f":{title_port_int}" if title_port_int != 80 and not self.core_cfg.server.is_using_proxy else ""
|
||||||
|
|
||||||
return (
|
return (
|
||||||
f"http://{self.core_cfg.title.hostname}/{game_code}/{game_ver}/",
|
f"{proto}://{self.core_cfg.title.hostname}{t_port}/{game_code}/{game_ver}/",
|
||||||
f"{self.core_cfg.title.hostname}/",
|
f"{self.core_cfg.title.hostname}{t_port}/",
|
||||||
)
|
)
|
||||||
|
|
||||||
def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes:
|
def render_POST(self, request: Request, game_code: str, matchers: Dict) -> bytes:
|
||||||
|
Loading…
Reference in New Issue
Block a user