Cmake scripts refactoring; fix #3225 (#3230)

* fix #3225

* Servatrice: use websockets as an optional component (for qt < 5.3)

* Attempt++
This commit is contained in:
ctrlaltca 2018-05-12 23:28:22 +02:00 committed by GitHub
parent 73fb9ee03e
commit c06fc562a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 72 additions and 152 deletions

View file

@ -104,7 +104,7 @@ Servatrice_ConnectionPool *Servatrice_GameServer::findLeastUsedConnectionPool()
return connectionPools[poolIndex];
}
#if QT_VERSION > 0x050300
#ifdef QT_WEBSOCKETS_LIB
#define WEBSOCKET_POOL_NUMBER 999
Servatrice_WebsocketGameServer::Servatrice_WebsocketGameServer(Servatrice *_server,
@ -430,7 +430,7 @@ bool Servatrice::initServer()
}
}
#if QT_VERSION > 0x050300
#ifdef QT_WEBSOCKETS_LIB
// WEBSOCKET SERVER
if (getNumberOfWebSocketPools() > 0) {
websocketGameServer = new Servatrice_WebsocketGameServer(this, getNumberOfWebSocketPools(),

View file

@ -21,7 +21,7 @@
#define SERVATRICE_H
#include <QTcpServer>
#if QT_VERSION > 0x050300
#ifdef QT_WEBSOCKETS_LIB
#include <QWebSocketServer>
#endif
#include "server.h"
@ -66,7 +66,7 @@ protected:
Servatrice_ConnectionPool *findLeastUsedConnectionPool();
};
#if QT_VERSION > 0x050300
#ifdef QT_WEBSOCKETS_LIB
class Servatrice_WebsocketGameServer : public QWebSocketServer
{
Q_OBJECT
@ -158,7 +158,7 @@ private:
DatabaseType databaseType;
QTimer *pingClock, *statusUpdateClock;
Servatrice_GameServer *gameServer;
#if QT_VERSION > 0x050300
#ifdef QT_WEBSOCKETS_LIB
Servatrice_WebsocketGameServer *websocketGameServer;
#endif
Servatrice_IslServer *islServer;

View file

@ -1629,7 +1629,7 @@ bool TcpServerSocketInterface::initTcpSession()
return true;
}
#if QT_VERSION > 0x050300
#ifdef QT_WEBSOCKETS_LIB
WebsocketServerSocketInterface::WebsocketServerSocketInterface(Servatrice *_server,
Servatrice_DatabaseInterface *_databaseInterface,
QObject *parent)

View file

@ -21,7 +21,7 @@
#define SERVERSOCKETINTERFACE_H
#include <QTcpSocket>
#if QT_VERSION > 0x050300
#ifdef QT_WEBSOCKETS_LIB
#include <QWebSocket>
#endif
#include "server_protocolhandler.h"
@ -181,7 +181,7 @@ public slots:
void initConnection(int socketDescriptor);
};
#if QT_VERSION > 0x050300
#ifdef QT_WEBSOCKETS_LIB
class WebsocketServerSocketInterface : public AbstractServerSocketInterface
{
Q_OBJECT