1
0
mirror of synced 2025-02-02 12:37:21 +01:00

Squashed commit of the following:

commit 641274052796dfc9484707eed49f3fd9f3bfb690
Author: DragonRatTiger / リュウコ <dragonrattiger@gmail.com>
Date:   Fri Jul 26 21:00:52 2024 -0500

    Adjust Score.ini Importer (#659)
This commit is contained in:
0auBSQ 2024-07-27 11:02:15 +09:00
parent 483554ce33
commit 35ebb6e25b

View File

@ -190,14 +190,14 @@ namespace TJAPlayer3 {
cmd.CommandText = $@" 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) 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( VALUES(
'{UniqueId.data.id.Replace(@"'", @"''")}', '{UniqueId.data.id.EscapeSingleQuotes()}',
'{boxdef.Genre}', '{boxdef.Genre.EscapeSingleQuotes()}',
'{(!string.IsNullOrEmpty(Charters[i + 1]) ? Charters[i + 1] : Charters[0]).Replace(@"'", @"''")}', '{(!string.IsNullOrEmpty(Charters[i + 1]) ? Charters[i + 1] : Charters[0]).EscapeSingleQuotes()}',
'{Artist.Replace(@"'", @"''")}', '{Artist.EscapeSingleQuotes()}',
8925478921, 8925478921,
{i}, {i},
{Level[i]}, {Level[i]},
{Clear[i] + (i == 6 && Clear[i] > -1 ? 1 : 0)}, '-1',
{(i != 5 ? Rank[i] : -1)}, {(i != 5 ? Rank[i] : -1)},
{HighScore[score_index]}, {HighScore[score_index]},
{GetPlayerId(_score)}, {GetPlayerId(_score)},
@ -235,21 +235,21 @@ namespace TJAPlayer3 {
private static string GetTJAFile(string path) { private static string GetTJAFile(string path) {
FileInfo info = new FileInfo(path); FileInfo info = new FileInfo(path);
if (info.FullName.EndsWith("1P.score.ini")) return info.FullName.Replace("1P.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("2P.score.ini")) return info.FullName.Replace("2P.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("3P.score.ini")) return info.FullName.Replace("3P.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("4P.score.ini")) return info.FullName.Replace("4P.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("5P.score.ini")) return info.FullName.Replace("5P.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", ""); return info.FullName.Replace(".score.ini", "");
} }
private static int GetPlayerId(string path) { private static int GetPlayerId(string path) {
FileInfo info = new FileInfo(path); FileInfo info = new FileInfo(path);
if (info.Name.EndsWith("1P.score.ini")) return 0; if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[0]}.score.ini")) return 0;
if (info.Name.EndsWith("2P.score.ini")) return 1; if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[1]}.score.ini")) return 1;
if (info.Name.EndsWith("3P.score.ini")) return 2; if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[2]}.score.ini")) return 2;
if (info.Name.EndsWith("4P.score.ini")) return 3; if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[3]}.score.ini")) return 3;
if (info.Name.EndsWith("5P.score.ini")) return 4; if (info.Name.EndsWith($"{TJAPlayer3.ConfigIni.sSaveFile[4]}.score.ini")) return 4;
return 0; return 0;
} }
} }