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*
|
||||
*.qm
|
||||
.directory
|
||||
mysql.cnf
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -34,6 +34,10 @@ TabMessage::TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, c
|
|||
|
||||
retranslateUi();
|
||||
setLayout(vbox);
|
||||
|
||||
setFocusProxy(sayEdit);
|
||||
chatView->setFocusProxy(sayEdit);
|
||||
sayEdit->setFocus();
|
||||
}
|
||||
|
||||
TabMessage::~TabMessage()
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <QLabel>
|
||||
#include <QToolButton>
|
||||
#include <QSplitter>
|
||||
#include <QTimer>
|
||||
#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()
|
||||
|
|
|
@ -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."));
|
||||
|
|
|
@ -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"));
|
||||
|
|
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