From b900f0ca3e90be096c3d16eab4c07b74a3453851 Mon Sep 17 00:00:00 2001 From: UnitedAirforce Date: Sat, 16 Aug 2025 15:48:41 +0800 Subject: [PATCH] Ready up for ex release --- various-tools/v6 4max db shifter/readme.txt | 11 +++++++ various-tools/v6 4max db shifter/shift.py | 32 +++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 various-tools/v6 4max db shifter/readme.txt create mode 100644 various-tools/v6 4max db shifter/shift.py diff --git a/various-tools/v6 4max db shifter/readme.txt b/various-tools/v6 4max db shifter/readme.txt new file mode 100644 index 0000000..768402a --- /dev/null +++ b/various-tools/v6 4max db shifter/readme.txt @@ -0,0 +1,11 @@ +Between 4MAX expansion 6 and 7, 70+ extra levels were added, that includes some AC Alternate charts that were inserted into slots without AC difficulties, due to the 1000 song hard limit. + +Within those 10+ AC Alt levels are 3 levels that were previously part of the 4MAX expansion. Their song ID were shifted to provide space for other songs. + +As a result, those three song's score needs to be shifted in the database (song ID 918 > 7, 921 > 4, 722 > 10). + +Furthermore, it was discovered that a song has been duplicated. It has been deleted and all score after it must be shifted (song ID 359) + +This script does that, simply place in the server root directory and run it. + +Everyone with 4max expansion installed needs to run it. If you are just setting the whole things up, this is not required. \ No newline at end of file diff --git a/various-tools/v6 4max db shifter/shift.py b/various-tools/v6 4max db shifter/shift.py new file mode 100644 index 0000000..296c870 --- /dev/null +++ b/various-tools/v6 4max db shifter/shift.py @@ -0,0 +1,32 @@ +import sqlite3 + +db_path = "player.db" +conn = sqlite3.connect(db_path) +cur = conn.cursor() + +# 1. Delete all rows with id == 359 +cur.execute("DELETE FROM result WHERE id = ?", (359,)) + +# 2. Shift every row with id > 359 to id = x - 1 +cur.execute("UPDATE result SET id = id - 1 WHERE id > ?", (359,)) + +# 3. Shift every row with id == 721 to id = 10 (722 - 1) +cur.execute("UPDATE result SET id = ? WHERE id = ?", (10, 721)) + +# 4. Shift every row with id > 721 to id = x - 1 +cur.execute("UPDATE result SET id = id - 1 WHERE id > ?", (721,)) + +# 5. Shift every row with id == 916 to id = 7 (918 - 2) +cur.execute("UPDATE result SET id = ? WHERE id = ?", (7, 916)) + +# 6. Shift every row with id > 916 to id = x - 1 +cur.execute("UPDATE result SET id = id - 1 WHERE id > ?", (916,)) + +# 7. Shift every row with id == 918 to id = 4 (921 - 3) +cur.execute("UPDATE result SET id = ? WHERE id = ?", (4, 918)) + +# 8. Shift every row with id > 918 to id = x - 1 +cur.execute("UPDATE result SET id = id - 1 WHERE id > ?", (918,)) + +conn.commit() +conn.close() \ No newline at end of file