log moderation stats in the uptime table (#3215)
This commit is contained in:
parent
661e00f563
commit
2520d07ef2
7 changed files with 136 additions and 121 deletions
|
@ -53,10 +53,6 @@ Server::Server(QObject *parent) : QObject(parent), nextLocalGameId(0), tcpUserCo
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
Server::~Server()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Server::prepareDestroy()
|
void Server::prepareDestroy()
|
||||||
{
|
{
|
||||||
roomsLock.lockForWrite();
|
roomsLock.lockForWrite();
|
||||||
|
@ -146,8 +142,8 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session,
|
||||||
users.insert(name, session);
|
users.insert(name, session);
|
||||||
qDebug() << "Server::loginUser:" << session << "name=" << name;
|
qDebug() << "Server::loginUser:" << session << "name=" << name;
|
||||||
|
|
||||||
data.set_session_id(
|
data.set_session_id(static_cast<google::protobuf::uint64>(
|
||||||
databaseInterface->startSession(name, session->getAddress(), clientid, session->getConnectionType()));
|
databaseInterface->startSession(name, session->getAddress(), clientid, session->getConnectionType())));
|
||||||
databaseInterface->unlockSessionTables();
|
databaseInterface->unlockSessionTables();
|
||||||
|
|
||||||
usersBySessionId.insert(data.session_id(), session);
|
usersBySessionId.insert(data.session_id(), session);
|
||||||
|
@ -158,9 +154,9 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session,
|
||||||
Event_UserJoined event;
|
Event_UserJoined event;
|
||||||
event.mutable_user_info()->CopyFrom(session->copyUserInfo(false));
|
event.mutable_user_info()->CopyFrom(session->copyUserInfo(false));
|
||||||
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
||||||
for (int i = 0; i < clients.size(); ++i)
|
for (auto &client : clients)
|
||||||
if (clients[i]->getAcceptsUserListChanges())
|
if (client->getAcceptsUserListChanges())
|
||||||
clients[i]->sendProtocolItem(*se);
|
client->sendProtocolItem(*se);
|
||||||
delete se;
|
delete se;
|
||||||
|
|
||||||
event.mutable_user_info()->CopyFrom(session->copyUserInfo(true, true, true));
|
event.mutable_user_info()->CopyFrom(session->copyUserInfo(true, true, true));
|
||||||
|
@ -240,9 +236,9 @@ void Server::removeClient(Server_ProtocolHandler *client)
|
||||||
Event_UserLeft event;
|
Event_UserLeft event;
|
||||||
event.set_name(data->name());
|
event.set_name(data->name());
|
||||||
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
||||||
for (int i = 0; i < clients.size(); ++i)
|
for (auto &client : clients)
|
||||||
if (clients[i]->getAcceptsUserListChanges())
|
if (client->getAcceptsUserListChanges())
|
||||||
clients[i]->sendProtocolItem(*se);
|
client->sendProtocolItem(*se);
|
||||||
sendIsl_SessionEvent(*se);
|
sendIsl_SessionEvent(*se);
|
||||||
delete se;
|
delete se;
|
||||||
|
|
||||||
|
@ -260,12 +256,12 @@ void Server::removeClient(Server_ProtocolHandler *client)
|
||||||
<< users.size() << "users left";
|
<< users.size() << "users left";
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QString> Server::getOnlineModeratorList()
|
QList<QString> Server::getOnlineModeratorList() const
|
||||||
{
|
{
|
||||||
// clients list should be locked by calling function prior to iteration otherwise sigfaults may occur
|
// clients list should be locked by calling function prior to iteration otherwise sigfaults may occur
|
||||||
QList<QString> results;
|
QList<QString> results;
|
||||||
for (int i = 0; i < clients.size(); ++i) {
|
for (auto &client : clients) {
|
||||||
ServerInfo_User *data = clients[i]->getUserInfo();
|
ServerInfo_User *data = client->getUserInfo();
|
||||||
|
|
||||||
// TODO: this line should be updated in the event there is any type of new user level created
|
// TODO: this line should be updated in the event there is any type of new user level created
|
||||||
if (data &&
|
if (data &&
|
||||||
|
@ -288,9 +284,9 @@ void Server::externalUserJoined(const ServerInfo_User &userInfo)
|
||||||
event.mutable_user_info()->CopyFrom(userInfo);
|
event.mutable_user_info()->CopyFrom(userInfo);
|
||||||
|
|
||||||
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
||||||
for (int i = 0; i < clients.size(); ++i)
|
for (auto &client : clients)
|
||||||
if (clients[i]->getAcceptsUserListChanges())
|
if (client->getAcceptsUserListChanges())
|
||||||
clients[i]->sendProtocolItem(*se);
|
client->sendProtocolItem(*se);
|
||||||
delete se;
|
delete se;
|
||||||
clientsLock.unlock();
|
clientsLock.unlock();
|
||||||
|
|
||||||
|
@ -338,9 +334,9 @@ void Server::externalUserLeft(const QString &userName)
|
||||||
|
|
||||||
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
||||||
clientsLock.lockForRead();
|
clientsLock.lockForRead();
|
||||||
for (int i = 0; i < clients.size(); ++i)
|
for (auto &client : clients)
|
||||||
if (clients[i]->getAcceptsUserListChanges())
|
if (client->getAcceptsUserListChanges())
|
||||||
clients[i]->sendProtocolItem(*se);
|
client->sendProtocolItem(*se);
|
||||||
clientsLock.unlock();
|
clientsLock.unlock();
|
||||||
delete se;
|
delete se;
|
||||||
}
|
}
|
||||||
|
@ -428,7 +424,7 @@ void Server::externalJoinGameCommandReceived(const Command_JoinGame &cmd,
|
||||||
userInterface->sendResponseContainer(responseContainer, responseCode);
|
userInterface->sendResponseContainer(responseContainer, responseCode);
|
||||||
} catch (Response::ResponseCode &code) {
|
} catch (Response::ResponseCode &code) {
|
||||||
Response response;
|
Response response;
|
||||||
response.set_cmd_id(cmdId);
|
response.set_cmd_id(static_cast<google::protobuf::uint64>(cmdId));
|
||||||
response.set_response_code(code);
|
response.set_response_code(code);
|
||||||
|
|
||||||
sendIsl_Response(response, serverId, sessionId);
|
sendIsl_Response(response, serverId, sessionId);
|
||||||
|
@ -443,7 +439,7 @@ void Server::externalGameCommandContainerReceived(const CommandContainer &cont,
|
||||||
// This function is always called from the main thread via signal/slot.
|
// This function is always called from the main thread via signal/slot.
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ResponseContainer responseContainer(cont.cmd_id());
|
ResponseContainer responseContainer(static_cast<int>(cont.cmd_id()));
|
||||||
Response::ResponseCode finalResponseCode = Response::RespOk;
|
Response::ResponseCode finalResponseCode = Response::RespOk;
|
||||||
|
|
||||||
QReadLocker roomsLocker(&roomsLock);
|
QReadLocker roomsLocker(&roomsLock);
|
||||||
|
@ -531,9 +527,9 @@ void Server::broadcastRoomUpdate(const ServerInfo_Room &roomInfo, bool sendToIsl
|
||||||
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
SessionEvent *se = Server_ProtocolHandler::prepareSessionEvent(event);
|
||||||
|
|
||||||
clientsLock.lockForRead();
|
clientsLock.lockForRead();
|
||||||
for (int i = 0; i < clients.size(); ++i)
|
for (auto &client : clients)
|
||||||
if (clients[i]->getAcceptsRoomListChanges())
|
if (client->getAcceptsRoomListChanges())
|
||||||
clients[i]->sendProtocolItem(*se);
|
client->sendProtocolItem(*se);
|
||||||
clientsLock.unlock();
|
clientsLock.unlock();
|
||||||
|
|
||||||
if (sendToIsl)
|
if (sendToIsl)
|
||||||
|
@ -575,7 +571,7 @@ void Server::sendIsl_Response(const Response &item, int serverId, qint64 session
|
||||||
IslMessage msg;
|
IslMessage msg;
|
||||||
msg.set_message_type(IslMessage::RESPONSE);
|
msg.set_message_type(IslMessage::RESPONSE);
|
||||||
if (sessionId != -1)
|
if (sessionId != -1)
|
||||||
msg.set_session_id(sessionId);
|
msg.set_session_id(static_cast<google::protobuf::uint64>(sessionId));
|
||||||
msg.mutable_response()->CopyFrom(item);
|
msg.mutable_response()->CopyFrom(item);
|
||||||
|
|
||||||
emit sigSendIslMessage(msg, serverId);
|
emit sigSendIslMessage(msg, serverId);
|
||||||
|
@ -586,7 +582,7 @@ void Server::sendIsl_SessionEvent(const SessionEvent &item, int serverId, qint64
|
||||||
IslMessage msg;
|
IslMessage msg;
|
||||||
msg.set_message_type(IslMessage::SESSION_EVENT);
|
msg.set_message_type(IslMessage::SESSION_EVENT);
|
||||||
if (sessionId != -1)
|
if (sessionId != -1)
|
||||||
msg.set_session_id(sessionId);
|
msg.set_session_id(static_cast<google::protobuf::uint64>(sessionId));
|
||||||
msg.mutable_session_event()->CopyFrom(item);
|
msg.mutable_session_event()->CopyFrom(item);
|
||||||
|
|
||||||
emit sigSendIslMessage(msg, serverId);
|
emit sigSendIslMessage(msg, serverId);
|
||||||
|
@ -597,7 +593,7 @@ void Server::sendIsl_GameEventContainer(const GameEventContainer &item, int serv
|
||||||
IslMessage msg;
|
IslMessage msg;
|
||||||
msg.set_message_type(IslMessage::GAME_EVENT_CONTAINER);
|
msg.set_message_type(IslMessage::GAME_EVENT_CONTAINER);
|
||||||
if (sessionId != -1)
|
if (sessionId != -1)
|
||||||
msg.set_session_id(sessionId);
|
msg.set_session_id(static_cast<google::protobuf::uint64>(sessionId));
|
||||||
msg.mutable_game_event_container()->CopyFrom(item);
|
msg.mutable_game_event_container()->CopyFrom(item);
|
||||||
|
|
||||||
emit sigSendIslMessage(msg, serverId);
|
emit sigSendIslMessage(msg, serverId);
|
||||||
|
@ -608,7 +604,7 @@ void Server::sendIsl_RoomEvent(const RoomEvent &item, int serverId, qint64 sessi
|
||||||
IslMessage msg;
|
IslMessage msg;
|
||||||
msg.set_message_type(IslMessage::ROOM_EVENT);
|
msg.set_message_type(IslMessage::ROOM_EVENT);
|
||||||
if (sessionId != -1)
|
if (sessionId != -1)
|
||||||
msg.set_session_id(sessionId);
|
msg.set_session_id(static_cast<google::protobuf::uint64>(sessionId));
|
||||||
msg.mutable_room_event()->CopyFrom(item);
|
msg.mutable_room_event()->CopyFrom(item);
|
||||||
|
|
||||||
emit sigSendIslMessage(msg, serverId);
|
emit sigSendIslMessage(msg, serverId);
|
||||||
|
@ -618,12 +614,12 @@ void Server::sendIsl_GameCommand(const CommandContainer &item, int serverId, qin
|
||||||
{
|
{
|
||||||
IslMessage msg;
|
IslMessage msg;
|
||||||
msg.set_message_type(IslMessage::GAME_COMMAND_CONTAINER);
|
msg.set_message_type(IslMessage::GAME_COMMAND_CONTAINER);
|
||||||
msg.set_session_id(sessionId);
|
msg.set_session_id(static_cast<google::protobuf::uint64>(sessionId));
|
||||||
msg.set_player_id(playerId);
|
msg.set_player_id(playerId);
|
||||||
|
|
||||||
CommandContainer *cont = msg.mutable_game_command();
|
CommandContainer *cont = msg.mutable_game_command();
|
||||||
cont->CopyFrom(item);
|
cont->CopyFrom(item);
|
||||||
cont->set_room_id(roomId);
|
cont->set_room_id(static_cast<google::protobuf::uint32>(roomId));
|
||||||
|
|
||||||
emit sigSendIslMessage(msg, serverId);
|
emit sigSendIslMessage(msg, serverId);
|
||||||
}
|
}
|
||||||
|
@ -632,11 +628,11 @@ void Server::sendIsl_RoomCommand(const CommandContainer &item, int serverId, qin
|
||||||
{
|
{
|
||||||
IslMessage msg;
|
IslMessage msg;
|
||||||
msg.set_message_type(IslMessage::ROOM_COMMAND_CONTAINER);
|
msg.set_message_type(IslMessage::ROOM_COMMAND_CONTAINER);
|
||||||
msg.set_session_id(sessionId);
|
msg.set_session_id(static_cast<google::protobuf::uint64>(sessionId));
|
||||||
|
|
||||||
CommandContainer *cont = msg.mutable_room_command();
|
CommandContainer *cont = msg.mutable_room_command();
|
||||||
cont->CopyFrom(item);
|
cont->CopyFrom(item);
|
||||||
cont->set_room_id(roomId);
|
cont->set_room_id(static_cast<google::protobuf::uint32>(roomId));
|
||||||
|
|
||||||
emit sigSendIslMessage(msg, serverId);
|
emit sigSendIslMessage(msg, serverId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,8 +56,8 @@ private slots:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
mutable QReadWriteLock clientsLock, roomsLock; // locking order: roomsLock before clientsLock
|
mutable QReadWriteLock clientsLock, roomsLock; // locking order: roomsLock before clientsLock
|
||||||
Server(QObject *parent = 0);
|
Server(QObject *parent = nullptr);
|
||||||
~Server();
|
~Server() = default;
|
||||||
AuthenticationResult loginUser(Server_ProtocolHandler *session,
|
AuthenticationResult loginUser(Server_ProtocolHandler *session,
|
||||||
QString &name,
|
QString &name,
|
||||||
const QString &password,
|
const QString &password,
|
||||||
|
@ -87,7 +87,7 @@ public:
|
||||||
}
|
}
|
||||||
void addClient(Server_ProtocolHandler *player);
|
void addClient(Server_ProtocolHandler *player);
|
||||||
void removeClient(Server_ProtocolHandler *player);
|
void removeClient(Server_ProtocolHandler *player);
|
||||||
QList<QString> getOnlineModeratorList();
|
QList<QString> getOnlineModeratorList() const;
|
||||||
virtual QString getLoginMessage() const
|
virtual QString getLoginMessage() const
|
||||||
{
|
{
|
||||||
return QString();
|
return QString();
|
||||||
|
@ -187,8 +187,6 @@ public:
|
||||||
void sendIsl_GameCommand(const CommandContainer &item, int serverId, qint64 sessionId, int roomId, int playerId);
|
void sendIsl_GameCommand(const CommandContainer &item, int serverId, qint64 sessionId, int roomId, int playerId);
|
||||||
void sendIsl_RoomCommand(const CommandContainer &item, int serverId, qint64 sessionId, int roomId);
|
void sendIsl_RoomCommand(const CommandContainer &item, int serverId, qint64 sessionId, int roomId);
|
||||||
|
|
||||||
void addExternalUser(const ServerInfo_User &userInfo);
|
|
||||||
void removeExternalUser(const QString &userName);
|
|
||||||
const QMap<QString, Server_AbstractUserInterface *> &getExternalUsers() const
|
const QMap<QString, Server_AbstractUserInterface *> &getExternalUsers() const
|
||||||
{
|
{
|
||||||
return externalUsers;
|
return externalUsers;
|
||||||
|
|
6
servatrice/migrations/servatrice_0024_to_0025.sql
Normal file
6
servatrice/migrations/servatrice_0024_to_0025.sql
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
-- Servatrice db migration from version 24 to version 25
|
||||||
|
|
||||||
|
ALTER TABLE cockatrice_uptime ADD COLUMN mods_count int(11) NOT NULL DEFAULT 0;
|
||||||
|
ALTER TABLE cockatrice_uptime ADD COLUMN mods_list TEXT;
|
||||||
|
|
||||||
|
UPDATE cockatrice_schema_version SET version=25 WHERE version=24;
|
|
@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `cockatrice_schema_version` (
|
||||||
PRIMARY KEY (`version`)
|
PRIMARY KEY (`version`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
INSERT INTO cockatrice_schema_version VALUES(24);
|
INSERT INTO cockatrice_schema_version VALUES(25);
|
||||||
|
|
||||||
-- users and user data tables
|
-- users and user data tables
|
||||||
CREATE TABLE IF NOT EXISTS `cockatrice_users` (
|
CREATE TABLE IF NOT EXISTS `cockatrice_users` (
|
||||||
|
@ -164,6 +164,8 @@ CREATE TABLE IF NOT EXISTS `cockatrice_uptime` (
|
||||||
`timest` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
`timest` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
`uptime` int(11) NOT NULL,
|
`uptime` int(11) NOT NULL,
|
||||||
`users_count` int(11) NOT NULL,
|
`users_count` int(11) NOT NULL,
|
||||||
|
`mods_count` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`mods_list` TEXT,
|
||||||
`games_count` int(11) NOT NULL,
|
`games_count` int(11) NOT NULL,
|
||||||
`rx_bytes` int(11) NOT NULL,
|
`rx_bytes` int(11) NOT NULL,
|
||||||
`tx_bytes` int(11) NOT NULL,
|
`tx_bytes` int(11) NOT NULL,
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -47,10 +48,10 @@ Servatrice_GameServer::Servatrice_GameServer(Servatrice *_server,
|
||||||
: QTcpServer(parent), server(_server)
|
: QTcpServer(parent), server(_server)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _numberPools; ++i) {
|
for (int i = 0; i < _numberPools; ++i) {
|
||||||
Servatrice_DatabaseInterface *newDatabaseInterface = new Servatrice_DatabaseInterface(i, server);
|
auto newDatabaseInterface = new Servatrice_DatabaseInterface(i, server);
|
||||||
Servatrice_ConnectionPool *newPool = new Servatrice_ConnectionPool(newDatabaseInterface);
|
auto newPool = new Servatrice_ConnectionPool(newDatabaseInterface);
|
||||||
|
|
||||||
QThread *newThread = new QThread;
|
auto newThread = new QThread;
|
||||||
newThread->setObjectName("pool_" + QString::number(i));
|
newThread->setObjectName("pool_" + QString::number(i));
|
||||||
newPool->moveToThread(newThread);
|
newPool->moveToThread(newThread);
|
||||||
newDatabaseInterface->moveToThread(newThread);
|
newDatabaseInterface->moveToThread(newThread);
|
||||||
|
@ -78,7 +79,7 @@ void Servatrice_GameServer::incomingConnection(qintptr socketDescriptor)
|
||||||
{
|
{
|
||||||
Servatrice_ConnectionPool *pool = findLeastUsedConnectionPool();
|
Servatrice_ConnectionPool *pool = findLeastUsedConnectionPool();
|
||||||
|
|
||||||
TcpServerSocketInterface *ssi = new TcpServerSocketInterface(server, pool->getDatabaseInterface());
|
auto ssi = new TcpServerSocketInterface(server, pool->getDatabaseInterface());
|
||||||
ssi->moveToThread(pool->thread());
|
ssi->moveToThread(pool->thread());
|
||||||
pool->addClient();
|
pool->addClient();
|
||||||
connect(ssi, SIGNAL(destroyed()), pool, SLOT(removeClient()));
|
connect(ssi, SIGNAL(destroyed()), pool, SLOT(removeClient()));
|
||||||
|
@ -113,9 +114,8 @@ Servatrice_WebsocketGameServer::Servatrice_WebsocketGameServer(Servatrice *_serv
|
||||||
: QWebSocketServer("Servatrice", QWebSocketServer::NonSecureMode, parent), server(_server)
|
: QWebSocketServer("Servatrice", QWebSocketServer::NonSecureMode, parent), server(_server)
|
||||||
{
|
{
|
||||||
// Qt limitation: websockets can't be moved to another thread
|
// Qt limitation: websockets can't be moved to another thread
|
||||||
Servatrice_DatabaseInterface *newDatabaseInterface =
|
auto newDatabaseInterface = new Servatrice_DatabaseInterface(WEBSOCKET_POOL_NUMBER, server);
|
||||||
new Servatrice_DatabaseInterface(WEBSOCKET_POOL_NUMBER, server);
|
auto newPool = new Servatrice_ConnectionPool(newDatabaseInterface);
|
||||||
Servatrice_ConnectionPool *newPool = new Servatrice_ConnectionPool(newDatabaseInterface);
|
|
||||||
|
|
||||||
server->addDatabaseInterface(thread(), newDatabaseInterface);
|
server->addDatabaseInterface(thread(), newDatabaseInterface);
|
||||||
newDatabaseInterface->initDatabase(_sqlDatabase);
|
newDatabaseInterface->initDatabase(_sqlDatabase);
|
||||||
|
@ -139,7 +139,7 @@ void Servatrice_WebsocketGameServer::onNewConnection()
|
||||||
{
|
{
|
||||||
Servatrice_ConnectionPool *pool = findLeastUsedConnectionPool();
|
Servatrice_ConnectionPool *pool = findLeastUsedConnectionPool();
|
||||||
|
|
||||||
WebsocketServerSocketInterface *ssi = new WebsocketServerSocketInterface(server, pool->getDatabaseInterface());
|
auto ssi = new WebsocketServerSocketInterface(server, pool->getDatabaseInterface());
|
||||||
// ssi->moveToThread(pool->thread());
|
// ssi->moveToThread(pool->thread());
|
||||||
pool->addClient();
|
pool->addClient();
|
||||||
connect(ssi, SIGNAL(destroyed()), pool, SLOT(removeClient()));
|
connect(ssi, SIGNAL(destroyed()), pool, SLOT(removeClient()));
|
||||||
|
@ -167,10 +167,10 @@ Servatrice_ConnectionPool *Servatrice_WebsocketGameServer::findLeastUsedConnecti
|
||||||
|
|
||||||
void Servatrice_IslServer::incomingConnection(qintptr socketDescriptor)
|
void Servatrice_IslServer::incomingConnection(qintptr socketDescriptor)
|
||||||
{
|
{
|
||||||
QThread *thread = new QThread;
|
auto thread = new QThread;
|
||||||
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
|
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
|
||||||
|
|
||||||
IslInterface *interface = new IslInterface(socketDescriptor, cert, privateKey, server);
|
auto interface = new IslInterface(static_cast<int>(socketDescriptor), cert, privateKey, server);
|
||||||
interface->moveToThread(thread);
|
interface->moveToThread(thread);
|
||||||
connect(interface, SIGNAL(destroyed()), thread, SLOT(quit()));
|
connect(interface, SIGNAL(destroyed()), thread, SLOT(quit()));
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ void Servatrice_IslServer::incomingConnection(qintptr socketDescriptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
Servatrice::Servatrice(QObject *parent)
|
Servatrice::Servatrice(QObject *parent)
|
||||||
: Server(parent), authenticationMethod(AuthenticationNone), uptime(0), shutdownTimer(0),
|
: Server(parent), authenticationMethod(AuthenticationNone), uptime(0), shutdownTimer(nullptr),
|
||||||
isFirstShutdownMessage(true)
|
isFirstShutdownMessage(true)
|
||||||
{
|
{
|
||||||
qRegisterMetaType<QSqlDatabase>("QSqlDatabase");
|
qRegisterMetaType<QSqlDatabase>("QSqlDatabase");
|
||||||
|
@ -191,8 +191,8 @@ Servatrice::~Servatrice()
|
||||||
|
|
||||||
// clients live in other threads, we need to lock them
|
// clients live in other threads, we need to lock them
|
||||||
clientsLock.lockForRead();
|
clientsLock.lockForRead();
|
||||||
for (int i = 0; i < clients.size(); ++i)
|
for (auto client : clients)
|
||||||
QMetaObject::invokeMethod(clients.at(i), "prepareDestroy", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(client, "prepareDestroy", Qt::QueuedConnection);
|
||||||
clientsLock.unlock();
|
clientsLock.unlock();
|
||||||
|
|
||||||
// client destruction is asynchronous, wait for all clients to be gone
|
// client destruction is asynchronous, wait for all clients to be gone
|
||||||
|
@ -316,7 +316,7 @@ bool Servatrice::initServer()
|
||||||
gameTypes.append(query2->value(0).toString());
|
gameTypes.append(query2->value(0).toString());
|
||||||
addRoom(new Server_Room(query->value(0).toInt(), query->value(7).toInt(), query->value(1).toString(),
|
addRoom(new Server_Room(query->value(0).toInt(), query->value(7).toInt(), query->value(1).toString(),
|
||||||
query->value(2).toString(), query->value(3).toString().toLower(),
|
query->value(2).toString(), query->value(3).toString().toLower(),
|
||||||
query->value(4).toString().toLower(), query->value(5).toInt(),
|
query->value(4).toString().toLower(), static_cast<bool>(query->value(5).toInt()),
|
||||||
query->value(6).toString(), gameTypes, this));
|
query->value(6).toString(), gameTypes, this));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -362,7 +362,7 @@ bool Servatrice::initServer()
|
||||||
|
|
||||||
const QDateTime currentTime = QDateTime::currentDateTime();
|
const QDateTime currentTime = QDateTime::currentDateTime();
|
||||||
if (currentTime < cert.effectiveDate() || currentTime > cert.expiryDate() || cert.isBlacklisted())
|
if (currentTime < cert.effectiveDate() || currentTime > cert.expiryDate() || cert.isBlacklisted())
|
||||||
throw(QString("Invalid certificate."));
|
throw QString("Invalid certificate.");
|
||||||
|
|
||||||
qDebug() << "Loading private key...";
|
qDebug() << "Loading private key...";
|
||||||
QFile keyFile(getISLNetworkSSLKeyFile());
|
QFile keyFile(getISLNetworkSSLKeyFile());
|
||||||
|
@ -380,7 +380,7 @@ bool Servatrice::initServer()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
QThread *thread = new QThread;
|
auto *thread = new QThread;
|
||||||
thread->setObjectName("isl_" + QString::number(prop.id));
|
thread->setObjectName("isl_" + QString::number(prop.id));
|
||||||
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
|
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ bool Servatrice::initServer()
|
||||||
|
|
||||||
qDebug() << "Starting ISL server on port" << getISLNetworkPort();
|
qDebug() << "Starting ISL server on port" << getISLNetworkPort();
|
||||||
islServer = new Servatrice_IslServer(this, cert, key, this);
|
islServer = new Servatrice_IslServer(this, cert, key, this);
|
||||||
if (islServer->listen(QHostAddress::Any, getISLNetworkPort()))
|
if (islServer->listen(QHostAddress::Any, static_cast<quint16>(getISLNetworkPort())))
|
||||||
qDebug() << "ISL server listening.";
|
qDebug() << "ISL server listening.";
|
||||||
else
|
else
|
||||||
throw QString("islServer->listen()");
|
throw QString("islServer->listen()");
|
||||||
|
@ -422,7 +422,7 @@ bool Servatrice::initServer()
|
||||||
new Servatrice_GameServer(this, getNumberOfTCPPools(), servatriceDatabaseInterface->getDatabase(), this);
|
new Servatrice_GameServer(this, getNumberOfTCPPools(), servatriceDatabaseInterface->getDatabase(), this);
|
||||||
gameServer->setMaxPendingConnections(1000);
|
gameServer->setMaxPendingConnections(1000);
|
||||||
qDebug() << "Starting server on port" << getServerTCPPort();
|
qDebug() << "Starting server on port" << getServerTCPPort();
|
||||||
if (gameServer->listen(QHostAddress::Any, getServerTCPPort()))
|
if (gameServer->listen(QHostAddress::Any, static_cast<quint16>(getServerTCPPort())))
|
||||||
qDebug() << "Server listening.";
|
qDebug() << "Server listening.";
|
||||||
else {
|
else {
|
||||||
qDebug() << "gameServer->listen(): Error:" << gameServer->errorString();
|
qDebug() << "gameServer->listen(): Error:" << gameServer->errorString();
|
||||||
|
@ -437,7 +437,7 @@ bool Servatrice::initServer()
|
||||||
servatriceDatabaseInterface->getDatabase(), this);
|
servatriceDatabaseInterface->getDatabase(), this);
|
||||||
websocketGameServer->setMaxPendingConnections(1000);
|
websocketGameServer->setMaxPendingConnections(1000);
|
||||||
qDebug() << "Starting websocket server on port" << getServerWebSocketPort();
|
qDebug() << "Starting websocket server on port" << getServerWebSocketPort();
|
||||||
if (websocketGameServer->listen(QHostAddress::Any, getServerWebSocketPort()))
|
if (websocketGameServer->listen(QHostAddress::Any, static_cast<quint16>(getServerWebSocketPort())))
|
||||||
qDebug() << "Websocket server listening.";
|
qDebug() << "Websocket server listening.";
|
||||||
else {
|
else {
|
||||||
qDebug() << "websocketGameServer->listen(): Error:" << websocketGameServer->errorString();
|
qDebug() << "websocketGameServer->listen(): Error:" << websocketGameServer->errorString();
|
||||||
|
@ -504,8 +504,8 @@ int Servatrice::getUsersWithAddress(const QHostAddress &address) const
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
QReadLocker locker(&clientsLock);
|
QReadLocker locker(&clientsLock);
|
||||||
for (int i = 0; i < clients.size(); ++i)
|
for (auto client : clients)
|
||||||
if (static_cast<AbstractServerSocketInterface *>(clients[i])->getPeerAddress() == address)
|
if (static_cast<AbstractServerSocketInterface *>(client)->getPeerAddress() == address)
|
||||||
++result;
|
++result;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -515,9 +515,9 @@ QList<AbstractServerSocketInterface *> Servatrice::getUsersWithAddressAsList(con
|
||||||
{
|
{
|
||||||
QList<AbstractServerSocketInterface *> result;
|
QList<AbstractServerSocketInterface *> result;
|
||||||
QReadLocker locker(&clientsLock);
|
QReadLocker locker(&clientsLock);
|
||||||
for (int i = 0; i < clients.size(); ++i)
|
for (auto client : clients)
|
||||||
if (static_cast<AbstractServerSocketInterface *>(clients[i])->getPeerAddress() == address)
|
if (static_cast<AbstractServerSocketInterface *>(client)->getPeerAddress() == address)
|
||||||
result.append(static_cast<AbstractServerSocketInterface *>(clients[i]));
|
result.append(static_cast<AbstractServerSocketInterface *>(client));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -566,6 +566,11 @@ void Servatrice::statusUpdate()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int uc = getUsersCount(); // for correct mutex locking order
|
const int uc = getUsersCount(); // for correct mutex locking order
|
||||||
|
|
||||||
|
const QStringList mods_info = getOnlineModeratorList();
|
||||||
|
const int mc = mods_info.size();
|
||||||
|
const QString ml = mods_info.join(", ");
|
||||||
|
|
||||||
const int gc = getGamesCount();
|
const int gc = getGamesCount();
|
||||||
|
|
||||||
uptime += statusUpdateClock->interval() / 1000;
|
uptime += statusUpdateClock->interval() / 1000;
|
||||||
|
@ -580,11 +585,14 @@ void Servatrice::statusUpdate()
|
||||||
rxBytesMutex.unlock();
|
rxBytesMutex.unlock();
|
||||||
|
|
||||||
QSqlQuery *query = servatriceDatabaseInterface->prepareQuery(
|
QSqlQuery *query = servatriceDatabaseInterface->prepareQuery(
|
||||||
"insert into {prefix}_uptime (id_server, timest, uptime, users_count, games_count, tx_bytes, rx_bytes) "
|
"insert into {prefix}_uptime (id_server, timest, uptime, users_count, mods_count, mods_list, games_count, "
|
||||||
"values(:id, NOW(), :uptime, :users_count, :games_count, :tx, :rx)");
|
"tx_bytes, rx_bytes) values(:id, NOW(), :uptime, :users_count, :mods_count, :mods_list, :games_count, :tx, "
|
||||||
|
":rx)");
|
||||||
query->bindValue(":id", serverId);
|
query->bindValue(":id", serverId);
|
||||||
query->bindValue(":uptime", uptime);
|
query->bindValue(":uptime", uptime);
|
||||||
query->bindValue(":users_count", uc);
|
query->bindValue(":users_count", uc);
|
||||||
|
query->bindValue(":mods_count", mc);
|
||||||
|
query->bindValue(":mods_list", ml);
|
||||||
query->bindValue(":games_count", gc);
|
query->bindValue(":games_count", gc);
|
||||||
query->bindValue(":tx", tx);
|
query->bindValue(":tx", tx);
|
||||||
query->bindValue(":rx", rx);
|
query->bindValue(":rx", rx);
|
||||||
|
@ -592,19 +600,19 @@ void Servatrice::statusUpdate()
|
||||||
|
|
||||||
if (getRegistrationEnabled() && getEnableInternalSMTPClient()) {
|
if (getRegistrationEnabled() && getEnableInternalSMTPClient()) {
|
||||||
if (getRequireEmailActivationEnabled()) {
|
if (getRequireEmailActivationEnabled()) {
|
||||||
QSqlQuery *query = servatriceDatabaseInterface->prepareQuery("select a.name, b.email, b.token from "
|
auto servDbSelQuery = servatriceDatabaseInterface->prepareQuery("select a.name, b.email, b.token from "
|
||||||
"{prefix}_activation_emails a left join "
|
"{prefix}_activation_emails a left join "
|
||||||
"{prefix}_users b on a.name = b.name");
|
"{prefix}_users b on a.name = b.name");
|
||||||
if (!servatriceDatabaseInterface->execSqlQuery(query))
|
if (!servatriceDatabaseInterface->execSqlQuery(servDbSelQuery))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QSqlQuery *queryDelete =
|
auto *queryDelete =
|
||||||
servatriceDatabaseInterface->prepareQuery("delete from {prefix}_activation_emails where name = :name");
|
servatriceDatabaseInterface->prepareQuery("delete from {prefix}_activation_emails where name = :name");
|
||||||
|
|
||||||
while (query->next()) {
|
while (servDbSelQuery->next()) {
|
||||||
const QString userName = query->value(0).toString();
|
const QString userName = servDbSelQuery->value(0).toString();
|
||||||
const QString emailAddress = query->value(1).toString();
|
const QString emailAddress = servDbSelQuery->value(1).toString();
|
||||||
const QString token = query->value(2).toString();
|
const QString token = servDbSelQuery->value(2).toString();
|
||||||
|
|
||||||
if (smtpClient->enqueueActivationTokenMail(userName, emailAddress, token)) {
|
if (smtpClient->enqueueActivationTokenMail(userName, emailAddress, token)) {
|
||||||
queryDelete->bindValue(":name", userName);
|
queryDelete->bindValue(":name", userName);
|
||||||
|
@ -614,19 +622,19 @@ void Servatrice::statusUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getEnableForgotPassword()) {
|
if (getEnableForgotPassword()) {
|
||||||
QSqlQuery *query = servatriceDatabaseInterface->prepareQuery(
|
auto *forgotPwQuery = servatriceDatabaseInterface->prepareQuery(
|
||||||
"select a.name, b.email, b.token from {prefix}_forgot_password a left join {prefix}_users b on a.name "
|
"select a.name, b.email, b.token from {prefix}_forgot_password a left join {prefix}_users b on a.name "
|
||||||
"= b.name where a.emailed = 0");
|
"= b.name where a.emailed = 0");
|
||||||
if (!servatriceDatabaseInterface->execSqlQuery(query))
|
if (!servatriceDatabaseInterface->execSqlQuery(forgotPwQuery))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QSqlQuery *queryDelete = servatriceDatabaseInterface->prepareQuery(
|
QSqlQuery *queryDelete = servatriceDatabaseInterface->prepareQuery(
|
||||||
"update {prefix}_forgot_password set emailed = 1 where name = :name");
|
"update {prefix}_forgot_password set emailed = 1 where name = :name");
|
||||||
|
|
||||||
while (query->next()) {
|
while (forgotPwQuery->next()) {
|
||||||
const QString userName = query->value(0).toString();
|
const QString userName = forgotPwQuery->value(0).toString();
|
||||||
const QString emailAddress = query->value(1).toString();
|
const QString emailAddress = forgotPwQuery->value(1).toString();
|
||||||
const QString token = query->value(2).toString();
|
const QString token = forgotPwQuery->value(2).toString();
|
||||||
|
|
||||||
if (smtpClient->enqueueForgotPasswordTokenMail(userName, emailAddress, token)) {
|
if (smtpClient->enqueueForgotPasswordTokenMail(userName, emailAddress, token)) {
|
||||||
queryDelete->bindValue(":name", userName);
|
queryDelete->bindValue(":name", userName);
|
||||||
|
@ -677,7 +685,7 @@ void Servatrice::shutdownTimeout()
|
||||||
if (shutdownMinutes) {
|
if (shutdownMinutes) {
|
||||||
Event_ServerShutdown event;
|
Event_ServerShutdown event;
|
||||||
event.set_reason(shutdownReason.toStdString());
|
event.set_reason(shutdownReason.toStdString());
|
||||||
event.set_minutes(shutdownMinutes);
|
event.set_minutes(static_cast<google::protobuf::uint32>(shutdownMinutes));
|
||||||
se = Server_ProtocolHandler::prepareSessionEvent(event);
|
se = Server_ProtocolHandler::prepareSessionEvent(event);
|
||||||
} else {
|
} else {
|
||||||
Event_ConnectionClosed event;
|
Event_ConnectionClosed event;
|
||||||
|
@ -686,8 +694,8 @@ void Servatrice::shutdownTimeout()
|
||||||
}
|
}
|
||||||
|
|
||||||
clientsLock.lockForRead();
|
clientsLock.lockForRead();
|
||||||
for (int i = 0; i < clients.size(); ++i)
|
for (auto &client : clients)
|
||||||
clients[i]->sendProtocolItem(*se);
|
client->sendProtocolItem(*se);
|
||||||
clientsLock.unlock();
|
clientsLock.unlock();
|
||||||
delete se;
|
delete se;
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <QSqlDatabase>
|
#include <QSqlDatabase>
|
||||||
#include <QSslCertificate>
|
#include <QSslCertificate>
|
||||||
#include <QSslKey>
|
#include <QSslKey>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QSqlDatabase)
|
Q_DECLARE_METATYPE(QSqlDatabase)
|
||||||
|
|
||||||
|
@ -54,11 +55,14 @@ private:
|
||||||
QList<Servatrice_ConnectionPool *> connectionPools;
|
QList<Servatrice_ConnectionPool *> connectionPools;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Servatrice_GameServer(Servatrice *_server, int _numberPools, const QSqlDatabase &_sqlDatabase, QObject *parent = 0);
|
Servatrice_GameServer(Servatrice *_server,
|
||||||
~Servatrice_GameServer();
|
int _numberPools,
|
||||||
|
const QSqlDatabase &_sqlDatabase,
|
||||||
|
QObject *parent = nullptr);
|
||||||
|
~Servatrice_GameServer() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void incomingConnection(qintptr socketDescriptor);
|
void incomingConnection(qintptr socketDescriptor) override;
|
||||||
Servatrice_ConnectionPool *findLeastUsedConnectionPool();
|
Servatrice_ConnectionPool *findLeastUsedConnectionPool();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,8 +78,8 @@ public:
|
||||||
Servatrice_WebsocketGameServer(Servatrice *_server,
|
Servatrice_WebsocketGameServer(Servatrice *_server,
|
||||||
int _numberPools,
|
int _numberPools,
|
||||||
const QSqlDatabase &_sqlDatabase,
|
const QSqlDatabase &_sqlDatabase,
|
||||||
QObject *parent = 0);
|
QObject *parent = nullptr);
|
||||||
~Servatrice_WebsocketGameServer();
|
~Servatrice_WebsocketGameServer() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Servatrice_ConnectionPool *findLeastUsedConnectionPool();
|
Servatrice_ConnectionPool *findLeastUsedConnectionPool();
|
||||||
|
@ -96,13 +100,13 @@ public:
|
||||||
Servatrice_IslServer(Servatrice *_server,
|
Servatrice_IslServer(Servatrice *_server,
|
||||||
const QSslCertificate &_cert,
|
const QSslCertificate &_cert,
|
||||||
const QSslKey &_privateKey,
|
const QSslKey &_privateKey,
|
||||||
QObject *parent = 0)
|
QObject *parent = nullptr)
|
||||||
: QTcpServer(parent), server(_server), cert(_cert), privateKey(_privateKey)
|
: QTcpServer(parent), server(_server), cert(_cert), privateKey(_privateKey)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void incomingConnection(qintptr socketDescriptor);
|
void incomingConnection(qintptr socketDescriptor) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ServerProperties
|
class ServerProperties
|
||||||
|
@ -117,11 +121,12 @@ public:
|
||||||
|
|
||||||
ServerProperties(int _id,
|
ServerProperties(int _id,
|
||||||
const QSslCertificate &_cert,
|
const QSslCertificate &_cert,
|
||||||
const QString &_hostname,
|
QString _hostname,
|
||||||
const QHostAddress &_address,
|
const QHostAddress &_address,
|
||||||
int _gamePort,
|
int _gamePort,
|
||||||
int _controlPort)
|
int _controlPort)
|
||||||
: id(_id), cert(_cert), hostname(_hostname), address(_address), gamePort(_gamePort), controlPort(_controlPort)
|
: id(_id), cert(_cert), hostname(std::move(_hostname)), address(_address), gamePort(_gamePort),
|
||||||
|
controlPort(_controlPort)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -141,7 +146,7 @@ private slots:
|
||||||
void shutdownTimeout();
|
void shutdownTimeout();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void doSendIslMessage(const IslMessage &msg, int serverId);
|
void doSendIslMessage(const IslMessage &msg, int serverId) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum DatabaseType
|
enum DatabaseType
|
||||||
|
@ -201,13 +206,13 @@ private:
|
||||||
public slots:
|
public slots:
|
||||||
void scheduleShutdown(const QString &reason, int minutes);
|
void scheduleShutdown(const QString &reason, int minutes);
|
||||||
void updateLoginMessage();
|
void updateLoginMessage();
|
||||||
void setRequiredFeatures(const QString featureList);
|
void setRequiredFeatures(QString featureList);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Servatrice(QObject *parent = 0);
|
explicit Servatrice(QObject *parent = nullptr);
|
||||||
~Servatrice();
|
~Servatrice() override;
|
||||||
bool initServer();
|
bool initServer();
|
||||||
QMap<QString, bool> getServerRequiredFeatureList() const
|
QMap<QString, bool> getServerRequiredFeatureList() const override
|
||||||
{
|
{
|
||||||
return serverRequiredFeatureList;
|
return serverRequiredFeatureList;
|
||||||
}
|
}
|
||||||
|
@ -216,12 +221,12 @@ public:
|
||||||
return officialWarnings;
|
return officialWarnings;
|
||||||
}
|
}
|
||||||
QString getServerName() const;
|
QString getServerName() const;
|
||||||
QString getLoginMessage() const
|
QString getLoginMessage() const override
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&loginMessageMutex);
|
QMutexLocker locker(&loginMessageMutex);
|
||||||
return loginMessage;
|
return loginMessage;
|
||||||
}
|
}
|
||||||
QString getRequiredFeatures() const;
|
QString getRequiredFeatures() const override;
|
||||||
QString getAuthenticationMethodString() const;
|
QString getAuthenticationMethodString() const;
|
||||||
QString getDBTypeString() const;
|
QString getDBTypeString() const;
|
||||||
QString getDbPrefix() const
|
QString getDbPrefix() const
|
||||||
|
@ -233,40 +238,40 @@ public:
|
||||||
{
|
{
|
||||||
return authenticationMethod;
|
return authenticationMethod;
|
||||||
}
|
}
|
||||||
bool permitUnregisteredUsers() const
|
bool permitUnregisteredUsers() const override
|
||||||
{
|
{
|
||||||
return authenticationMethod != AuthenticationNone;
|
return authenticationMethod != AuthenticationNone;
|
||||||
}
|
}
|
||||||
bool getGameShouldPing() const
|
bool getGameShouldPing() const override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool getClientIDRequiredEnabled() const;
|
bool getClientIDRequiredEnabled() const override;
|
||||||
bool getRegOnlyServerEnabled() const;
|
bool getRegOnlyServerEnabled() const override;
|
||||||
bool getMaxUserLimitEnabled() const;
|
bool getMaxUserLimitEnabled() const override;
|
||||||
bool getStoreReplaysEnabled() const;
|
bool getStoreReplaysEnabled() const override;
|
||||||
bool getRegistrationEnabled() const;
|
bool getRegistrationEnabled() const;
|
||||||
bool getRequireEmailForRegistrationEnabled() const;
|
bool getRequireEmailForRegistrationEnabled() const;
|
||||||
bool getRequireEmailActivationEnabled() const;
|
bool getRequireEmailActivationEnabled() const;
|
||||||
bool getEnableLogQuery() const;
|
bool getEnableLogQuery() const override;
|
||||||
bool getEnableForgotPassword() const;
|
bool getEnableForgotPassword() const;
|
||||||
bool getEnableForgotPasswordChallenge() const;
|
bool getEnableForgotPasswordChallenge() const;
|
||||||
bool getEnableAudit() const;
|
bool getEnableAudit() const;
|
||||||
bool getEnableRegistrationAudit() const;
|
bool getEnableRegistrationAudit() const;
|
||||||
bool getEnableForgotPasswordAudit() const;
|
bool getEnableForgotPasswordAudit() const;
|
||||||
int getIdleClientTimeout() const;
|
int getIdleClientTimeout() const override;
|
||||||
int getServerID() const;
|
int getServerID() const override;
|
||||||
int getMaxGameInactivityTime() const;
|
int getMaxGameInactivityTime() const override;
|
||||||
int getMaxPlayerInactivityTime() const;
|
int getMaxPlayerInactivityTime() const override;
|
||||||
int getClientKeepAlive() const;
|
int getClientKeepAlive() const override;
|
||||||
int getMaxUsersPerAddress() const;
|
int getMaxUsersPerAddress() const;
|
||||||
int getMessageCountingInterval() const;
|
int getMessageCountingInterval() const override;
|
||||||
int getMaxMessageCountPerInterval() const;
|
int getMaxMessageCountPerInterval() const override;
|
||||||
int getMaxMessageSizePerInterval() const;
|
int getMaxMessageSizePerInterval() const override;
|
||||||
int getMaxGamesPerUser() const;
|
int getMaxGamesPerUser() const override;
|
||||||
int getCommandCountingInterval() const;
|
int getCommandCountingInterval() const override;
|
||||||
int getMaxCommandCountPerInterval() const;
|
int getMaxCommandCountPerInterval() const override;
|
||||||
int getMaxUserTotal() const;
|
int getMaxUserTotal() const override;
|
||||||
int getMaxTcpUserLimit() const;
|
int getMaxTcpUserLimit() const;
|
||||||
int getMaxWebSocketUserLimit() const;
|
int getMaxWebSocketUserLimit() const;
|
||||||
int getUsersWithAddress(const QHostAddress &address) const;
|
int getUsersWithAddress(const QHostAddress &address) const;
|
||||||
|
@ -285,4 +290,4 @@ public:
|
||||||
QList<ServerProperties> getServerList() const;
|
QList<ServerProperties> getServerList() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -9,7 +9,7 @@
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "server_database_interface.h"
|
#include "server_database_interface.h"
|
||||||
|
|
||||||
#define DATABASE_SCHEMA_VERSION 24
|
#define DATABASE_SCHEMA_VERSION 25
|
||||||
|
|
||||||
class Servatrice;
|
class Servatrice;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue