2023-02-17 07:02:21 +01:00
|
|
|
from typing import Dict, Any
|
|
|
|
|
|
|
|
from core.config import CoreConfig
|
|
|
|
from titles.chuni.new import ChuniNew
|
|
|
|
from titles.chuni.const import ChuniConstants
|
|
|
|
from titles.chuni.config import ChuniConfig
|
|
|
|
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
class ChuniNewPlus(ChuniNew):
|
|
|
|
def __init__(self, core_cfg: CoreConfig, game_cfg: ChuniConfig) -> None:
|
|
|
|
super().__init__(core_cfg, game_cfg)
|
|
|
|
self.version = ChuniConstants.VER_CHUNITHM_NEW_PLUS
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
def handle_get_game_setting_api_request(self, data: Dict) -> Dict:
|
|
|
|
ret = super().handle_get_game_setting_api_request(data)
|
2023-04-24 03:04:52 +02:00
|
|
|
ret["gameSetting"]["romVersion"] = self.game_cfg.version.version(self.version)[
|
|
|
|
"rom"
|
|
|
|
]
|
|
|
|
ret["gameSetting"]["dataVersion"] = self.game_cfg.version.version(self.version)[
|
|
|
|
"data"
|
|
|
|
]
|
2023-03-09 17:38:58 +01:00
|
|
|
ret["gameSetting"][
|
|
|
|
"matchingUri"
|
|
|
|
] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/"
|
|
|
|
ret["gameSetting"][
|
|
|
|
"matchingUriX"
|
|
|
|
] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/"
|
|
|
|
ret["gameSetting"][
|
|
|
|
"udpHolePunchUri"
|
|
|
|
] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/"
|
|
|
|
ret["gameSetting"][
|
|
|
|
"reflectorUri"
|
|
|
|
] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/"
|
2023-02-17 07:02:21 +01:00
|
|
|
return ret
|
2023-03-15 21:03:22 +01:00
|
|
|
|
|
|
|
def handle_cm_get_user_preview_api_request(self, data: Dict) -> Dict:
|
|
|
|
user_data = super().handle_cm_get_user_preview_api_request(data)
|
|
|
|
|
2023-05-10 21:32:35 +02:00
|
|
|
# hardcode lastDataVersion for CardMaker 1.35 A028
|
2023-03-15 21:03:22 +01:00
|
|
|
user_data["lastDataVersion"] = "2.05.00"
|
|
|
|
return user_data
|