translation update; made server status update optional
This commit is contained in:
parent
62ccd51f11
commit
571cf91e00
7 changed files with 2537 additions and 1876 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,6 @@
|
|||
[server]
|
||||
port=4747
|
||||
statusupdate=15000
|
||||
|
||||
[authentication]
|
||||
method=none
|
||||
|
@ -12,15 +13,12 @@ database=servatrice
|
|||
user=servatrice
|
||||
password=foobar
|
||||
|
||||
[messages]
|
||||
login="Example line"
|
||||
|
||||
[chatchannels]
|
||||
[rooms]
|
||||
size=1
|
||||
1\name="General Chat"
|
||||
1\description="Discuss anything here."
|
||||
1\name="General room"
|
||||
1\description="Play anything here."
|
||||
1\autojoin=true
|
||||
1\joinmessage="This is the general chat channel. This message is only here to show that channels can have a join message."
|
||||
1\joinmessage="This message is only here to show that rooms can have a join message."
|
||||
|
||||
[game]
|
||||
max_game_inactivity_time=120
|
||||
|
|
|
@ -33,16 +33,22 @@ Servatrice::Servatrice(QObject *parent)
|
|||
connect(pingClock, SIGNAL(timeout()), this, SIGNAL(pingClockTimeout()));
|
||||
pingClock->start(1000);
|
||||
|
||||
statusUpdateClock = new QTimer(this);
|
||||
connect(statusUpdateClock, SIGNAL(timeout()), this, SLOT(statusUpdate()));
|
||||
statusUpdateClock->start(15000);
|
||||
|
||||
ProtocolItem::initializeHash();
|
||||
settings = new QSettings("servatrice.ini", QSettings::IniFormat, this);
|
||||
|
||||
int statusUpdateTime = settings->value("server/statusupdate").toInt();
|
||||
statusUpdateClock = new QTimer(this);
|
||||
connect(statusUpdateClock, SIGNAL(timeout()), this, SLOT(statusUpdate()));
|
||||
if (statusUpdateTime != 0) {
|
||||
qDebug() << "Starting status update clock, interval " << statusUpdateTime << " ms";
|
||||
statusUpdateClock->start(statusUpdateTime);
|
||||
}
|
||||
|
||||
tcpServer = new QTcpServer(this);
|
||||
connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection()));
|
||||
tcpServer->listen(QHostAddress::Any, settings->value("server/port", 4747).toInt());
|
||||
int port = settings->value("server/port", 4747).toInt();
|
||||
qDebug() << "Starting server on port" << port;
|
||||
tcpServer->listen(QHostAddress::Any, port);
|
||||
|
||||
QString dbType = settings->value("database/type").toString();
|
||||
dbPrefix = settings->value("database/prefix").toString();
|
||||
|
|
Loading…
Reference in a new issue