From 82c5ae3ad765eb22fdffb4e3452692c59ae896a3 Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Thu, 7 Dec 2023 16:07:17 -0500 Subject: [PATCH] wacca: fix housing/start on lilyr and above --- titles/wacca/lilyr.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/titles/wacca/lilyr.py b/titles/wacca/lilyr.py index 0bb12ed..e3162d6 100644 --- a/titles/wacca/lilyr.py +++ b/titles/wacca/lilyr.py @@ -3,11 +3,14 @@ from datetime import datetime, timedelta import json from core.config import CoreConfig +from titles.wacca.handlers import Dict from titles.wacca.lily import WaccaLily from titles.wacca.config import WaccaConfig from titles.wacca.const import WaccaConstants from titles.wacca.handlers import * +from core.const import AllnetCountryCode + class WaccaLilyR(WaccaLily): def __init__(self, cfg: CoreConfig, game_cfg: WaccaConfig) -> None: @@ -36,6 +39,37 @@ class WaccaLilyR(WaccaLily): (210003, 0), ] + def handle_housing_start_request(self, data: Dict) -> Dict: + req = HousingStartRequestV2(data) + + machine = self.data.arcade.get_machine(req.chipId) + if machine is not None: + arcade = self.data.arcade.get_arcade(machine["arcade"]) + allnet_region_id = arcade["region_id"] + + if req.appVersion.country == AllnetCountryCode.JAPAN.value: + if allnet_region_id is not None: + region = WaccaConstants.allnet_region_id_to_wacca_region( + allnet_region_id + ) + + if region is None: + region_id = self.region_id + else: + region_id = region + + else: + region_id = self.region_id + + elif req.appVersion.country in WaccaConstants.VALID_COUNTRIES: + region_id = WaccaConstants.Region[req.appVersion.country] + + else: + region_id = WaccaConstants.Region.NONE + + resp = HousingStartResponseV1(region_id) + return resp.make() + def handle_user_status_create_request(self, data: Dict) -> Dict: req = UserStatusCreateRequest(data) resp = super().handle_user_status_create_request(data)