From c26f6b7b1d500b052140079dcad99ca2630e3c70 Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Fri, 3 Mar 2023 16:31:42 -0500 Subject: [PATCH] wacca: fix typing --- titles/wacca/base.py | 5 +++-- titles/wacca/handlers/helpers.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/titles/wacca/base.py b/titles/wacca/base.py index 9867d5a..2e5001f 100644 --- a/titles/wacca/base.py +++ b/titles/wacca/base.py @@ -9,6 +9,7 @@ from titles.wacca.const import WaccaConstants from titles.wacca.database import WaccaData from titles.wacca.handlers import * +from core.const import AllnetCountryCode class WaccaBase(): def __init__(self, cfg: CoreConfig, game_cfg: WaccaConfig) -> None: @@ -74,6 +75,7 @@ class WaccaBase(): if prefecture_name not in [region.name for region in WaccaConstants.Region]: self.logger.warning(f"Invalid prefecture name {game_cfg.server.prefecture_name} in config file") self.region_id = WaccaConstants.Region.HOKKAIDO + else: self.region_id = WaccaConstants.Region[prefecture_name] @@ -94,10 +96,9 @@ class WaccaBase(): 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 == "JPN": + 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) diff --git a/titles/wacca/handlers/helpers.py b/titles/wacca/handlers/helpers.py index 1192237..b96b3dd 100644 --- a/titles/wacca/handlers/helpers.py +++ b/titles/wacca/handlers/helpers.py @@ -78,9 +78,9 @@ class Version(ShortVersion): super().__init__(version, major, minor, patch) split = version.split(".") if len(split) >= 6: - self.country = split[3] + self.country: str = split[3] self.build = int(split[4]) - self.role = split[5] + self.role: str = split[5] else: self.country = country