2023-05-10 19:32:35 +00:00
|
|
|
from typing import Dict, Any
|
|
|
|
|
|
|
|
from core.config import CoreConfig
|
|
|
|
from titles.chuni.newplus import ChuniNewPlus
|
|
|
|
from titles.chuni.const import ChuniConstants
|
|
|
|
from titles.chuni.config import ChuniConfig
|
|
|
|
|
|
|
|
|
|
|
|
class ChuniSun(ChuniNewPlus):
|
|
|
|
def __init__(self, core_cfg: CoreConfig, game_cfg: ChuniConfig) -> None:
|
|
|
|
super().__init__(core_cfg, game_cfg)
|
|
|
|
self.version = ChuniConstants.VER_CHUNITHM_SUN
|
|
|
|
|
|
|
|
def handle_get_game_setting_api_request(self, data: Dict) -> Dict:
|
|
|
|
ret = super().handle_get_game_setting_api_request(data)
|
|
|
|
ret["gameSetting"]["romVersion"] = self.game_cfg.version.version(self.version)["rom"]
|
|
|
|
ret["gameSetting"]["dataVersion"] = self.game_cfg.version.version(self.version)["data"]
|
|
|
|
ret["gameSetting"][
|
|
|
|
"matchingUri"
|
2023-12-13 06:05:46 +00:00
|
|
|
] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/210/ChuniServlet/"
|
2023-05-10 19:32:35 +00:00
|
|
|
ret["gameSetting"][
|
|
|
|
"matchingUriX"
|
2023-12-13 06:05:46 +00:00
|
|
|
] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/210/ChuniServlet/"
|
2023-05-10 19:32:35 +00:00
|
|
|
ret["gameSetting"][
|
|
|
|
"udpHolePunchUri"
|
2023-12-13 06:05:46 +00:00
|
|
|
] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/210/ChuniServlet/"
|
2023-05-10 19:32:35 +00:00
|
|
|
ret["gameSetting"][
|
|
|
|
"reflectorUri"
|
2023-12-13 06:05:46 +00:00
|
|
|
] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/210/ChuniServlet/"
|
2023-05-10 19:32:35 +00:00
|
|
|
return ret
|
|
|
|
|
|
|
|
def handle_cm_get_user_preview_api_request(self, data: Dict) -> Dict:
|
|
|
|
user_data = super().handle_cm_get_user_preview_api_request(data)
|
|
|
|
|
|
|
|
# hardcode lastDataVersion for CardMaker 1.35 A032
|
|
|
|
user_data["lastDataVersion"] = "2.10.00"
|
2023-12-13 06:05:46 +00:00
|
|
|
return user_data
|