forked from Hay1tsme/artemis
wacca: fix typing
This commit is contained in:
parent
9ad724d64b
commit
c26f6b7b1d
@ -9,6 +9,7 @@ from titles.wacca.const import WaccaConstants
|
|||||||
from titles.wacca.database import WaccaData
|
from titles.wacca.database import WaccaData
|
||||||
|
|
||||||
from titles.wacca.handlers import *
|
from titles.wacca.handlers import *
|
||||||
|
from core.const import AllnetCountryCode
|
||||||
|
|
||||||
class WaccaBase():
|
class WaccaBase():
|
||||||
def __init__(self, cfg: CoreConfig, game_cfg: WaccaConfig) -> None:
|
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]:
|
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.logger.warning(f"Invalid prefecture name {game_cfg.server.prefecture_name} in config file")
|
||||||
self.region_id = WaccaConstants.Region.HOKKAIDO
|
self.region_id = WaccaConstants.Region.HOKKAIDO
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.region_id = WaccaConstants.Region[prefecture_name]
|
self.region_id = WaccaConstants.Region[prefecture_name]
|
||||||
|
|
||||||
@ -94,10 +96,9 @@ class WaccaBase():
|
|||||||
machine = self.data.arcade.get_machine(req.chipId)
|
machine = self.data.arcade.get_machine(req.chipId)
|
||||||
if machine is not None:
|
if machine is not None:
|
||||||
arcade = self.data.arcade.get_arcade(machine["arcade"])
|
arcade = self.data.arcade.get_arcade(machine["arcade"])
|
||||||
|
|
||||||
allnet_region_id = arcade["region_id"]
|
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:
|
if allnet_region_id is not None:
|
||||||
region = WaccaConstants.allnet_region_id_to_wacca_region(allnet_region_id)
|
region = WaccaConstants.allnet_region_id_to_wacca_region(allnet_region_id)
|
||||||
|
|
||||||
|
@ -78,9 +78,9 @@ class Version(ShortVersion):
|
|||||||
super().__init__(version, major, minor, patch)
|
super().__init__(version, major, minor, patch)
|
||||||
split = version.split(".")
|
split = version.split(".")
|
||||||
if len(split) >= 6:
|
if len(split) >= 6:
|
||||||
self.country = split[3]
|
self.country: str = split[3]
|
||||||
self.build = int(split[4])
|
self.build = int(split[4])
|
||||||
self.role = split[5]
|
self.role: str = split[5]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.country = country
|
self.country = country
|
||||||
|
Loading…
Reference in New Issue
Block a user