From f730dca14c84d9f764f66c825418d973058c1f7a Mon Sep 17 00:00:00 2001 From: arxanas Date: Tue, 1 Jul 2014 02:29:25 -0400 Subject: [PATCH 1/5] Fix #155: Vanguard card names no longer conflict with regular card names. --- oracle/src/oracleimporter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oracle/src/oracleimporter.cpp b/oracle/src/oracleimporter.cpp index 70972d92d..241924e3b 100644 --- a/oracle/src/oracleimporter.cpp +++ b/oracle/src/oracleimporter.cpp @@ -197,6 +197,11 @@ int OracleImporter::importTextSpoiler(CardSet *set, const QVariant &data) cardText = map.contains("text") ? map.value("text").toString() : QString(""); cardId = map.contains("multiverseid") ? map.value("multiverseid").toInt() : 0; cardLoyalty = map.contains("loyalty") ? map.value("loyalty").toInt() : 0; + + // Distinguish Vanguard cards from regular cards of the same name. + if (map.value("layout") == "vanguard") { + cardName += " Avatar"; + } } CardInfo *card = addCard(set->getShortName(), cardName, false, cardId, cardCost, cardType, cardPT, cardLoyalty, cardText.split("\n")); From fb4a7b327478056aba254e71e25baa908139a4b0 Mon Sep 17 00:00:00 2001 From: Gavin Bisesi Date: Tue, 1 Jul 2014 12:04:33 -0400 Subject: [PATCH 2/5] Give more friendly login error message --- cockatrice/src/window_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/window_main.cpp b/cockatrice/src/window_main.cpp index f5dc26843..7890d63af 100644 --- a/cockatrice/src/window_main.cpp +++ b/cockatrice/src/window_main.cpp @@ -241,7 +241,7 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32 { switch (r) { case Response::RespWrongPassword: - QMessageBox::critical(this, tr("Error"), tr("Invalid login data.")); + QMessageBox::critical(this, tr("Error"), tr("Incorrect username or password. Please check your authentication information and try again.")); break; case Response::RespWouldOverwriteOldSession: QMessageBox::critical(this, tr("Error"), tr("There is already an active session using this user name.\nPlease close that session first and re-login.")); From 2b55170110ea9162dcf3695b50cd9d1128a24a99 Mon Sep 17 00:00:00 2001 From: woogerboy21 Date: Tue, 1 Jul 2014 13:11:52 -0400 Subject: [PATCH 3/5] DB Maint Scripts External shell script to help maintain the cockatrice database tables. --- servatrice/scripts/maint_replays | 6 ++++++ servatrice/scripts/maint_sessions | 7 +++++++ servatrice/scripts/mysql.cnf | 3 +++ 3 files changed, 16 insertions(+) create mode 100644 servatrice/scripts/maint_replays create mode 100644 servatrice/scripts/maint_sessions create mode 100644 servatrice/scripts/mysql.cnf diff --git a/servatrice/scripts/maint_replays b/servatrice/scripts/maint_replays new file mode 100644 index 000000000..b1326d9b2 --- /dev/null +++ b/servatrice/scripts/maint_replays @@ -0,0 +1,6 @@ +#!/bin/bash +#RUN THIS SCRIPT TO REMOVE ALL COCKATRICE REPLAYS FROM THE DATABASE +#--CAN BE SCHEDULED WITH CRONTAB + +mysql --defaults-file=./mysql.cnf -h localhost -e 'truncate table servatrice.cockatrice_replays' +mysql --defaults-file=./mysql.cnf -h localhost -e 'truncate table servatrice.cockatrice_replays_access' diff --git a/servatrice/scripts/maint_sessions b/servatrice/scripts/maint_sessions new file mode 100644 index 000000000..1fabd68f1 --- /dev/null +++ b/servatrice/scripts/maint_sessions @@ -0,0 +1,7 @@ +#!/bin/bash +#REPLACE THE --date="1 month ago" WITH THE TIME FRAME TO CLEAR UP +#EX: --date="1 day ago" (FOR SINGLE DAY) +#--CAN BE SCHEDULED WITH CRONTAB + +DATE=$(date +%Y-%m --date="1 month ago") +mysql --defaults-file=./mysql.cnf -h localhost -e "delete from servatrice.cockatrice_sessions where start_time like \"${DATE}%\"" diff --git a/servatrice/scripts/mysql.cnf b/servatrice/scripts/mysql.cnf new file mode 100644 index 000000000..e5d901be6 --- /dev/null +++ b/servatrice/scripts/mysql.cnf @@ -0,0 +1,3 @@ +[client] +user={db_username} +password={db_password} From b27873667b87e55a4df1dc27aa7cf71cafbbc820 Mon Sep 17 00:00:00 2001 From: woogerboy21 Date: Wed, 2 Jul 2014 11:11:17 -0400 Subject: [PATCH 4/5] Optimization Updates for performance improvements per request --- servatrice/scripts/maint_replays | 7 ++----- servatrice/scripts/maint_sessions | 8 ++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/servatrice/scripts/maint_replays b/servatrice/scripts/maint_replays index b1326d9b2..1ce1b400d 100644 --- a/servatrice/scripts/maint_replays +++ b/servatrice/scripts/maint_replays @@ -1,6 +1,3 @@ #!/bin/bash -#RUN THIS SCRIPT TO REMOVE ALL COCKATRICE REPLAYS FROM THE DATABASE -#--CAN BE SCHEDULED WITH CRONTAB - -mysql --defaults-file=./mysql.cnf -h localhost -e 'truncate table servatrice.cockatrice_replays' -mysql --defaults-file=./mysql.cnf -h localhost -e 'truncate table servatrice.cockatrice_replays_access' +# SCHEDULE WITH CRONTAB BASED ON TIME PERIOD REPLAYS SHOULD BE SAVED UNTIL (EX: SCHEDULE ONCE A WEEK TO KEEP A WEEKS WORTH OF REPLAYS IN THE DB) +mysql --defaults-file=./mysql.cnf -h localhost -e 'truncate table servatrice.cockatrice_replays;truncate table servatrice.cockatrice_replays_access' diff --git a/servatrice/scripts/maint_sessions b/servatrice/scripts/maint_sessions index 1fabd68f1..2c41da6da 100644 --- a/servatrice/scripts/maint_sessions +++ b/servatrice/scripts/maint_sessions @@ -1,7 +1,3 @@ #!/bin/bash -#REPLACE THE --date="1 month ago" WITH THE TIME FRAME TO CLEAR UP -#EX: --date="1 day ago" (FOR SINGLE DAY) -#--CAN BE SCHEDULED WITH CRONTAB - -DATE=$(date +%Y-%m --date="1 month ago") -mysql --defaults-file=./mysql.cnf -h localhost -e "delete from servatrice.cockatrice_sessions where start_time like \"${DATE}%\"" +# SCHEDULE WITH CRONTAB TO RUN ONCE A MONTH +mysql --defaults-file=./mysql.cnf -h localhost -e "delete from servatrice.cockatrice_sessions where start_time < DATE_SUB(now(), INTERVAL 1 MONTH)" From 9ba74fee5c16b0e1d625947066bd4a64c31afa2c Mon Sep 17 00:00:00 2001 From: woogerboy21 Date: Wed, 2 Jul 2014 13:23:50 -0400 Subject: [PATCH 5/5] Example Update Renamed mysql configuration file to include example extension and set git to ignore mysql.cnf per request. --- .gitignore | 1 + servatrice/scripts/{mysql.cnf => mysql.cnf.example} | 0 2 files changed, 1 insertion(+) rename servatrice/scripts/{mysql.cnf => mysql.cnf.example} (100%) diff --git a/.gitignore b/.gitignore index 1753f78c6..df1a5c9fe 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ tags build* *.qm .directory +mysql.cnf diff --git a/servatrice/scripts/mysql.cnf b/servatrice/scripts/mysql.cnf.example similarity index 100% rename from servatrice/scripts/mysql.cnf rename to servatrice/scripts/mysql.cnf.example