Commit 571cf91e authored by Max-Wilhelm Bruker's avatar Max-Wilhelm Bruker
Browse files

translation update; made server status update optional

parent 62ccd51f
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
[server] [server]
port=4747 port=4747
statusupdate=15000
[authentication] [authentication]
method=none method=none
...@@ -12,15 +13,12 @@ database=servatrice ...@@ -12,15 +13,12 @@ database=servatrice
user=servatrice user=servatrice
password=foobar password=foobar
[messages] [rooms]
login="Example line"
[chatchannels]
size=1 size=1
1\name="General Chat" 1\name="General room"
1\description="Discuss anything here." 1\description="Play anything here."
1\autojoin=true 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] [game]
max_game_inactivity_time=120 max_game_inactivity_time=120
......
...@@ -33,16 +33,22 @@ Servatrice::Servatrice(QObject *parent) ...@@ -33,16 +33,22 @@ Servatrice::Servatrice(QObject *parent)
connect(pingClock, SIGNAL(timeout()), this, SIGNAL(pingClockTimeout())); connect(pingClock, SIGNAL(timeout()), this, SIGNAL(pingClockTimeout()));
pingClock->start(1000); pingClock->start(1000);
statusUpdateClock = new QTimer(this);
connect(statusUpdateClock, SIGNAL(timeout()), this, SLOT(statusUpdate()));
statusUpdateClock->start(15000);
ProtocolItem::initializeHash(); ProtocolItem::initializeHash();
settings = new QSettings("servatrice.ini", QSettings::IniFormat, this); 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); tcpServer = new QTcpServer(this);
connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); 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(); QString dbType = settings->value("database/type").toString();
dbPrefix = settings->value("database/prefix").toString(); dbPrefix = settings->value("database/prefix").toString();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment