diff --git a/.gitignore b/.gitignore index 1753f78c..df1a5c9f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ tags build* *.qm .directory +mysql.cnf diff --git a/cockatrice/src/remoteclient.cpp b/cockatrice/src/remoteclient.cpp index 0eae13ab..e0d3d860 100644 --- a/cockatrice/src/remoteclient.cpp +++ b/cockatrice/src/remoteclient.cpp @@ -15,7 +15,7 @@ RemoteClient::RemoteClient(QObject *parent) : AbstractClient(parent), timeRunning(0), lastDataReceived(0), messageInProgress(false), handshakeStarted(false), messageLength(0) { timer = new QTimer(this); - timer->setInterval(1000); + timer->setInterval(9000); connect(timer, SIGNAL(timeout()), this, SLOT(ping())); socket = new QTcpSocket(this); @@ -23,7 +23,7 @@ RemoteClient::RemoteClient(QObject *parent) connect(socket, SIGNAL(connected()), this, SLOT(slotConnected())); connect(socket, SIGNAL(readyRead()), this, SLOT(readData())); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(slotSocketError(QAbstractSocket::SocketError))); - + connect(this, SIGNAL(serverIdentificationEventReceived(const Event_ServerIdentification &)), this, SLOT(processServerIdentificationEvent(const Event_ServerIdentification &))); connect(this, SIGNAL(connectionClosedEventReceived(Event_ConnectionClosed)), this, SLOT(processConnectionClosedEvent(Event_ConnectionClosed))); connect(this, SIGNAL(sigConnectToServer(QString, unsigned int, QString, QString)), this, SLOT(doConnectToServer(QString, unsigned int, QString, QString))); @@ -47,12 +47,12 @@ void RemoteClient::slotConnected() { timeRunning = lastDataReceived = 0; timer->start(); - + // dirty hack to be compatible with v14 server sendCommandContainer(CommandContainer()); getNewCmdId(); // end of hack - + setStatus(StatusAwaitingWelcome); } @@ -208,7 +208,7 @@ void RemoteClient::ping() pend->deleteLater(); } } - + int maxTime = timeRunning - lastDataReceived; emit maxPingTime(maxTime, maxTimeout); if (maxTime >= maxTimeout) { diff --git a/cockatrice/src/tab_message.cpp b/cockatrice/src/tab_message.cpp index 80a56154..eec46bb9 100644 --- a/cockatrice/src/tab_message.cpp +++ b/cockatrice/src/tab_message.cpp @@ -34,6 +34,10 @@ TabMessage::TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, c retranslateUi(); setLayout(vbox); + + setFocusProxy(sayEdit); + chatView->setFocusProxy(sayEdit); + sayEdit->setFocus(); } TabMessage::~TabMessage() diff --git a/cockatrice/src/tab_room.cpp b/cockatrice/src/tab_room.cpp index 79673e0f..a7514e79 100644 --- a/cockatrice/src/tab_room.cpp +++ b/cockatrice/src/tab_room.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "tab_supervisor.h" #include "tab_room.h" #include "tab_userlists.h" @@ -97,6 +98,10 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerI const int gameListSize = info.game_list_size(); for (int i = 0; i < gameListSize; ++i) gameSelector->processGameInfo(info.game_list(i)); + + setFocusProxy(sayEdit); + chatView->setFocusProxy(sayEdit); + QTimer::singleShot(0, sayEdit, SLOT(setFocus())); } TabRoom::~TabRoom() diff --git a/cockatrice/src/window_main.cpp b/cockatrice/src/window_main.cpp index f5dc2684..7890d63a 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.")); diff --git a/oracle/src/oracleimporter.cpp b/oracle/src/oracleimporter.cpp index 258e8850..3562d5cc 100644 --- a/oracle/src/oracleimporter.cpp +++ b/oracle/src/oracleimporter.cpp @@ -201,6 +201,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")); diff --git a/servatrice/scripts/maint_replays b/servatrice/scripts/maint_replays new file mode 100644 index 00000000..1ce1b400 --- /dev/null +++ b/servatrice/scripts/maint_replays @@ -0,0 +1,3 @@ +#!/bin/bash +# 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 new file mode 100644 index 00000000..2c41da6d --- /dev/null +++ b/servatrice/scripts/maint_sessions @@ -0,0 +1,3 @@ +#!/bin/bash +# 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)" diff --git a/servatrice/scripts/mysql.cnf.example b/servatrice/scripts/mysql.cnf.example new file mode 100644 index 00000000..e5d901be --- /dev/null +++ b/servatrice/scripts/mysql.cnf.example @@ -0,0 +1,3 @@ +[client] +user={db_username} +password={db_password}