From 88a1462304b819eb7e0221e52c37b8c9fa7cb298 Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Tue, 8 Aug 2023 10:17:56 -0400 Subject: [PATCH] logger: change from warn to warning --- core/allnet.py | 12 +++++------ core/data/database.py | 12 +++++------ core/data/schema/arcade.py | 1 + core/frontend.py | 2 +- core/mucha.py | 4 ++-- core/title.py | 10 ++++----- index.py | 4 ++-- titles/chuni/base.py | 4 ++-- titles/chuni/read.py | 12 +++++------ titles/chuni/schema/item.py | 6 +++--- titles/chuni/schema/profile.py | 14 ++++++------- titles/chuni/schema/static.py | 10 ++++----- titles/cm/read.py | 2 +- titles/cxb/base.py | 2 +- titles/cxb/index.py | 6 +++--- titles/cxb/read.py | 4 ++-- titles/diva/read.py | 10 ++++----- titles/idz/userdb.py | 4 ++-- titles/mai2/base.py | 22 ++++++++++---------- titles/mai2/dx.py | 2 +- titles/mai2/read.py | 12 +++++------ titles/mai2/schema/item.py | 20 +++++++++--------- titles/mai2/schema/profile.py | 22 ++++++++++---------- titles/mai2/schema/static.py | 6 +++--- titles/ongeki/schema/item.py | 36 ++++++++++++++++----------------- titles/ongeki/schema/log.py | 2 +- titles/ongeki/schema/profile.py | 18 ++++++++--------- titles/ongeki/schema/score.py | 6 +++--- titles/ongeki/schema/static.py | 10 ++++----- titles/pokken/index.py | 6 +++--- titles/pokken/schema/item.py | 2 +- titles/pokken/schema/profile.py | 10 ++++----- titles/sao/read.py | 16 +++++++-------- titles/wacca/base.py | 8 ++++---- titles/wacca/index.py | 2 +- titles/wacca/lily.py | 4 ++-- titles/wacca/read.py | 2 +- titles/wacca/reverse.py | 2 +- titles/wacca/schema/item.py | 2 +- titles/wacca/schema/profile.py | 2 +- titles/wacca/schema/score.py | 2 +- titles/wacca/schema/static.py | 2 +- 42 files changed, 168 insertions(+), 167 deletions(-) diff --git a/core/allnet.py b/core/allnet.py index 7946fdd..1a9ae5b 100644 --- a/core/allnet.py +++ b/core/allnet.py @@ -109,7 +109,7 @@ class AllnetServlet: self.data.base.log_event( "allnet", "ALLNET_AUTH_UNKNOWN_GAME", logging.WARN, msg ) - self.logger.warn(msg) + self.logger.warning(msg) resp.stat = -1 resp_dict = {k: v for k, v in vars(resp).items() if v is not None} @@ -136,7 +136,7 @@ class AllnetServlet: self.data.base.log_event( "allnet", "ALLNET_AUTH_UNKNOWN_SERIAL", logging.WARN, msg ) - self.logger.warn(msg) + self.logger.warning(msg) resp.stat = -2 resp_dict = {k: v for k, v in vars(resp).items() if v is not None} @@ -259,7 +259,7 @@ class AllnetServlet: try: req_dict: Dict = json.loads(req_raw) except Exception as e: - self.logger.warn(f"Failed to parse DL Report: {e}") + self.logger.warning(f"Failed to parse DL Report: {e}") return "NG" dl_data_type = DLIMG_TYPE.app @@ -270,13 +270,13 @@ class AllnetServlet: dl_data = req_dict.get("optimage", {}) if dl_data is None or not dl_data: - self.logger.warn(f"Failed to parse DL Report: Invalid format - contains neither appimage nor optimage") + self.logger.warning(f"Failed to parse DL Report: Invalid format - contains neither appimage nor optimage") return "NG" dl_report_data = DLReport(dl_data, dl_data_type) if not dl_report_data.validate(): - self.logger.warn(f"Failed to parse DL Report: Invalid format - {dl_report_data.err}") + self.logger.warning(f"Failed to parse DL Report: Invalid format - {dl_report_data.err}") return "NG" return "OK" @@ -334,7 +334,7 @@ class AllnetServlet: self.data.base.log_event( "allnet", "BILLING_CHECKIN_NG_SERIAL", logging.WARN, msg ) - self.logger.warn(msg) + self.logger.warning(msg) resp = BillingResponse("", "", "", "") resp.result = "1" diff --git a/core/data/database.py b/core/data/database.py index 51c170b..e39d864 100644 --- a/core/data/database.py +++ b/core/data/database.py @@ -15,7 +15,7 @@ from core.utils import Utils class Data: - current_schema_version = 5 + current_schema_version = 6 engine = None session = None user = None @@ -163,7 +163,7 @@ class Data: version = mod.current_schema_version else: - self.logger.warn( + self.logger.warning( f"current_schema_version not found for {folder}" ) @@ -171,7 +171,7 @@ class Data: version = self.current_schema_version if version is None: - self.logger.warn( + self.logger.warning( f"Could not determine latest version for {game}, please specify --version" ) @@ -254,7 +254,7 @@ class Data: self.logger.error(f"Failed to create card for owner with id {user_id}") return - self.logger.warn( + self.logger.warning( f"Successfully created owner with email {email}, access code 00000000000000000000, and password {pw} Make sure to change this password and assign a real card ASAP!" ) @@ -269,7 +269,7 @@ class Data: return if not should_force: - self.logger.warn( + self.logger.warning( f"Card already exists for access code {new_ac} (id {new_card['id']}). If you wish to continue, rerun with the '--force' flag." f" All exiting data on the target card {new_ac} will be perminently erased and replaced with data from card {old_ac}." ) @@ -307,7 +307,7 @@ class Data: def autoupgrade(self) -> None: all_game_versions = self.base.get_all_schema_vers() if all_game_versions is None: - self.logger.warn("Failed to get schema versions") + self.logger.warning("Failed to get schema versions") return all_games = Utils.get_all_titles() diff --git a/core/data/schema/arcade.py b/core/data/schema/arcade.py index c45541b..cf244cc 100644 --- a/core/data/schema/arcade.py +++ b/core/data/schema/arcade.py @@ -22,6 +22,7 @@ arcade = Table( Column("city", String(255)), Column("region_id", Integer), Column("timezone", String(255)), + Column("ip", String(39)), mysql_charset="utf8mb4", ) diff --git a/core/frontend.py b/core/frontend.py index a79bd94..7b028ee 100644 --- a/core/frontend.py +++ b/core/frontend.py @@ -231,7 +231,7 @@ class FE_Gate(FE_Base): user = self.data.user.get_user(card['user']) if user is None: - self.logger.warn(f"Card {ac} exists with no/invalid associated user ID {card['user']}") + self.logger.warning(f"Card {ac} exists with no/invalid associated user ID {card['user']}") return redirectTo(b"/gate?e=0", request) if user['password'] is not None: diff --git a/core/mucha.py b/core/mucha.py index 8d9dd8e..43da554 100644 --- a/core/mucha.py +++ b/core/mucha.py @@ -64,7 +64,7 @@ class MuchaServlet: self.logger.debug(f"Mucha request {vars(req)}") if req.gameCd not in self.mucha_registry: - self.logger.warn(f"Unknown gameCd {req.gameCd}") + self.logger.warning(f"Unknown gameCd {req.gameCd}") return b"RESULTS=000" # TODO: Decrypt S/N @@ -99,7 +99,7 @@ class MuchaServlet: self.logger.debug(f"Mucha request {vars(req)}") if req.gameCd not in self.mucha_registry: - self.logger.warn(f"Unknown gameCd {req.gameCd}") + self.logger.warning(f"Unknown gameCd {req.gameCd}") return b"RESULTS=000" resp = MuchaUpdateResponse(req.gameVer, f"{self.config.mucha.hostname}{':' + str(self.config.allnet.port) if self.config.server.is_develop else ''}") diff --git a/core/title.py b/core/title.py index ab53773..5006898 100644 --- a/core/title.py +++ b/core/title.py @@ -62,7 +62,7 @@ class TitleServlet: self.title_registry[code] = handler_cls else: - self.logger.warn(f"Game {folder} has no get_allnet_info") + self.logger.warning(f"Game {folder} has no get_allnet_info") else: self.logger.error(f"{folder} missing game_code or index in __init__.py") @@ -74,13 +74,13 @@ class TitleServlet: def render_GET(self, request: Request, endpoints: dict) -> bytes: code = endpoints["game"] if code not in self.title_registry: - self.logger.warn(f"Unknown game code {code}") + self.logger.warning(f"Unknown game code {code}") request.setResponseCode(404) return b"" index = self.title_registry[code] if not hasattr(index, "render_GET"): - self.logger.warn(f"{code} does not dispatch GET") + self.logger.warning(f"{code} does not dispatch GET") request.setResponseCode(405) return b"" @@ -89,13 +89,13 @@ class TitleServlet: def render_POST(self, request: Request, endpoints: dict) -> bytes: code = endpoints["game"] if code not in self.title_registry: - self.logger.warn(f"Unknown game code {code}") + self.logger.warning(f"Unknown game code {code}") request.setResponseCode(404) return b"" index = self.title_registry[code] if not hasattr(index, "render_POST"): - self.logger.warn(f"{code} does not dispatch POST") + self.logger.warning(f"{code} does not dispatch POST") request.setResponseCode(405) return b"" diff --git a/index.py b/index.py index 1a6e4fd..0c36e81 100644 --- a/index.py +++ b/index.py @@ -216,11 +216,11 @@ class HttpDispatcher(resource.Resource): return ret elif ret is None: - self.logger.warn(f"None returned by controller for {request.uri.decode()} endpoint") + self.logger.warning(f"None returned by controller for {request.uri.decode()} endpoint") return b"" else: - self.logger.warn(f"Unknown data type returned by controller for {request.uri.decode()} endpoint") + self.logger.warning(f"Unknown data type returned by controller for {request.uri.decode()} endpoint") return b"" diff --git a/titles/chuni/base.py b/titles/chuni/base.py index 4c4361c..0b468d0 100644 --- a/titles/chuni/base.py +++ b/titles/chuni/base.py @@ -73,7 +73,7 @@ class ChuniBase: # skip the current bonus preset if no boni were found if all_login_boni is None or len(all_login_boni) < 1: - self.logger.warn( + self.logger.warning( f"No bonus entries found for bonus preset {preset['presetId']}" ) continue @@ -149,7 +149,7 @@ class ChuniBase: game_events = self.data.static.get_enabled_events(self.version) if game_events is None or len(game_events) == 0: - self.logger.warn("No enabled events, did you run the reader?") + self.logger.warning("No enabled events, did you run the reader?") return { "type": data["type"], "length": 0, diff --git a/titles/chuni/read.py b/titles/chuni/read.py index 9ac13c4..0051e5b 100644 --- a/titles/chuni/read.py +++ b/titles/chuni/read.py @@ -67,7 +67,7 @@ class ChuniReader(BaseReader): if result is not None: self.logger.info(f"Inserted login bonus preset {id}") else: - self.logger.warn(f"Failed to insert login bonus preset {id}") + self.logger.warning(f"Failed to insert login bonus preset {id}") for bonus in xml_root.find("infos").findall("LoginBonusDataInfo"): for name in bonus.findall("loginBonusName"): @@ -113,7 +113,7 @@ class ChuniReader(BaseReader): if result is not None: self.logger.info(f"Inserted login bonus {bonus_id}") else: - self.logger.warn( + self.logger.warning( f"Failed to insert login bonus {bonus_id}" ) @@ -138,7 +138,7 @@ class ChuniReader(BaseReader): if result is not None: self.logger.info(f"Inserted event {id}") else: - self.logger.warn(f"Failed to insert event {id}") + self.logger.warning(f"Failed to insert event {id}") def read_music(self, music_dir: str) -> None: for root, dirs, files in walk(music_dir): @@ -200,7 +200,7 @@ class ChuniReader(BaseReader): f"Inserted music {song_id} chart {chart_id}" ) else: - self.logger.warn( + self.logger.warning( f"Failed to insert music {song_id} chart {chart_id}" ) @@ -232,7 +232,7 @@ class ChuniReader(BaseReader): if result is not None: self.logger.info(f"Inserted charge {id}") else: - self.logger.warn(f"Failed to insert charge {id}") + self.logger.warning(f"Failed to insert charge {id}") def read_avatar(self, avatar_dir: str) -> None: for root, dirs, files in walk(avatar_dir): @@ -259,4 +259,4 @@ class ChuniReader(BaseReader): if result is not None: self.logger.info(f"Inserted avatarAccessory {id}") else: - self.logger.warn(f"Failed to insert avatarAccessory {id}") + self.logger.warning(f"Failed to insert avatarAccessory {id}") diff --git a/titles/chuni/schema/item.py b/titles/chuni/schema/item.py index 47ff633..dc2751d 100644 --- a/titles/chuni/schema/item.py +++ b/titles/chuni/schema/item.py @@ -530,7 +530,7 @@ class ChuniItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_user_gacha: Failed to insert! aime_id: {aime_id}") + self.logger.warning(f"put_user_gacha: Failed to insert! aime_id: {aime_id}") return None return result.lastrowid @@ -572,7 +572,7 @@ class ChuniItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_user_print_state: Failed to insert! aime_id: {aime_id}" ) return None @@ -589,7 +589,7 @@ class ChuniItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_user_print_detail: Failed to insert! aime_id: {aime_id}" ) return None diff --git a/titles/chuni/schema/profile.py b/titles/chuni/schema/profile.py index f8edc33..0268621 100644 --- a/titles/chuni/schema/profile.py +++ b/titles/chuni/schema/profile.py @@ -410,7 +410,7 @@ class ChuniProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_profile_data: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_profile_data: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -452,7 +452,7 @@ class ChuniProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_data_ex: Failed to update! aime_id: {aime_id}" ) return None @@ -479,7 +479,7 @@ class ChuniProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_option: Failed to update! aime_id: {aime_id}" ) return None @@ -503,7 +503,7 @@ class ChuniProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_option_ex: Failed to update! aime_id: {aime_id}" ) return None @@ -527,7 +527,7 @@ class ChuniProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_recent_rating: Failed to update! aime_id: {aime_id}" ) return None @@ -552,7 +552,7 @@ class ChuniProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_activity: Failed to update! aime_id: {aime_id}" ) return None @@ -578,7 +578,7 @@ class ChuniProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_charge: Failed to update! aime_id: {aime_id}" ) return None diff --git a/titles/chuni/schema/static.py b/titles/chuni/schema/static.py index 85d0397..1f6625a 100644 --- a/titles/chuni/schema/static.py +++ b/titles/chuni/schema/static.py @@ -302,14 +302,14 @@ class ChuniStaticData(BaseData): result = self.execute(sql) if result is None: - self.logger.warn( + self.logger.warning( f"update_event: failed to update event! version: {version}, event_id: {event_id}, enabled: {enabled}" ) return None event = self.get_event(version, event_id) if event is None: - self.logger.warn( + self.logger.warning( f"update_event: failed to fetch event {event_id} after updating" ) return None @@ -506,7 +506,7 @@ class ChuniStaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert gacha! gacha_id {gacha_id}") + self.logger.warning(f"Failed to insert gacha! gacha_id {gacha_id}") return None return result.lastrowid @@ -541,7 +541,7 @@ class ChuniStaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert gacha card! gacha_id {gacha_id}") + self.logger.warning(f"Failed to insert gacha card! gacha_id {gacha_id}") return None return result.lastrowid @@ -577,7 +577,7 @@ class ChuniStaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert card! card_id {card_id}") + self.logger.warning(f"Failed to insert card! card_id {card_id}") return None return result.lastrowid diff --git a/titles/cm/read.py b/titles/cm/read.py index a26f35e..059010e 100644 --- a/titles/cm/read.py +++ b/titles/cm/read.py @@ -68,7 +68,7 @@ class CardMakerReader(BaseReader): read_csv = getattr(CardMakerReader, func) read_csv(self, f"{self.bin_dir}/MU3/{file}") else: - self.logger.warn( + self.logger.warning( f"Couldn't find {file} file in {self.bin_dir}, skipping" ) diff --git a/titles/cxb/base.py b/titles/cxb/base.py index 89e9cc3..3de83c7 100644 --- a/titles/cxb/base.py +++ b/titles/cxb/base.py @@ -52,7 +52,7 @@ class CxbBase: self.logger.info(f"Login user {data['login']['authid']}") return {"token": data["login"]["authid"], "uid": data["login"]["authid"]} - self.logger.warn(f"User {data['login']['authid']} does not have a profile") + self.logger.warning(f"User {data['login']['authid']} does not have a profile") return {} def task_generateCoupon(index, data1): diff --git a/titles/cxb/index.py b/titles/cxb/index.py index 0ef8667..25a843e 100644 --- a/titles/cxb/index.py +++ b/titles/cxb/index.py @@ -123,13 +123,13 @@ class CxbServlet(resource.Resource): ) except Exception as f: - self.logger.warn( + self.logger.warning( f"Error decoding json: {e} / {f} - {req_url} - {req_bytes}" ) return b"" if req_json == {}: - self.logger.warn(f"Empty json request to {req_url}") + self.logger.warning(f"Empty json request to {req_url}") return b"" cmd = url_split[len(url_split) - 1] @@ -140,7 +140,7 @@ class CxbServlet(resource.Resource): not type(req_json["dldate"]) is dict or "filetype" not in req_json["dldate"] ): - self.logger.warn(f"Malformed dldate request: {req_url} {req_json}") + self.logger.warning(f"Malformed dldate request: {req_url} {req_json}") return b"" filetype = req_json["dldate"]["filetype"] diff --git a/titles/cxb/read.py b/titles/cxb/read.py index 06a171f..b71740d 100644 --- a/titles/cxb/read.py +++ b/titles/cxb/read.py @@ -33,7 +33,7 @@ class CxbReader(BaseReader): pull_bin_ram = True if not path.exists(f"{self.bin_dir}"): - self.logger.warn(f"Couldn't find csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't find csv file in {self.bin_dir}, skipping") pull_bin_ram = False if pull_bin_ram: @@ -124,4 +124,4 @@ class CxbReader(BaseReader): int(row["easy"].replace("Easy ", "").replace("N/A", "0")), ) except Exception: - self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't read csv file in {self.bin_dir}, skipping") diff --git a/titles/diva/read.py b/titles/diva/read.py index 2eeacdc..f143bb6 100644 --- a/titles/diva/read.py +++ b/titles/diva/read.py @@ -34,18 +34,18 @@ class DivaReader(BaseReader): pull_opt_rom = True if not path.exists(f"{self.bin_dir}/ram"): - self.logger.warn(f"Couldn't find ram folder in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't find ram folder in {self.bin_dir}, skipping") pull_bin_ram = False if not path.exists(f"{self.bin_dir}/rom"): - self.logger.warn(f"Couldn't find rom folder in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't find rom folder in {self.bin_dir}, skipping") pull_bin_rom = False if self.opt_dir is not None: opt_dirs = self.get_data_directories(self.opt_dir) else: pull_opt_rom = False - self.logger.warn("No option directory specified, skipping") + self.logger.warning("No option directory specified, skipping") if pull_bin_ram: self.read_ram(f"{self.bin_dir}/ram") @@ -139,7 +139,7 @@ class DivaReader(BaseReader): else: continue else: - self.logger.warn(f"Databank folder not found in {ram_root_dir}, skipping") + self.logger.warning(f"Databank folder not found in {ram_root_dir}, skipping") def read_rom(self, rom_root_dir: str) -> None: self.logger.info(f"Read ROM from {rom_root_dir}") @@ -150,7 +150,7 @@ class DivaReader(BaseReader): elif path.exists(f"{rom_root_dir}/pv_db.txt"): file_path = f"{rom_root_dir}/pv_db.txt" else: - self.logger.warn( + self.logger.warning( f"Cannot find pv_db.txt or mdata_pv_db.txt in {rom_root_dir}, skipping" ) return diff --git a/titles/idz/userdb.py b/titles/idz/userdb.py index 2ac765e..fd555a1 100644 --- a/titles/idz/userdb.py +++ b/titles/idz/userdb.py @@ -114,7 +114,7 @@ class IDZUserDBProtocol(Protocol): elif self.version == 230: self.version_internal = IDZConstants.VER_IDZ_230 else: - self.logger.warn(f"Bad version v{self.version}") + self.logger.warning(f"Bad version v{self.version}") self.version = None self.version_internal = None @@ -142,7 +142,7 @@ class IDZUserDBProtocol(Protocol): self.version_internal ].get(cmd, None) if handler_cls is None: - self.logger.warn(f"No handler for v{self.version} {hex(cmd)} cmd") + self.logger.warning(f"No handler for v{self.version} {hex(cmd)} cmd") handler_cls = IDZHandlerBase handler = handler_cls(self.core_config, self.game_config, self.version_internal) diff --git a/titles/mai2/base.py b/titles/mai2/base.py index f1b04b6..ad0433f 100644 --- a/titles/mai2/base.py +++ b/titles/mai2/base.py @@ -57,7 +57,7 @@ class Mai2Base: events = self.data.static.get_enabled_events(self.version) events_lst = [] if events is None or not events: - self.logger.warn("No enabled events, did you run the reader?") + self.logger.warning("No enabled events, did you run the reader?") return {"type": data["type"], "length": 0, "gameEventList": []} for event in events: @@ -741,7 +741,7 @@ class Mai2Base: music_detail_list = [] if user_id <= 0: - self.logger.warn("handle_get_user_music_api_request: Could not find userid in data, or userId is 0") + self.logger.warning("handle_get_user_music_api_request: Could not find userid in data, or userId is 0") return {} songs = self.data.score.get_best_scores(user_id, is_dx=False) @@ -794,46 +794,46 @@ class Mai2Base: upload_date = photo.get("uploadDate", "") if order_id < 0 or user_id <= 0 or div_num < 0 or div_len <= 0 or not div_data or playlog_id < 0 or track_num <= 0 or not upload_date: - self.logger.warn(f"Malformed photo upload request") + self.logger.warning(f"Malformed photo upload request") return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'} if order_id == 0 and div_num > 0: - self.logger.warn(f"Failed to set orderId properly (still 0 after first chunk)") + self.logger.warning(f"Failed to set orderId properly (still 0 after first chunk)") return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'} if div_num == 0 and order_id > 0: - self.logger.warn(f"First chuck re-send, Ignore") + self.logger.warning(f"First chuck re-send, Ignore") return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'} if div_num >= div_len: - self.logger.warn(f"Sent extra chunks ({div_num} >= {div_len})") + self.logger.warning(f"Sent extra chunks ({div_num} >= {div_len})") return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'} if div_len >= 100: - self.logger.warn(f"Photo too large ({div_len} * 10240 = {div_len * 10240} bytes)") + self.logger.warning(f"Photo too large ({div_len} * 10240 = {div_len * 10240} bytes)") return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'} ret_code = order_id + 1 photo_chunk = b64decode(div_data) if len(photo_chunk) > 10240 or (len(photo_chunk) < 10240 and div_num + 1 != div_len): - self.logger.warn(f"Incorrect data size after decoding (Expected 10240, got {len(photo_chunk)})") + self.logger.warning(f"Incorrect data size after decoding (Expected 10240, got {len(photo_chunk)})") return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'} out_name = f"{self.game_config.uploads.photos_dir}/{user_id}_{playlog_id}_{track_num}" if not path.exists(f"{out_name}.bin") and div_num != 0: - self.logger.warn(f"Out of order photo upload (div_num {div_num})") + self.logger.warning(f"Out of order photo upload (div_num {div_num})") return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'} if path.exists(f"{out_name}.bin") and div_num == 0: - self.logger.warn(f"Duplicate file upload") + self.logger.warning(f"Duplicate file upload") return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'} elif path.exists(f"{out_name}.bin"): fstats = stat(f"{out_name}.bin") if fstats.st_size != 10240 * div_num: - self.logger.warn(f"Out of order photo upload (trying to upload div {div_num}, expected div {fstats.st_size / 10240} for file sized {fstats.st_size} bytes)") + self.logger.warning(f"Out of order photo upload (trying to upload div {div_num}, expected div {fstats.st_size / 10240} for file sized {fstats.st_size} bytes)") return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'} try: diff --git a/titles/mai2/dx.py b/titles/mai2/dx.py index 7815e82..e373649 100644 --- a/titles/mai2/dx.py +++ b/titles/mai2/dx.py @@ -552,7 +552,7 @@ class Mai2DX(Mai2Base): music_detail_list = [] if user_id <= 0: - self.logger.warn("handle_get_user_music_api_request: Could not find userid in data, or userId is 0") + self.logger.warning("handle_get_user_music_api_request: Could not find userid in data, or userId is 0") return {} songs = self.data.score.get_best_scores(user_id) diff --git a/titles/mai2/read.py b/titles/mai2/read.py index 4ff401d..cc4f678 100644 --- a/titles/mai2/read.py +++ b/titles/mai2/read.py @@ -85,7 +85,7 @@ class Mai2Reader(BaseReader): def load_table_raw(self, dir: str, file: str, key: Optional[bytes]) -> Optional[List[Dict[str, str]]]: if not os.path.exists(f"{dir}/{file}"): - self.logger.warn(f"file {file} does not exist in directory {dir}, skipping") + self.logger.warning(f"file {file} does not exist in directory {dir}, skipping") return self.logger.info(f"Load table {file} from {dir}") @@ -100,7 +100,7 @@ class Mai2Reader(BaseReader): f_data = f.read()[0x10:] if f_data is None or not f_data: - self.logger.warn(f"file {dir} could not be read, skipping") + self.logger.warning(f"file {dir} could not be read, skipping") return f_data_deflate = zlib.decompress(f_data, wbits = zlib.MAX_WBITS | 16)[0x12:] # lop off the junk at the beginning @@ -127,13 +127,13 @@ class Mai2Reader(BaseReader): try: struct_def.append(x[x.rindex(" ") + 2: -1]) except ValueError: - self.logger.warn(f"rindex failed on line {x}") + self.logger.warning(f"rindex failed on line {x}") if is_struct: - self.logger.warn("Struct not formatted properly") + self.logger.warning("Struct not formatted properly") if not struct_def: - self.logger.warn("Struct def not found") + self.logger.warning("Struct def not found") name = file[:file.index(".")] if "_" in name: @@ -148,7 +148,7 @@ class Mai2Reader(BaseReader): continue if not line_match.group(1) == name.upper(): - self.logger.warn(f"Strange regex match for line {x} -> {line_match}") + self.logger.warning(f"Strange regex match for line {x} -> {line_match}") continue vals = line_match.group(2) diff --git a/titles/mai2/schema/item.py b/titles/mai2/schema/item.py index 284365f..d57a993 100644 --- a/titles/mai2/schema/item.py +++ b/titles/mai2/schema/item.py @@ -204,7 +204,7 @@ class Mai2ItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_item: failed to insert item! user_id: {user_id}, item_kind: {item_kind}, item_id: {item_id}" ) return None @@ -261,7 +261,7 @@ class Mai2ItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_login_bonus: failed to insert item! user_id: {user_id}, bonus_id: {bonus_id}, point: {point}" ) return None @@ -312,7 +312,7 @@ class Mai2ItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_map: failed to insert item! user_id: {user_id}, map_id: {map_id}, distance: {distance}" ) return None @@ -341,7 +341,7 @@ class Mai2ItemData(BaseData): conflict = sql.on_duplicate_key_update(**char_data) result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_character_: failed to insert item! user_id: {user_id}" ) return None @@ -371,7 +371,7 @@ class Mai2ItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_character: failed to insert item! user_id: {user_id}, character_id: {character_id}, level: {level}" ) return None @@ -414,7 +414,7 @@ class Mai2ItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_friend_season_ranking: failed to insert", f"friend_season_ranking! aime_id: {aime_id}", ) @@ -432,7 +432,7 @@ class Mai2ItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_favorite: failed to insert item! user_id: {user_id}, kind: {kind}" ) return None @@ -477,7 +477,7 @@ class Mai2ItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_card: failed to insert card! user_id: {user_id}, kind: {card_kind}" ) return None @@ -516,7 +516,7 @@ class Mai2ItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_card: failed to insert charge! user_id: {user_id}, chargeId: {charge_id}" ) return None @@ -541,7 +541,7 @@ class Mai2ItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_user_print_detail: Failed to insert! aime_id: {aime_id}" ) return None diff --git a/titles/mai2/schema/profile.py b/titles/mai2/schema/profile.py index 916be20..2b3f38b 100644 --- a/titles/mai2/schema/profile.py +++ b/titles/mai2/schema/profile.py @@ -488,7 +488,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile: Failed to create profile! user_id {user_id} is_dx {is_dx}" ) return None @@ -525,7 +525,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_profile_ghost: failed to update! {user_id}") + self.logger.warning(f"put_profile_ghost: failed to update! {user_id}") return None return result.lastrowid @@ -552,7 +552,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_profile_extend: failed to update! {user_id}") + self.logger.warning(f"put_profile_extend: failed to update! {user_id}") return None return result.lastrowid @@ -582,7 +582,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_profile_option: failed to update! {user_id} is_dx {is_dx}") + self.logger.warning(f"put_profile_option: failed to update! {user_id} is_dx {is_dx}") return None return result.lastrowid @@ -616,7 +616,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_profile_rating: failed to update! {user_id}") + self.logger.warning(f"put_profile_rating: failed to update! {user_id}") return None return result.lastrowid @@ -643,7 +643,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_region: failed to update! {user_id}") + self.logger.warning(f"put_region: failed to update! {user_id}") return None return result.lastrowid @@ -668,7 +668,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_activity: failed to update! user_id: {user_id}" ) return None @@ -698,7 +698,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_web_option: failed to update! user_id: {user_id}" ) return None @@ -720,7 +720,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_grade_status: failed to update! user_id: {user_id}" ) return None @@ -742,7 +742,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_boss_list: failed to update! user_id: {user_id}" ) return None @@ -763,7 +763,7 @@ class Mai2ProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_recent_rating: failed to update! user_id: {user_id}" ) return None diff --git a/titles/mai2/schema/static.py b/titles/mai2/schema/static.py index 76b163c..0f5bfad 100644 --- a/titles/mai2/schema/static.py +++ b/titles/mai2/schema/static.py @@ -161,7 +161,7 @@ class Mai2StaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert song {song_id} chart {chart_id}") + self.logger.warning(f"Failed to insert song {song_id} chart {chart_id}") return None return result.lastrowid @@ -187,7 +187,7 @@ class Mai2StaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert charge {ticket_id} type {ticket_type}") + self.logger.warning(f"Failed to insert charge {ticket_id} type {ticket_type}") return None return result.lastrowid @@ -237,7 +237,7 @@ class Mai2StaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert card {card_id}") + self.logger.warning(f"Failed to insert card {card_id}") return None return result.lastrowid diff --git a/titles/ongeki/schema/item.py b/titles/ongeki/schema/item.py index 27d90f8..dcaf286 100644 --- a/titles/ongeki/schema/item.py +++ b/titles/ongeki/schema/item.py @@ -326,7 +326,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_card: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_card: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -346,7 +346,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_character: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_character: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -366,7 +366,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_deck: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_deck: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -394,7 +394,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_boss: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_boss: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -406,7 +406,7 @@ class OngekiItemData(BaseData): result = 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 @@ -426,7 +426,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_chapter: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_chapter: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -446,7 +446,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_item: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_item: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -479,7 +479,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_music_item: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_music_item: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -499,7 +499,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_login_bonus: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_login_bonus: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -521,7 +521,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_mission_point: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_mission_point: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -541,7 +541,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_event_point: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_event_point: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -561,7 +561,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_scenerio: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_scenerio: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -581,7 +581,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_trade_item: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_trade_item: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -601,7 +601,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_event_music: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_event_music: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -621,7 +621,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_tech_event: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_tech_event: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -651,7 +651,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_memorychapter: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_memorychapter: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -694,7 +694,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_user_gacha: Failed to insert! aime_id: {aime_id}") + self.logger.warning(f"put_user_gacha: Failed to insert! aime_id: {aime_id}") return None return result.lastrowid @@ -709,7 +709,7 @@ class OngekiItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_user_print_detail: Failed to insert! aime_id: {aime_id}" ) return None diff --git a/titles/ongeki/schema/log.py b/titles/ongeki/schema/log.py index 701e8e0..bd5b071 100644 --- a/titles/ongeki/schema/log.py +++ b/titles/ongeki/schema/log.py @@ -63,7 +63,7 @@ class OngekiLogData(BaseData): result = self.execute(sql) if result is None: - self.logger.warn( + self.logger.warning( f"put_gp_log: Failed to insert GP log! aime_id: {aime_id} kind {kind} pattern {pattern} current_gp {current_gp}" ) return result.lastrowid diff --git a/titles/ongeki/schema/profile.py b/titles/ongeki/schema/profile.py index 374503e..f6eeef2 100644 --- a/titles/ongeki/schema/profile.py +++ b/titles/ongeki/schema/profile.py @@ -364,7 +364,7 @@ class OngekiProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_profile_data: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_profile_data: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -376,7 +376,7 @@ class OngekiProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_options: Failed to update! aime_id: {aime_id}" ) return None @@ -393,7 +393,7 @@ class OngekiProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_recent_rating: failed to update recent rating! aime_id {aime_id}" ) return None @@ -415,7 +415,7 @@ class OngekiProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_rating_log: failed to update rating log! aime_id {aime_id} data_version {data_version} highest_rating {highest_rating}" ) return None @@ -449,7 +449,7 @@ class OngekiProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_activity: failed to put activity! aime_id {aime_id} kind {kind} activity_id {activity_id}" ) return None @@ -466,7 +466,7 @@ class OngekiProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_profile_region: failed to update! aime_id {aime_id} region {region}" ) return None @@ -480,7 +480,7 @@ class OngekiProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_best_score: Failed to add score! aime_id: {aime_id}") + self.logger.warning(f"put_best_score: Failed to add score! aime_id: {aime_id}") return None return result.lastrowid @@ -492,7 +492,7 @@ class OngekiProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_kop: Failed to add score! aime_id: {aime_id}") + self.logger.warning(f"put_kop: Failed to add score! aime_id: {aime_id}") return None return result.lastrowid @@ -503,7 +503,7 @@ class OngekiProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_rival: failed to update! aime_id: {aime_id}, rival_id: {rival_id}" ) return None diff --git a/titles/ongeki/schema/score.py b/titles/ongeki/schema/score.py index 8bb9fc9..7c8ce15 100644 --- a/titles/ongeki/schema/score.py +++ b/titles/ongeki/schema/score.py @@ -139,7 +139,7 @@ class OngekiScoreData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_tech_count: Failed to update! aime_id: {aime_id}") + self.logger.warning(f"put_tech_count: Failed to update! aime_id: {aime_id}") return None return result.lastrowid @@ -164,7 +164,7 @@ class OngekiScoreData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"put_best_score: Failed to add score! aime_id: {aime_id}") + self.logger.warning(f"put_best_score: Failed to add score! aime_id: {aime_id}") return None return result.lastrowid @@ -175,6 +175,6 @@ class OngekiScoreData(BaseData): result = self.execute(sql) if result is None: - self.logger.warn(f"put_playlog: Failed to add playlog! aime_id: {aime_id}") + self.logger.warning(f"put_playlog: Failed to add playlog! aime_id: {aime_id}") return None return result.lastrowid diff --git a/titles/ongeki/schema/static.py b/titles/ongeki/schema/static.py index b34802d..829b6be 100644 --- a/titles/ongeki/schema/static.py +++ b/titles/ongeki/schema/static.py @@ -105,7 +105,7 @@ class OngekiStaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert card! card_id {card_id}") + self.logger.warning(f"Failed to insert card! card_id {card_id}") return None return result.lastrowid @@ -180,7 +180,7 @@ class OngekiStaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert gacha! gacha_id {gacha_id}") + self.logger.warning(f"Failed to insert gacha! gacha_id {gacha_id}") return None return result.lastrowid @@ -215,7 +215,7 @@ class OngekiStaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert gacha card! gacha_id {gacha_id}") + self.logger.warning(f"Failed to insert gacha card! gacha_id {gacha_id}") return None return result.lastrowid @@ -243,7 +243,7 @@ class OngekiStaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert event! event_id {event_id}") + self.logger.warning(f"Failed to insert event! event_id {event_id}") return None return result.lastrowid @@ -304,7 +304,7 @@ class OngekiStaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"Failed to insert chart! song_id: {song_id}, chart_id: {chart_id}" ) return None diff --git a/titles/pokken/index.py b/titles/pokken/index.py index 3ccb3fc..3defc06 100644 --- a/titles/pokken/index.py +++ b/titles/pokken/index.py @@ -112,7 +112,7 @@ class PokkenServlet(resource.Resource): try: pokken_request.ParseFromString(content) except DecodeError as e: - self.logger.warn(f"{e} {content}") + self.logger.warning(f"{e} {content}") return b"" endpoint = jackal_pb2.MessageType.DESCRIPTOR.values_by_number[ @@ -123,7 +123,7 @@ class PokkenServlet(resource.Resource): handler = getattr(self.base, f"handle_{endpoint}", None) if handler is None: - self.logger.warn(f"No handler found for message type {endpoint}") + self.logger.warning(f"No handler found for message type {endpoint}") return self.base.handle_noop(pokken_request) self.logger.info(f"{endpoint} request from {Utils.get_ip_addr(request)}") @@ -157,7 +157,7 @@ class PokkenServlet(resource.Resource): None, ) if handler is None: - self.logger.warn( + self.logger.warning( f"No handler found for message type {json_content['call']}" ) return json.dumps(self.base.handle_matching_noop()).encode() diff --git a/titles/pokken/schema/item.py b/titles/pokken/schema/item.py index 6c13306..f68d6d9 100644 --- a/titles/pokken/schema/item.py +++ b/titles/pokken/schema/item.py @@ -45,6 +45,6 @@ class PokkenItemData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert reward for user {user_id}: {category}-{content}-{item_type}") + self.logger.warning(f"Failed to insert reward for user {user_id}: {category}-{content}-{item_type}") return None return result.lastrowid diff --git a/titles/pokken/schema/profile.py b/titles/pokken/schema/profile.py index 1d745f6..3429f7f 100644 --- a/titles/pokken/schema/profile.py +++ b/titles/pokken/schema/profile.py @@ -273,7 +273,7 @@ class PokkenProfileData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert pokemon ID {pokemon_id} for user {user_id}") + self.logger.warning(f"Failed to insert pokemon ID {pokemon_id} for user {user_id}") return None return result.lastrowid @@ -289,7 +289,7 @@ class PokkenProfileData(BaseData): result = self.execute(sql) if result is None: - self.logger.warn(f"Failed to add {xp} XP to pokemon ID {pokemon_id} for user {user_id}") + self.logger.warning(f"Failed to add {xp} XP to pokemon ID {pokemon_id} for user {user_id}") def get_pokemon_data(self, user_id: int, pokemon_id: int) -> Optional[Row]: pass @@ -319,7 +319,7 @@ class PokkenProfileData(BaseData): result = self.execute(sql) if result is None: - self.logger.warn(f"Failed to record match stats for user {user_id}'s pokemon {pokemon_id} (type {match_type.name} | result {match_result.name})") + self.logger.warning(f"Failed to record match stats for user {user_id}'s pokemon {pokemon_id} (type {match_type.name} | result {match_result.name})") def put_stats( self, @@ -345,7 +345,7 @@ class PokkenProfileData(BaseData): result = self.execute(sql) if result is None: - self.logger.warn(f"Failed to update stats for user {user_id}") + self.logger.warning(f"Failed to update stats for user {user_id}") def update_support_team(self, user_id: int, support_id: int, support1: int = None, support2: int = None) -> None: if support1 == 4294967295: @@ -363,4 +363,4 @@ class PokkenProfileData(BaseData): result = self.execute(sql) if result is None: - self.logger.warn(f"Failed to update support team {support_id} for user {user_id}") + self.logger.warning(f"Failed to update support team {support_id} for user {user_id}") diff --git a/titles/sao/read.py b/titles/sao/read.py index 649fa02..df4b8f0 100644 --- a/titles/sao/read.py +++ b/titles/sao/read.py @@ -33,7 +33,7 @@ class SaoReader(BaseReader): pull_bin_ram = True if not path.exists(f"{self.bin_dir}"): - self.logger.warn(f"Couldn't find csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't find csv file in {self.bin_dir}, skipping") pull_bin_ram = False if pull_bin_ram: @@ -66,7 +66,7 @@ class SaoReader(BaseReader): except Exception as err: print(err) except Exception: - self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't read csv file in {self.bin_dir}, skipping") self.logger.info("Now reading HeroLog.csv") try: @@ -100,7 +100,7 @@ class SaoReader(BaseReader): except Exception as err: print(err) except Exception: - self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't read csv file in {self.bin_dir}, skipping") self.logger.info("Now reading Equipment.csv") try: @@ -132,7 +132,7 @@ class SaoReader(BaseReader): except Exception as err: print(err) except Exception: - self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't read csv file in {self.bin_dir}, skipping") self.logger.info("Now reading Item.csv") try: @@ -162,7 +162,7 @@ class SaoReader(BaseReader): except Exception as err: print(err) except Exception: - self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't read csv file in {self.bin_dir}, skipping") self.logger.info("Now reading SupportLog.csv") try: @@ -194,7 +194,7 @@ class SaoReader(BaseReader): except Exception as err: print(err) except Exception: - self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't read csv file in {self.bin_dir}, skipping") self.logger.info("Now reading Title.csv") try: @@ -227,7 +227,7 @@ class SaoReader(BaseReader): elif len(titleId) < 6: # current server code cannot have multiple lengths for the id continue except Exception: - self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't read csv file in {self.bin_dir}, skipping") self.logger.info("Now reading RareDropTable.csv") try: @@ -251,4 +251,4 @@ class SaoReader(BaseReader): except Exception as err: print(err) except Exception: - self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping") + self.logger.warning(f"Couldn't read csv file in {self.bin_dir}, skipping") diff --git a/titles/wacca/base.py b/titles/wacca/base.py index 2351001..0c4cffc 100644 --- a/titles/wacca/base.py +++ b/titles/wacca/base.py @@ -192,7 +192,7 @@ class WaccaBase: else: profile = self.data.profile.get_profile(req.userId) if profile is None: - self.logger.warn( + self.logger.warning( f"Unknown user id {req.userId} attempted login from {req.chipId}" ) return resp.make() @@ -282,7 +282,7 @@ class WaccaBase: profile = self.data.profile.get_profile(req.userId) if profile is None: - self.logger.warn(f"Unknown profile {req.userId}") + self.logger.warning(f"Unknown profile {req.userId}") return resp.make() self.logger.info(f"Get detail for profile {req.userId}") @@ -709,7 +709,7 @@ class WaccaBase: profile = self.data.profile.get_profile(req.profileId) if profile is None: - self.logger.warn( + self.logger.warning( f"handle_user_music_update_request: No profile for game_id {req.profileId}" ) return resp.make() @@ -1003,7 +1003,7 @@ class WaccaBase: profile = self.data.profile.get_profile(req.profileId) if profile is None: - self.logger.warn( + self.logger.warning( f"handle_user_vip_get_request no profile with ID {req.profileId}" ) return BaseResponse().make() diff --git a/titles/wacca/index.py b/titles/wacca/index.py index e36c295..a52583f 100644 --- a/titles/wacca/index.py +++ b/titles/wacca/index.py @@ -146,7 +146,7 @@ class WaccaServlet: self.logger.debug(req_json) if not hasattr(self.versions[internal_ver], func_to_find): - self.logger.warn( + self.logger.warning( f"{req_json['appVersion']} has no handler for {func_to_find}" ) resp = BaseResponse().make() diff --git a/titles/wacca/lily.py b/titles/wacca/lily.py index 3ac03fa..2e70299 100644 --- a/titles/wacca/lily.py +++ b/titles/wacca/lily.py @@ -157,7 +157,7 @@ class WaccaLily(WaccaS): else: profile = self.data.profile.get_profile(req.userId) if profile is None: - self.logger.warn( + self.logger.warning( f"Unknown user id {req.userId} attempted login from {req.chipId}" ) return resp.make() @@ -198,7 +198,7 @@ class WaccaLily(WaccaS): profile = self.data.profile.get_profile(req.userId) if profile is None: - self.logger.warn(f"Unknown profile {req.userId}") + self.logger.warning(f"Unknown profile {req.userId}") return resp.make() self.logger.info(f"Get detail for profile {req.userId}") diff --git a/titles/wacca/read.py b/titles/wacca/read.py index 109d7ff..8fe5b6a 100644 --- a/titles/wacca/read.py +++ b/titles/wacca/read.py @@ -41,7 +41,7 @@ class WaccaReader(BaseReader): def read_music(self, base_dir: str, table: str) -> None: if not self.check_valid_pair(base_dir, table): - self.logger.warn( + self.logger.warning( f"Cannot find {table} uasset/uexp pair at {base_dir}, music will not be read" ) return diff --git a/titles/wacca/reverse.py b/titles/wacca/reverse.py index 728ef0a..557ac03 100644 --- a/titles/wacca/reverse.py +++ b/titles/wacca/reverse.py @@ -58,7 +58,7 @@ class WaccaReverse(WaccaLilyR): profile = self.data.profile.get_profile(req.userId) if profile is None: - self.logger.warn(f"Unknown profile {req.userId}") + self.logger.warning(f"Unknown profile {req.userId}") return resp.make() self.logger.info(f"Get detail for profile {req.userId}") diff --git a/titles/wacca/schema/item.py b/titles/wacca/schema/item.py index 2341afa..df3380a 100644 --- a/titles/wacca/schema/item.py +++ b/titles/wacca/schema/item.py @@ -169,7 +169,7 @@ class WaccaItemData(BaseData): result = self.execute(sql) if result is None: - self.logger.warn(f"Failed to delete ticket id {id}") + self.logger.warning(f"Failed to delete ticket id {id}") return None def get_trophies(self, user_id: int, season: int = None) -> Optional[List[Row]]: diff --git a/titles/wacca/schema/profile.py b/titles/wacca/schema/profile.py index 48eb800..ff13782 100644 --- a/titles/wacca/schema/profile.py +++ b/titles/wacca/schema/profile.py @@ -218,7 +218,7 @@ class WaccaProfileData(BaseData): result = self.execute(sql) if result is None: - self.logger.warn( + self.logger.warning( f"update_profile_dan: Failed to update! profile {profile_id}" ) return None diff --git a/titles/wacca/schema/score.py b/titles/wacca/schema/score.py index 250740f..5a3a53f 100644 --- a/titles/wacca/schema/score.py +++ b/titles/wacca/schema/score.py @@ -294,7 +294,7 @@ class WaccaScoreData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn( + self.logger.warning( f"put_stageup: failed to update! user_id: {user_id} version: {version} stage_id: {stage_id}" ) return None diff --git a/titles/wacca/schema/static.py b/titles/wacca/schema/static.py index d09a440..18e4e23 100644 --- a/titles/wacca/schema/static.py +++ b/titles/wacca/schema/static.py @@ -63,7 +63,7 @@ class WaccaStaticData(BaseData): result = self.execute(conflict) if result is None: - self.logger.warn(f"Failed to insert music {song_id} chart {chart_id}") + self.logger.warning(f"Failed to insert music {song_id} chart {chart_id}") return None return result.lastrowid