From f060e1258a5a15759c369ef037aa317eac96ca38 Mon Sep 17 00:00:00 2001 From: PKAC Date: Tue, 19 Mar 2024 06:59:21 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20titles/fgoa/base.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- titles/fgoa/base.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 titles/fgoa/base.py diff --git a/titles/fgoa/base.py b/titles/fgoa/base.py new file mode 100644 index 0000000..9161cee --- /dev/null +++ b/titles/fgoa/base.py @@ -0,0 +1,30 @@ +from datetime import date, datetime, timedelta +from typing import Any, Dict, List +import json +import logging +from enum import Enum + +from core.config import CoreConfig +from titles.fgoa.config import FGOAConfig +from titles.fgoa.const import FGOAConstants + + +class FGOABase: + def __init__(self, core_cfg: CoreConfig, game_cfg: FGOAConfig) -> None: + self.core_cfg = core_cfg + self.game_config = game_cfg + self.date_time_format = "%Y-%m-%d %H:%M:%S" + self.date_time_format_ext = ( + "%Y-%m-%d %H:%M:%S.%f" # needs to be lopped off at [:-5] + ) + self.date_time_format_short = "%Y-%m-%d" + self.logger = logging.getLogger("fgoa") + self.game = FGOAConstants.GAME_CODE + self.version = FGOAConstants.VER_FGOA_SEASON_1 + + @staticmethod + def _parse_int_ver(version: str) -> str: + return version.replace(".", "")[:3] + + async def handle_game_init_request(self, data: Dict) -> Dict: + return f""