diff --git a/core/aimedb.py b/core/aimedb.py index b99d697..ea2ff4a 100644 --- a/core/aimedb.py +++ b/core/aimedb.py @@ -137,7 +137,7 @@ class AimedbServlette(): resp_bytes = resp elif resp is None: # Nothing to send, probably a goodbye - self.logger.warn(f"None return by handler for {name}") + self.logger.warning(f"None return by handler for {name}") return else: @@ -177,7 +177,7 @@ class AimedbServlette(): async def handle_lookup(self, data: bytes, resp_code: int) -> ADBBaseResponse: req = ADBLookupRequest(data) if req.access_code == "00000000000000000000": - self.logger.warn(f"All-zero access code from {req.head.keychip_id}") + self.logger.warning(f"All-zero access code from {req.head.keychip_id}") ret = ADBLookupResponse.from_req(req.head, -1) ret.head.status = ADBStatus.BAN_SYS return ret @@ -208,7 +208,7 @@ class AimedbServlette(): async def handle_lookup_ex(self, data: bytes, resp_code: int) -> ADBBaseResponse: req = ADBLookupRequest(data) if req.access_code == "00000000000000000000": - self.logger.warn(f"All-zero access code from {req.head.keychip_id}") + self.logger.warning(f"All-zero access code from {req.head.keychip_id}") ret = ADBLookupExResponse.from_req(req.head, -1) ret.head.status = ADBStatus.BAN_SYS return ret @@ -254,7 +254,7 @@ class AimedbServlette(): req = ADBFelicaLookupRequest(data) idm = req.idm.zfill(16) if idm == "0000000000000000": - self.logger.warn(f"All-zero IDm from {req.head.keychip_id}") + self.logger.warning(f"All-zero IDm from {req.head.keychip_id}") ret = ADBFelicaLookupResponse.from_req(req.head, "00000000000000000000") ret.head.status = ADBStatus.BAN_SYS return ret @@ -283,7 +283,7 @@ class AimedbServlette(): idm = req.idm.zfill(16) if idm == "0000000000000000": - self.logger.warn(f"All-zero IDm from {req.head.keychip_id}") + self.logger.warning(f"All-zero IDm from {req.head.keychip_id}") ret = ADBFelicaLookupResponse.from_req(req.head, "00000000000000000000") ret.head.status = ADBStatus.BAN_SYS return ret @@ -323,7 +323,7 @@ class AimedbServlette(): idm = req.idm.zfill(16) if idm == "0000000000000000": - self.logger.warn(f"All-zero IDm from {req.head.keychip_id}") + self.logger.warning(f"All-zero IDm from {req.head.keychip_id}") ret = ADBFelicaLookupExResponse.from_req(req.head, -1, "00000000000000000000") ret.head.status = ADBStatus.BAN_SYS return ret @@ -382,7 +382,7 @@ class AimedbServlette(): user_id = -1 if req.access_code == "00000000000000000000": - self.logger.warn(f"All-zero access code from {req.head.keychip_id}") + self.logger.warning(f"All-zero access code from {req.head.keychip_id}") ret = ADBLookupResponse.from_req(req.head, -1) ret.head.status = ADBStatus.BAN_SYS return ret diff --git a/core/allnet.py b/core/allnet.py index 43dde1f..0b6006b 100644 --- a/core/allnet.py +++ b/core/allnet.py @@ -609,7 +609,7 @@ class BillingServlet: traces.append(tmp) except KeyError as e: - self.logger.warn(f"Tracelog failed to parse: {e}") + self.logger.warning(f"Tracelog failed to parse: {e}") kc_serial_bytes = req.keychipid.encode() @@ -648,7 +648,7 @@ class BillingServlet: ) if req.traceleft > 0: - self.logger.warn(f"{req.traceleft} unsent tracelogs") + self.logger.warning(f"{req.traceleft} unsent tracelogs") kc_playlimit = req.playlimit kc_nearfull = req.nearfull diff --git a/core/data/database.py b/core/data/database.py index fb36ebd..f98fe33 100644 --- a/core/data/database.py +++ b/core/data/database.py @@ -223,7 +223,7 @@ class Data: async def legacy_upgrade(self) -> bool: vers = await self.base.execute("SELECT * FROM schema_versions") if vers is None: - self.logger.warn("Cannot legacy upgrade, schema_versions table unavailable!") + self.logger.warning("Cannot legacy upgrade, schema_versions table unavailable!") return False db_vers = {} @@ -252,7 +252,7 @@ class Data: game_codes = getattr(mod, "game_codes", []) for game in game_codes: if game not in db_vers: - self.logger.warn(f"{game} does not have an antry in schema_versions, skipping") + self.logger.warning(f"{game} does not have an antry in schema_versions, skipping") continue now_ver = int(db_vers[game]) + 1 diff --git a/core/data/schema/card.py b/core/data/schema/card.py index 254b19e..8705820 100644 --- a/core/data/schema/card.py +++ b/core/data/schema/card.py @@ -123,7 +123,7 @@ class CardData(BaseData): result = await self.execute(sql) if result is None: - self.logger.warn(f"Failed to update last login time for {access_code}") + self.logger.warning(f"Failed to update last login time for {access_code}") async def get_card_by_idm(self, idm: str) -> Optional[Row]: result = await self.execute(aime_card.select(aime_card.c.idm == idm)) diff --git a/core/frontend.py b/core/frontend.py index c593828..2e2fc2d 100644 --- a/core/frontend.py +++ b/core/frontend.py @@ -435,7 +435,7 @@ class FE_User(FE_Base): if user_id: if not self.test_perm(usr_sesh.permissions, PermissionOffset.USERMOD) and user_id != usr_sesh.user_id: - self.logger.warn(f"User {usr_sesh.user_id} does not have permission to view user {user_id}") + self.logger.warning(f"User {usr_sesh.user_id} does not have permission to view user {user_id}") return RedirectResponse("/user/", 303) else: @@ -939,7 +939,7 @@ class FE_Arcade(FE_Base): usr_sesh = self.validate_session(request) if not usr_sesh or not self.test_perm(usr_sesh.permissions, PermissionOffset.ACMOD): - self.logger.warn(f"User {usr_sesh.user_id} does not have permission to view shops!") + self.logger.warning(f"User {usr_sesh.user_id} does not have permission to view shops!") return RedirectResponse("/gate/", 303) if not shop_id: @@ -983,7 +983,7 @@ class FE_Machine(FE_Base): usr_sesh = self.validate_session(request) if not usr_sesh or not self.test_perm(usr_sesh.permissions, PermissionOffset.ACMOD): - self.logger.warn(f"User {usr_sesh.user_id} does not have permission to view shops!") + self.logger.warning(f"User {usr_sesh.user_id} does not have permission to view shops!") return RedirectResponse("/gate/", 303) if not cab_id: diff --git a/core/mucha.py b/core/mucha.py index 22e4789..d715a19 100644 --- a/core/mucha.py +++ b/core/mucha.py @@ -64,7 +64,7 @@ class MuchaServlet: self.logger.debug(f"Mucha request {vars(req)}") if not req.gameCd or not req.gameVer or not req.sendDate or not req.countryCd or not req.serialNum: - self.logger.warn(f"Missing required fields - {vars(req)}") + self.logger.warning(f"Missing required fields - {vars(req)}") return PlainTextResponse("RESULTS=000") minfo = self.mucha_registry.get(req.gameCd, {}) @@ -133,7 +133,7 @@ class MuchaServlet: self.logger.info(f"Allow unknown serial {netid} ({sn_decrypt}) to auth") else: - self.logger.warn(f'Auth failed for NetID {netid}') + self.logger.warning(f'Auth failed for NetID {netid}') return PlainTextResponse("RESULTS=000") self.logger.debug(f"Mucha response {vars(resp)}") diff --git a/core/title.py b/core/title.py index 016e09a..9165628 100644 --- a/core/title.py +++ b/core/title.py @@ -86,11 +86,11 @@ class BaseServlet: return (False, [], []) async def render_POST(self, request: Request) -> bytes: - self.logger.warn(f"Game Does not dispatch POST") + self.logger.warning(f"Game Does not dispatch POST") return Response() async def render_GET(self, request: Request) -> bytes: - self.logger.warn(f"Game Does not dispatch GET") + self.logger.warning(f"Game Does not dispatch GET") return Response() class TitleServlet: diff --git a/titles/chuni/frontend.py b/titles/chuni/frontend.py index 1faa23b..876e873 100644 --- a/titles/chuni/frontend.py +++ b/titles/chuni/frontend.py @@ -715,7 +715,7 @@ class ChuniFrontend(FE_Base): elif o < 0x7F and o > 0x20: new_name_full += chr(o + 0xFEE0) elif o <= 0x7F: - self.logger.warn(f"Invalid ascii character {o:02X}") + self.logger.warning(f"Invalid ascii character {o:02X}") return RedirectResponse("/gate/?e=4", 303) else: new_name_full += x diff --git a/titles/chuni/schema/profile.py b/titles/chuni/schema/profile.py index 8d71ba6..1362c9f 100644 --- a/titles/chuni/schema/profile.py +++ b/titles/chuni/schema/profile.py @@ -765,7 +765,7 @@ class ChuniProfileData(BaseData): existing_team = self.get_team_by_id(team_id) if existing_team is None or "userTeamPoint" not in existing_team: - self.logger.warn( + self.logger.warning( f"update_team: Failed to update team! team id: {team_id}. Existing team data not found." ) return False @@ -795,7 +795,7 @@ class ChuniProfileData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"update_team: Failed to update team! team id: {team_id}" ) return False @@ -813,7 +813,7 @@ class ChuniProfileData(BaseData): playcount_sql = await self.execute(select(profile.c.playCount)) if playcount_sql is None: - self.logger.warn( + self.logger.warning( f"get_overview: Couldn't pull playcounts" ) return 0 @@ -842,7 +842,7 @@ class ChuniProfileData(BaseData): result = await self.execute(sql) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_rating: Could not insert {rating_type}, aime_id: {aime_id}", ) return diff --git a/titles/cxb/index.py b/titles/cxb/index.py index a4e7085..e97c8c3 100644 --- a/titles/cxb/index.py +++ b/titles/cxb/index.py @@ -180,7 +180,7 @@ class CxbServlet(BaseServlet): internal_ver = CxbConstants.VER_CROSSBEATS_REV_SUNRISE_S2 if not hasattr(self.versions[internal_ver], func_to_find): - self.logger.warn(f"{version_string} has no handler for filetype {filetype} / {func_to_find}") + self.logger.warning(f"{version_string} has no handler for filetype {filetype} / {func_to_find}") return JSONResponse({"data":""}) self.logger.info(f"{version_string} request for filetype {filetype}") @@ -209,7 +209,7 @@ class CxbServlet(BaseServlet): func_to_find = f"handle_action_{subcmd}_request" if not hasattr(self.versions[0], func_to_find): - self.logger.warn(f"No handler for action {subcmd} request") + self.logger.warning(f"No handler for action {subcmd} request") return Response() self.logger.info(f"Action {subcmd} Request") @@ -238,7 +238,7 @@ class CxbServlet(BaseServlet): func_to_find = f"handle_auth_{subcmd}_request" if not hasattr(self.versions[0], func_to_find): - self.logger.warn(f"No handler for auth {subcmd} request") + self.logger.warning(f"No handler for auth {subcmd} request") return Response() self.logger.info(f"Action {subcmd} Request") diff --git a/titles/cxb/read.py b/titles/cxb/read.py index c8d4616..73a95d1 100644 --- a/titles/cxb/read.py +++ b/titles/cxb/read.py @@ -32,7 +32,7 @@ class CxbReader(BaseReader): await self.read_csv(self.bin_dir) else: - self.logger.warn(f"{self.bin_dir} does not exist, nothing to import") + self.logger.warning(f"{self.bin_dir} does not exist, nothing to import") async def read_csv(self, bin_dir: str) -> None: self.logger.info(f"Read csv from {bin_dir}") diff --git a/titles/diva/frontend.py b/titles/diva/frontend.py index 0b50dc4..30ee6ac 100644 --- a/titles/diva/frontend.py +++ b/titles/diva/frontend.py @@ -130,7 +130,7 @@ class DivaFrontend(FE_Base): elif o < 0x7F and o > 0x20: new_name_full += chr(o + 0xFEE0) elif o <= 0x7F: - self.logger.warn(f"Invalid ascii character {o:02X}") + self.logger.warning(f"Invalid ascii character {o:02X}") return RedirectResponse("/gate/?e=4", 303) else: new_name_full += x @@ -167,7 +167,7 @@ class DivaFrontend(FE_Base): elif o < 0x7F and o > 0x20: new_lv_full += chr(o + 0xFEE0) elif o <= 0x7F: - self.logger.warn(f"Invalid ascii character {o:02X}") + self.logger.warning(f"Invalid ascii character {o:02X}") return RedirectResponse("/gate/?e=4", 303) else: new_lv_full += x diff --git a/titles/idac/schema/item.py b/titles/idac/schema/item.py index d617cd9..c3596a4 100644 --- a/titles/idac/schema/item.py +++ b/titles/idac/schema/item.py @@ -772,7 +772,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_car: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_car: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -784,7 +784,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_ticket: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_ticket: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -796,7 +796,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_story: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_story: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -811,7 +811,7 @@ class IDACItemData(BaseData): result = await self.execute(sql) if result is None: - self.logger.warn( + self.logger.warning( f"put_story_episode_play_status: Failed to update! aime_id: {aime_id}" ) return None @@ -828,7 +828,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_story_episode: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_story_episode: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -843,7 +843,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_story_episode_difficulty: Failed to update! aime_id: {aime_id}" ) return None @@ -857,7 +857,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_course: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_course: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -872,7 +872,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_time_trial: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_time_trial: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -884,7 +884,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_challenge: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_challenge: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -898,7 +898,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_theory_course: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_theory_course: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -912,7 +912,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_theory_partner: Failed to update! aime_id: {aime_id}" ) return None @@ -928,7 +928,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_theory_running: Failed to update! aime_id: {aime_id}" ) return None @@ -942,7 +942,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_vs_info: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_vs_info: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -956,7 +956,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"putstamp: Failed to update! aime_id: {aime_id}" ) return None @@ -976,7 +976,7 @@ class IDACItemData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_timetrial_event: Failed to update! aime_id: {aime_id}" ) return None diff --git a/titles/idac/schema/profile.py b/titles/idac/schema/profile.py index bb6593b..6eb2254 100644 --- a/titles/idac/schema/profile.py +++ b/titles/idac/schema/profile.py @@ -360,7 +360,7 @@ class IDACProfileData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_profile: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_profile: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -372,7 +372,7 @@ class IDACProfileData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_config: Failed to update! aime_id: {aime_id}" ) return None @@ -386,7 +386,7 @@ class IDACProfileData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_avatar: Failed to update! aime_id: {aime_id}" ) return None @@ -403,7 +403,7 @@ class IDACProfileData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_profile_rank: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_profile_rank: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -418,7 +418,7 @@ class IDACProfileData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn(f"put_profile_stock: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_profile_stock: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -433,7 +433,7 @@ class IDACProfileData(BaseData): result = await self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_theory: Failed to update! aime_id: {aime_id}" ) return None diff --git a/titles/mai2/base.py b/titles/mai2/base.py index e148533..5d1c767 100644 --- a/titles/mai2/base.py +++ b/titles/mai2/base.py @@ -514,7 +514,7 @@ class Mai2Base: continue # present period hasn't started yet, move onto the next one if (present['endDate'] and present['endDate'].timestamp() < datetime.now().timestamp()): - self.logger.warn(f"Present {present['id']} ended on {present['endDate']} and should be removed") + self.logger.warning(f"Present {present['id']} ended on {present['endDate']} and should be removed") continue # present period ended, move onto the next one test = await self.data.item.get_item(data["userId"], present['itemKind'], present['itemId']) diff --git a/titles/mai2/frontend.py b/titles/mai2/frontend.py index 9667eca..f8a7176 100644 --- a/titles/mai2/frontend.py +++ b/titles/mai2/frontend.py @@ -212,7 +212,7 @@ class Mai2Frontend(FE_Base): elif o < 0x7F and o > 0x20: new_name_full += chr(o + 0xFEE0) elif o <= 0x7F: - self.logger.warn(f"Invalid ascii character {o:02X}") + self.logger.warning(f"Invalid ascii character {o:02X}") return RedirectResponse("/gate/?e=4", 303) else: new_name_full += x diff --git a/titles/ongeki/read.py b/titles/ongeki/read.py index 98aaf67..18f1e8a 100644 --- a/titles/ongeki/read.py +++ b/titles/ongeki/read.py @@ -43,7 +43,7 @@ class OngekiReader(BaseReader): node = troot.find("VersionID").find("id") if node.text not in version_ids: - self.logger.warn(f"Unknown VersionID {node.text}") + self.logger.warning(f"Unknown VersionID {node.text}") return OngekiConstants.VER_ONGEKI_BRIGHT_MEMORY return version_ids[node.text] diff --git a/titles/ongeki/schema/profile.py b/titles/ongeki/schema/profile.py index b42a0a3..db6a323 100644 --- a/titles/ongeki/schema/profile.py +++ b/titles/ongeki/schema/profile.py @@ -554,7 +554,7 @@ class OngekiProfileData(BaseData): result = await self.execute(sql) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_rating_{rating_type}: Could not insert rating entries, aime_id: {aime_id}", ) return diff --git a/titles/pokken/base.py b/titles/pokken/base.py index 78ca863..f9a622a 100644 --- a/titles/pokken/base.py +++ b/titles/pokken/base.py @@ -38,7 +38,7 @@ class PokkenBase: pcbid = request.register_pcb.pcb_id if not pcbid.isdigit() or len(pcbid) != 12 or \ not pcbid.startswith(f"{PokkenConstants.SERIAL_IDENT[0]}{PokkenConstants.SERIAL_REGIONS[0]}{PokkenConstants.SERIAL_ROLES[0]}{PokkenConstants.SERIAL_CAB_IDENTS[0]}"): - self.logger.warn(f"Bad PCBID {pcbid}") + self.logger.warning(f"Bad PCBID {pcbid}") res.result = 0 return res @@ -49,12 +49,12 @@ class PokkenBase: minfo = await self.data.arcade.get_machine(netid) if not minfo and not self.core_cfg.server.allow_unregistered_serials: - self.logger.warn(f"netID {netid} does not belong to any shop!") + self.logger.warning(f"netID {netid} does not belong to any shop!") res.result = 0 return res elif not minfo: - self.logger.warn(f"Orphaned netID {netid} allowed to connect") + self.logger.warning(f"Orphaned netID {netid} allowed to connect") locid = 0 else: diff --git a/titles/sao/base.py b/titles/sao/base.py index 759d35b..45cee9f 100644 --- a/titles/sao/base.py +++ b/titles/sao/base.py @@ -132,7 +132,7 @@ class SaoBase: await self.data.profile.add_yui_medals(user_id, medal_num) else: - self.logger.warn(f"User {user_id} Unhandled reward type {reward_type} -> {reward}") + self.logger.warning(f"User {user_id} Unhandled reward type {reward_type} -> {reward}") async def hero_default_skills(self, skill_table_id: int) -> List[int]: skills = await self.data.static.get_skill_table_by_subid(skill_table_id) @@ -370,7 +370,7 @@ class SaoBase: if not card: # Validate that we're talking to a phone if not int(pmm[2:4], 16) in self.data.card.moble_os_codes: - self.logger.warn(f"{req.serial_no} looked up non-moble chip ID {cid}!") + self.logger.warning(f"{req.serial_no} looked up non-moble chip ID {cid}!") return SaoGetAccessCodeByKeitaiResponse("").make() # TODO: Actual felica moble registration @@ -378,7 +378,7 @@ class SaoBase: #ac = await self.data.card.register_felica_moble_ac(idm, pmm) # if we didn't get an access code, fail hard if not ac: - self.logger.warn(f"Failed to register access code for chip ID {cid} requested by {req.serial_no}") + self.logger.warning(f"Failed to register access code for chip ID {cid} requested by {req.serial_no}") return SaoGetAccessCodeByKeitaiResponse("").make() self.logger.info(f"Successfully registered moble felica access code {ac} for chip ID {cid} requested by {req.serial_no}") @@ -416,14 +416,14 @@ class SaoBase: async def handle_c126(self, header: SaoRequestHeader, request: bytes, src_ip: str) -> bytes: # common/validation_error_notification req = SaoValidationErrorNotificationRequest(header, request) - self.logger.warn(f"User {req.user_id} on {'game' if req.cabinet_type == 0 else 'terminal'} {req.serial_no} @ {req.store_name} ({src_ip} | Place ID {req.place_id}) " \ + self.logger.warning(f"User {req.user_id} on {'game' if req.cabinet_type == 0 else 'terminal'} {req.serial_no} @ {req.store_name} ({src_ip} | Place ID {req.place_id}) " \ + f"Validation error: {req.send_protocol_name} || {req.send_data_to_fraud_value} || {req.send_data_to_modification_value}") return SaoNoopResponse(GameconnectCmd.VALIDATION_ERROR_NOTIFICATION_RESPONSE).make() async def handle_c128(self, header: SaoRequestHeader, request: bytes, src_ip: str) -> bytes: # common/power_cutting_return_notification req = SaoPowerCuttingReturnNotification(header, request) - self.logger.warn(f"User {req.user_id} on {'game' if req.cabinet_type == 0 else 'terminal'} {req.serial_no} @ {req.store_name} ({src_ip} | Place ID {req.place_id}) " \ + self.logger.warning(f"User {req.user_id} on {'game' if req.cabinet_type == 0 else 'terminal'} {req.serial_no} @ {req.store_name} ({src_ip} | Place ID {req.place_id}) " \ + f"Power outage return: Act Type {req.last_act_type} || {req.remaining_ticket_num} Remaining Tickets || {req.remaining_credit_num} Remaining Credits") return SaoNoopResponse(GameconnectCmd.POWER_CUTTING_RETURN_NOTIFICATION_RESPONSE).make() @@ -437,7 +437,7 @@ class SaoBase: async def handle_c12c(self, header: SaoRequestHeader, request: bytes, src_ip: str) -> bytes: # common/matching_error_notification req = SaoMatchingErrorNotificationRequest(header, request) - self.logger.warn(f"{'game' if req.cabinet_type == 0 else 'terminal'} {req.serial_no} @ {req.store_name} ({src_ip} | Place ID {req.place_id}) " \ + self.logger.warning(f"{'game' if req.cabinet_type == 0 else 'terminal'} {req.serial_no} @ {req.store_name} ({src_ip} | Place ID {req.place_id}) " \ + f"Matching error: {req.matching_error_data_list[0]}") return SaoNoopResponse(GameconnectCmd.MATCHING_ERROR_NOTIFICATION_RESPONSE).make() @@ -547,22 +547,22 @@ class SaoBase: card = await self.data.profile.get_hero_card(req.profile_card_code) if not card: - self.logger.warn(f"User {req.user_id} scanned unregistered QR code {req.profile_card_code}") + self.logger.warning(f"User {req.user_id} scanned unregistered QR code {req.profile_card_code}") return resp.make() hero = await self.data.item.get_hero_log_by_id(card['user_hero_id']) if not hero: # Shouldn't happen - self.logger.warn(f"User {req.user_id} scanned QR code {req.profile_card_code} but does not have hero entry {card['user_hero_id']}") + self.logger.warning(f"User {req.user_id} scanned QR code {req.profile_card_code} but does not have hero entry {card['user_hero_id']}") return resp.make() hero_static_data = await self.data.static.get_hero_by_id(hero['hero_log_id']) if not hero_static_data: # Shouldn't happen - self.logger.warn(f"No entry for hero {hero['hero_log_id']}, please run read.py") + self.logger.warning(f"No entry for hero {hero['hero_log_id']}, please run read.py") return resp.make() profile = await self.data.profile.get_profile(card['user']) if not profile: # Shouldn't happen - self.logger.warn(f"No profile for user {card['user']}, something broke") + self.logger.warning(f"No profile for user {card['user']}, something broke") return resp.make() self.logger.info(f"User {req.user_id} scanned QR code {req.profile_card_code}") @@ -587,7 +587,7 @@ class SaoBase: card = await self.data.profile.get_resource_card(req.resource_card_code) # TODO: use count if not card: - self.logger.warn(f"No resource card with serial {req.resource_card_code} exists!") + self.logger.warning(f"No resource card with serial {req.resource_card_code} exists!") resp.header.err_status = 4832 # Theres a few error codes but none seem to do anything? # Also not sure if it should be this or result @@ -603,7 +603,7 @@ class SaoBase: resp = SaoScanQrQuestResourceCardResponse(card['common_reward_type'], card['common_reward_id'], card['holographic_flag']) else: - self.logger.warn(f"No resource card with serial {req.resource_card_code} exists!") + self.logger.warning(f"No resource card with serial {req.resource_card_code} exists!") resp = SaoScanQrQuestResourceCardResponse() resp.header.err_status = 4832 # Theres a few error codes but none seem to do anything? # Also not sure if it should be this or result @@ -719,7 +719,7 @@ class SaoBase: append = HeroLogUserData.from_args(hero) hero_static = await self.data.static.get_hero_by_id(hero['hero_log_id']) if not hero_static: - self.logger.warn(f"No hero for id {hero['hero_log_id']}, please run reader") + self.logger.warning(f"No hero for id {hero['hero_log_id']}, please run reader") resp.hero_log_user_data_list.append(append) continue @@ -757,7 +757,7 @@ class SaoBase: e = EquipmentUserData.from_args(equipment) weapon_static = await self.data.static.get_equipment_by_id(equipment['equipment_id']) if not weapon_static: - self.logger.warn(f"No equipment for id {equipment['equipment_id']}, please run reader") + self.logger.warning(f"No equipment for id {equipment['equipment_id']}, please run reader") resp.equipment_user_data_list.append(e) continue @@ -917,7 +917,7 @@ class SaoBase: continue else: - self.logger.warn(f"Unhandled disposal type {disposal.common_reward_type}") + self.logger.warning(f"Unhandled disposal type {disposal.common_reward_type}") await self.data.profile.add_col(req.user_id, get_col) return SaoDisposalResourceResponse(get_col).make() @@ -978,7 +978,7 @@ class SaoBase: await self.data.item.remove_hero_log(x.user_common_reward_id) else: - self.logger.warn(f"Unhandled ype {x.common_reward_type}! (running {hero_exp})") + self.logger.warning(f"Unhandled ype {x.common_reward_type}! (running {hero_exp})") hero_exp = int(hero_exp * 1.5) await self.data.item.add_hero_xp(req.origin_user_hero_log_id, hero_exp) @@ -1072,7 +1072,7 @@ class SaoBase: await self.data.item.remove_hero_log(x.user_common_reward_id) else: - self.logger.warn(f"Unhandled ype {x.common_reward_type}! (running {equipment_exp})") + self.logger.warning(f"Unhandled ype {x.common_reward_type}! (running {equipment_exp})") equipment_exp = int(equipment_exp * 1.5) await self.data.item.add_equipment_enhancement_exp(req_data.origin_user_equipment_id, equipment_exp) @@ -1322,7 +1322,7 @@ class SaoBase: # TODO pass else: - self.logger.warn(f"Unhandled EX Bonus condition {condition}") + self.logger.warning(f"Unhandled EX Bonus condition {condition}") resp.play_end_response_data[0].ex_bonus_data_list.append(QuestScenePlayEndExBonusData.from_args(table_id, ach_thing)) @@ -1550,7 +1550,7 @@ class SaoBase: # TODO pass else: - self.logger.warn(f"Unhandled EX Bonus condition {condition}") + self.logger.warning(f"Unhandled EX Bonus condition {condition}") resp.play_end_response_data[0].ex_bonus_data_list.append(QuestScenePlayEndExBonusData.from_args(table_id, ach_thing)) diff --git a/titles/sao/index.py b/titles/sao/index.py index 8a775c6..43484d8 100644 --- a/titles/sao/index.py +++ b/titles/sao/index.py @@ -103,7 +103,7 @@ class SaoServlet(BaseServlet): req_raw = await request.body() if len(req_raw) < 40: - self.logger.warn(f"Malformed request to {endpoint} - {req_raw.hex()}") + self.logger.warning(f"Malformed request to {endpoint} - {req_raw.hex()}") return Response() req_header = SaoRequestHeader(req_raw) diff --git a/titles/sao/read.py b/titles/sao/read.py index 6299bc4..0148ed0 100644 --- a/titles/sao/read.py +++ b/titles/sao/read.py @@ -26,7 +26,7 @@ class SaoReader(BaseReader): await self.read_csv(f"{self.bin_dir}") else: - self.logger.warn("Directory not found, nothing to import") + self.logger.warning("Directory not found, nothing to import") def load_csv_file(self, file: str) -> List[Dict]: ret = []