Merge remote-tracking branch 'upstream/master' into cmake_qt5
This commit is contained in:
commit
e9895d643f
9 changed files with 30 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ tags
|
||||||
build*
|
build*
|
||||||
*.qm
|
*.qm
|
||||||
.directory
|
.directory
|
||||||
|
mysql.cnf
|
||||||
|
|
|
@ -15,7 +15,7 @@ RemoteClient::RemoteClient(QObject *parent)
|
||||||
: AbstractClient(parent), timeRunning(0), lastDataReceived(0), messageInProgress(false), handshakeStarted(false), messageLength(0)
|
: AbstractClient(parent), timeRunning(0), lastDataReceived(0), messageInProgress(false), handshakeStarted(false), messageLength(0)
|
||||||
{
|
{
|
||||||
timer = new QTimer(this);
|
timer = new QTimer(this);
|
||||||
timer->setInterval(1000);
|
timer->setInterval(9000);
|
||||||
connect(timer, SIGNAL(timeout()), this, SLOT(ping()));
|
connect(timer, SIGNAL(timeout()), this, SLOT(ping()));
|
||||||
|
|
||||||
socket = new QTcpSocket(this);
|
socket = new QTcpSocket(this);
|
||||||
|
|
|
@ -34,6 +34,10 @@ TabMessage::TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, c
|
||||||
|
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
setLayout(vbox);
|
setLayout(vbox);
|
||||||
|
|
||||||
|
setFocusProxy(sayEdit);
|
||||||
|
chatView->setFocusProxy(sayEdit);
|
||||||
|
sayEdit->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
TabMessage::~TabMessage()
|
TabMessage::~TabMessage()
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QSplitter>
|
#include <QSplitter>
|
||||||
|
#include <QTimer>
|
||||||
#include "tab_supervisor.h"
|
#include "tab_supervisor.h"
|
||||||
#include "tab_room.h"
|
#include "tab_room.h"
|
||||||
#include "tab_userlists.h"
|
#include "tab_userlists.h"
|
||||||
|
@ -97,6 +98,10 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerI
|
||||||
const int gameListSize = info.game_list_size();
|
const int gameListSize = info.game_list_size();
|
||||||
for (int i = 0; i < gameListSize; ++i)
|
for (int i = 0; i < gameListSize; ++i)
|
||||||
gameSelector->processGameInfo(info.game_list(i));
|
gameSelector->processGameInfo(info.game_list(i));
|
||||||
|
|
||||||
|
setFocusProxy(sayEdit);
|
||||||
|
chatView->setFocusProxy(sayEdit);
|
||||||
|
QTimer::singleShot(0, sayEdit, SLOT(setFocus()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TabRoom::~TabRoom()
|
TabRoom::~TabRoom()
|
||||||
|
|
|
@ -241,7 +241,7 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32
|
||||||
{
|
{
|
||||||
switch (r) {
|
switch (r) {
|
||||||
case Response::RespWrongPassword:
|
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;
|
break;
|
||||||
case Response::RespWouldOverwriteOldSession:
|
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."));
|
QMessageBox::critical(this, tr("Error"), tr("There is already an active session using this user name.\nPlease close that session first and re-login."));
|
||||||
|
|
|
@ -201,6 +201,11 @@ int OracleImporter::importTextSpoiler(CardSet *set, const QVariant &data)
|
||||||
cardText = map.contains("text") ? map.value("text").toString() : QString("");
|
cardText = map.contains("text") ? map.value("text").toString() : QString("");
|
||||||
cardId = map.contains("multiverseid") ? map.value("multiverseid").toInt() : 0;
|
cardId = map.contains("multiverseid") ? map.value("multiverseid").toInt() : 0;
|
||||||
cardLoyalty = map.contains("loyalty") ? map.value("loyalty").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"));
|
CardInfo *card = addCard(set->getShortName(), cardName, false, cardId, cardCost, cardType, cardPT, cardLoyalty, cardText.split("\n"));
|
||||||
|
|
3
servatrice/scripts/maint_replays
Normal file
3
servatrice/scripts/maint_replays
Normal file
|
@ -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'
|
3
servatrice/scripts/maint_sessions
Normal file
3
servatrice/scripts/maint_sessions
Normal file
|
@ -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)"
|
3
servatrice/scripts/mysql.cnf.example
Normal file
3
servatrice/scripts/mysql.cnf.example
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[client]
|
||||||
|
user={db_username}
|
||||||
|
password={db_password}
|
Loading…
Reference in a new issue