From 6b19c1e1624e2f75b011680f14ad59dd89d2b081 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sat, 22 Dec 2012 20:25:46 +0100 Subject: [PATCH 1/2] fixed high score import bug, speed up of high score import, fixed marking of currently added high scores, update to build 0073 (v0.2.1) --- Vocaluxe/Base/CDataBase.cs | 16 ++++++++++------ Vocaluxe/Base/CSettings.cs | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Vocaluxe/Base/CDataBase.cs b/Vocaluxe/Base/CDataBase.cs index d46eae86..8c1b5124 100644 --- a/Vocaluxe/Base/CDataBase.cs +++ b/Vocaluxe/Base/CDataBase.cs @@ -184,7 +184,7 @@ namespace Vocaluxe.Base command.ExecuteNonQuery(); //Read last insert line - command.CommandText = "SELECT id FROM Scores ORDER BY Date DESC LIMIT 0, 1"; + command.CommandText = "SELECT id FROM Scores ORDER BY id DESC LIMIT 0, 1"; reader = null; try @@ -747,6 +747,7 @@ namespace Vocaluxe.Base reader.Dispose(); + SQLiteTransaction _Transaction = connection.BeginTransaction(); // update Title and Artist strings foreach (SData data in songs) { @@ -766,6 +767,7 @@ namespace Vocaluxe.Base command.Parameters.Add("@id", System.Data.DbType.Int32, 0).Value = data.id; command.ExecuteNonQuery(); } + _Transaction.Commit(); //Delete old tables after conversion command.CommandText = "DROP TABLE US_Scores;"; @@ -858,7 +860,7 @@ namespace Vocaluxe.Base else { Sqlite3.Vdbe Stmt = new Sqlite3.Vdbe(); - res = Sqlite3.sqlite3_prepare_v2(OldDB, "SELECT ID, Artist, Title FROM US_Songs", -1, ref Stmt, 0); + res = Sqlite3.sqlite3_prepare_v2(OldDB, "SELECT id, Artist, Title FROM Songs", -1, ref Stmt, 0); if (res != Sqlite3.SQLITE_OK) { @@ -897,9 +899,9 @@ namespace Vocaluxe.Base Stmt = new Sqlite3.Vdbe(); if (!dateExists) - res = Sqlite3.sqlite3_prepare_v2(OldDB, "SELECT rowid, Player FROM US_Scores", -1, ref Stmt, 0); + res = Sqlite3.sqlite3_prepare_v2(OldDB, "SELECT id, PlayerName FROM Scores", -1, ref Stmt, 0); else - res = Sqlite3.sqlite3_prepare_v2(OldDB, "SELECT rowid, Player, Date FROM US_Scores", -1, ref Stmt, 0); + res = Sqlite3.sqlite3_prepare_v2(OldDB, "SELECT id, PlayerName, Date FROM Scores", -1, ref Stmt, 0); if (res != Sqlite3.SQLITE_OK) { @@ -932,9 +934,10 @@ namespace Vocaluxe.Base Sqlite3.sqlite3_finalize(Stmt); } } - Sqlite3.sqlite3_close(OldDB); + SQLiteTransaction _Transaction = connection.BeginTransaction(); + // update Title and Artist strings foreach (SData data in songs) { @@ -943,7 +946,7 @@ namespace Vocaluxe.Base command.Parameters.Add("@artist", System.Data.DbType.String, 0).Value = data.str1; command.Parameters.Add("@id", System.Data.DbType.Int32, 0).Value = data.id; command.ExecuteNonQuery(); - } + } // update player names foreach (SData data in scores) @@ -959,6 +962,7 @@ namespace Vocaluxe.Base command.Parameters.Add("@id", System.Data.DbType.Int32, 0).Value = data.id; command.ExecuteNonQuery(); } + _Transaction.Commit(); //Delete old tables after conversion command.CommandText = "DROP TABLE US_Scores;"; diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index cd357399..1f9d685d 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -44,10 +44,10 @@ namespace Vocaluxe.Base public const int iVersionMajor = 0; public const int iVersionMinor = 2; // milestones - public const int iVersionSub = 0; // patches + public const int iVersionSub = 1; // patches public const ERevision VersionRevision = ERevision.Release; - public const int iBuild = 72; // Increase on every published version! Never Reset! + public const int iBuild = 73; // Increase on every published version! Never Reset! public const int iDatabaseHighscoreVersion = 2; public const int iDatabaseCoverVersion = 1; From e56d64048bdad3398045918acd9d0a9e83d914f2 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sat, 22 Dec 2012 21:19:45 +0100 Subject: [PATCH 2/2] fixed set small view bug in song selection screen --- Vocaluxe/Screens/CScreenSong.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 2f18a470..a203fe1c 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -731,14 +731,16 @@ namespace Vocaluxe.Screens } else { - Buttons[htButtons(ButtonStart)].Visible = false; - if(SongMenus[htSongMenus(SongMenu)].IsSmallView()) + if(_sso.Selection.PartyMode && SongMenus[htSongMenus(SongMenu)].IsSmallView()) SongMenus[htSongMenus(SongMenu)].SetSmallView(false); + for (int i = 0; i < _Base.Settings.GetMaxNumPlayer(); i++) { Buttons[htButtons(ButtonsJoker[i])].Visible = false; Texts[htTexts(TextsPlayer[i])].Visible = false; } + + Buttons[htButtons(ButtonStart)].Visible = false; } return true;