1
0
mirror of synced 2024-11-24 14:30:09 +01:00

cardmaker: simplify handle_get_game_connect_api_request, add develop mode check

This commit is contained in:
Hay1tsme 2023-03-09 10:35:58 -05:00
parent fb6a026b84
commit 2f1728b64d
2 changed files with 13 additions and 24 deletions

View File

@ -22,7 +22,10 @@ class CardMakerBase():
self.version = CardMakerConstants.VER_CARD_MAKER
def handle_get_game_connect_api_request(self, data: Dict) -> Dict:
if self.core_cfg.server.is_develop:
uri = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}"
else:
f"http://{self.core_cfg.title.hostname}"
# CHUNITHM = 0, maimai = 1, ONGEKI = 2
return {

View File

@ -17,29 +17,15 @@ class CardMaker136(CardMakerBase):
self.version = CardMakerConstants.VER_CARD_MAKER_136
def handle_get_game_connect_api_request(self, data: Dict) -> Dict:
ret = super().handle_get_game_connect_api_request(data)
if self.core_cfg.server.is_develop:
uri = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}"
else:
uri = f"http://{self.core_cfg.title.hostname}"
# CHUNITHM = 0, maimai = 1, ONGEKI = 2
return {
"length": 3,
"gameConnectList": [
{
"modelKind": 0,
"type": 1,
"titleUri": f"{uri}/SDHD/205/"
},
{
"modelKind": 1,
"type": 1,
"titleUri": f"{uri}/SDEZ/125/"
},
{
"modelKind": 2,
"type": 1,
"titleUri": f"{uri}/SDDT/135/"
}
]
}
ret["gameConnectList"][0]["titleUri"] = f"{uri}/SDHD/205/"
ret["gameConnectList"][1]["titleUri"] = f"{uri}/SDEZ/125/"
ret["gameConnectList"][2]["titleUri"] = f"{uri}/SDDT/135/"
def handle_get_game_setting_api_request(self, data: Dict) -> Dict:
ret = super().handle_get_game_setting_api_request(data)