From 35ebb6e25b8e0a4699ef3cbcab498e57bd5c328a Mon Sep 17 00:00:00 2001 From: 0auBSQ <58159635+0auBSQ@users.noreply.github.com> Date: Sat, 27 Jul 2024 11:02:15 +0900 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 641274052796dfc9484707eed49f3fd9f3bfb690 Author: DragonRatTiger / リュウコ Date: Fri Jul 26 21:00:52 2024 -0500 Adjust Score.ini Importer (#659) --- OpenTaiko/src/Songs/CScoreIni_Importer.cs | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/OpenTaiko/src/Songs/CScoreIni_Importer.cs b/OpenTaiko/src/Songs/CScoreIni_Importer.cs index 7ff2f6b7..4911edaf 100644 --- a/OpenTaiko/src/Songs/CScoreIni_Importer.cs +++ b/OpenTaiko/src/Songs/CScoreIni_Importer.cs @@ -190,14 +190,14 @@ namespace TJAPlayer3 { cmd.CommandText = $@" INSERT INTO best_plays(ChartUniqueId,ChartGenre,Charter,Artist,PlayMods,ChartDifficulty,ChartLevel,ClearStatus,ScoreRank,HighScore,SaveId,TowerBestFloor,DanExam1,DanExam2,DanExam3,DanExam4,DanExam5,DanExam6,DanExam7,PlayCount,HighScoreGoodCount,HighScoreOkCount,HighScoreBadCount,HighScoreMaxCombo,HighScoreRollCount,HighScoreADLibCount,HighScoreBoomCount) VALUES( - '{UniqueId.data.id.Replace(@"'", @"''")}', - '{boxdef.Genre}', - '{(!string.IsNullOrEmpty(Charters[i + 1]) ? Charters[i + 1] : Charters[0]).Replace(@"'", @"''")}', - '{Artist.Replace(@"'", @"''")}', + '{UniqueId.data.id.EscapeSingleQuotes()}', + '{boxdef.Genre.EscapeSingleQuotes()}', + '{(!string.IsNullOrEmpty(Charters[i + 1]) ? Charters[i + 1] : Charters[0]).EscapeSingleQuotes()}', + '{Artist.EscapeSingleQuotes()}', 8925478921, {i}, {Level[i]}, - {Clear[i] + (i == 6 && Clear[i] > -1 ? 1 : 0)}, + '-1', {(i != 5 ? Rank[i] : -1)}, {HighScore[score_index]}, {GetPlayerId(_score)}, @@ -235,21 +235,21 @@ namespace TJAPlayer3 { private static string GetTJAFile(string path) { FileInfo info = new FileInfo(path); - if (info.FullName.EndsWith("1P.score.ini")) return info.FullName.Replace("1P.score.ini", ""); - if (info.FullName.EndsWith("2P.score.ini")) return info.FullName.Replace("2P.score.ini", ""); - if (info.FullName.EndsWith("3P.score.ini")) return info.FullName.Replace("3P.score.ini", ""); - if (info.FullName.EndsWith("4P.score.ini")) return info.FullName.Replace("4P.score.ini", ""); - if (info.FullName.EndsWith("5P.score.ini")) return info.FullName.Replace("5P.score.ini", ""); + if (info.FullName.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[0]}.score.ini")) return info.FullName.Replace($"{TJAPlayer3.ConfigIni.sSaveFile[0]}.score.ini", ""); + if (info.FullName.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[1]}.score.ini")) return info.FullName.Replace($"{TJAPlayer3.ConfigIni.sSaveFile[1]}.score.ini", ""); + if (info.FullName.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[2]}.score.ini")) return info.FullName.Replace($"{TJAPlayer3.ConfigIni.sSaveFile[2]}.score.ini", ""); + if (info.FullName.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[3]}.score.ini")) return info.FullName.Replace($"{TJAPlayer3.ConfigIni.sSaveFile[3]}.score.ini", ""); + if (info.FullName.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[4]}.score.ini")) return info.FullName.Replace($"{TJAPlayer3.ConfigIni.sSaveFile[4]}.score.ini", ""); return info.FullName.Replace(".score.ini", ""); } private static int GetPlayerId(string path) { FileInfo info = new FileInfo(path); - if (info.Name.EndsWith("1P.score.ini")) return 0; - if (info.Name.EndsWith("2P.score.ini")) return 1; - if (info.Name.EndsWith("3P.score.ini")) return 2; - if (info.Name.EndsWith("4P.score.ini")) return 3; - if (info.Name.EndsWith("5P.score.ini")) return 4; + if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[0]}.score.ini")) return 0; + if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[1]}.score.ini")) return 1; + if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[2]}.score.ini")) return 2; + if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[3]}.score.ini")) return 3; + if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[4]}.score.ini")) return 4; return 0; } }