From b81767af8a80064486a00bd3b0febc9f94bd049f Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Wed, 1 Mar 2023 21:09:06 +0100 Subject: [PATCH 1/2] Chunithm New!!+ Importer and settings fixed --- core/data/schema/versions/SDHD_1_rollback.sql | 1 + core/data/schema/versions/SDHD_2_upgrade.sql | 1 + titles/chuni/new.py | 8 ++++---- titles/chuni/newplus.py | 8 ++++---- titles/chuni/read.py | 2 +- titles/chuni/schema/static.py | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 core/data/schema/versions/SDHD_1_rollback.sql create mode 100644 core/data/schema/versions/SDHD_2_upgrade.sql diff --git a/core/data/schema/versions/SDHD_1_rollback.sql b/core/data/schema/versions/SDHD_1_rollback.sql new file mode 100644 index 0000000..e8bca83 --- /dev/null +++ b/core/data/schema/versions/SDHD_1_rollback.sql @@ -0,0 +1 @@ +ALTER TABLE chuni_static_music CHANGE COLUMN worldsEndTag worldsEndTag VARCHAR(20) NULL DEFAULT NULL ; diff --git a/core/data/schema/versions/SDHD_2_upgrade.sql b/core/data/schema/versions/SDHD_2_upgrade.sql new file mode 100644 index 0000000..30f0fc4 --- /dev/null +++ b/core/data/schema/versions/SDHD_2_upgrade.sql @@ -0,0 +1 @@ +ALTER TABLE chuni_static_music CHANGE COLUMN worldsEndTag worldsEndTag VARCHAR(7) NULL DEFAULT NULL ; diff --git a/titles/chuni/new.py b/titles/chuni/new.py index 909284e..5c21df6 100644 --- a/titles/chuni/new.py +++ b/titles/chuni/new.py @@ -47,10 +47,10 @@ class ChuniNew(ChuniBase): "matchErrorLimit": 9999, "romVersion": "2.00.00", "dataVersion": "2.00.00", - "matchingUri": f"http://{self.core_cfg.server.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", - "matchingUriX": f"http://{self.core_cfg.server.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", - "udpHolePunchUri": f"http://{self.core_cfg.server.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", - "reflectorUri": f"http://{self.core_cfg.server.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", + "matchingUri": f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", + "matchingUriX": f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", + "udpHolePunchUri": f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", + "reflectorUri": f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", }, "isDumpUpload": "false", "isAou": "false", diff --git a/titles/chuni/newplus.py b/titles/chuni/newplus.py index c048f8a..48de8d0 100644 --- a/titles/chuni/newplus.py +++ b/titles/chuni/newplus.py @@ -16,8 +16,8 @@ class ChuniNewPlus(ChuniNew): ret = super().handle_get_game_setting_api_request(data) ret["gameSetting"]["romVersion"] = "2.05.00" ret["gameSetting"]["dataVersion"] = "2.05.00" - ret["gameSetting"]["matchingUri"] = f"http://{self.core_cfg.server.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" - ret["gameSetting"]["matchingUriX"] = f"http://{self.core_cfg.server.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" - ret["gameSetting"]["udpHolePunchUri"] = f"http://{self.core_cfg.server.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" - ret["gameSetting"]["reflectorUri"] = f"http://{self.core_cfg.server.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" + ret["gameSetting"]["matchingUri"] = f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" + ret["gameSetting"]["matchingUriX"] = f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" + ret["gameSetting"]["udpHolePunchUri"] = f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" + ret["gameSetting"]["reflectorUri"] = f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" return ret diff --git a/titles/chuni/read.py b/titles/chuni/read.py index dd67c03..1a666e6 100644 --- a/titles/chuni/read.py +++ b/titles/chuni/read.py @@ -82,7 +82,7 @@ class ChuniReader(BaseReader): for MusicFumenData in fumens.findall('MusicFumenData'): fumen_path = MusicFumenData.find('file').find("path") - if fumen_path.text is not None: + if fumen_path is not None: chart_id = MusicFumenData.find('type').find('id').text if chart_id == "4": level = float(xml_root.find("starDifType").text) diff --git a/titles/chuni/schema/static.py b/titles/chuni/schema/static.py index 99dd3e8..fbfae11 100644 --- a/titles/chuni/schema/static.py +++ b/titles/chuni/schema/static.py @@ -34,7 +34,7 @@ music = Table( Column("level", Float), Column("genre", String(255)), Column("jacketPath", String(255)), - Column("worldsEndTag", String(20)), + Column("worldsEndTag", String(7)), UniqueConstraint("version", "songId", "chartId", name="chuni_static_music_uk"), mysql_charset='utf8mb4' ) From 842e3a313e93eebaf6348c748694a7db1be3042f Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Wed, 1 Mar 2023 21:18:29 +0100 Subject: [PATCH 2/2] chuni: use title hostname instead of server hostname --- titles/chuni/new.py | 8 ++++---- titles/chuni/newplus.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/titles/chuni/new.py b/titles/chuni/new.py index 5c21df6..4b5ba2d 100644 --- a/titles/chuni/new.py +++ b/titles/chuni/new.py @@ -47,10 +47,10 @@ class ChuniNew(ChuniBase): "matchErrorLimit": 9999, "romVersion": "2.00.00", "dataVersion": "2.00.00", - "matchingUri": f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", - "matchingUriX": f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", - "udpHolePunchUri": f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", - "reflectorUri": f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", + "matchingUri": f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", + "matchingUriX": f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", + "udpHolePunchUri": f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", + "reflectorUri": f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/", }, "isDumpUpload": "false", "isAou": "false", diff --git a/titles/chuni/newplus.py b/titles/chuni/newplus.py index 48de8d0..7ebdc96 100644 --- a/titles/chuni/newplus.py +++ b/titles/chuni/newplus.py @@ -16,8 +16,8 @@ class ChuniNewPlus(ChuniNew): ret = super().handle_get_game_setting_api_request(data) ret["gameSetting"]["romVersion"] = "2.05.00" ret["gameSetting"]["dataVersion"] = "2.05.00" - ret["gameSetting"]["matchingUri"] = f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" - ret["gameSetting"]["matchingUriX"] = f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" - ret["gameSetting"]["udpHolePunchUri"] = f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" - ret["gameSetting"]["reflectorUri"] = f"http://{self.core_cfg.server.listen_address}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" + ret["gameSetting"]["matchingUri"] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" + ret["gameSetting"]["matchingUriX"] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" + ret["gameSetting"]["udpHolePunchUri"] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" + ret["gameSetting"]["reflectorUri"] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/205/ChuniServlet/" return ret