mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 12:03:55 -07:00
initial commit for server network support
This commit is contained in:
parent
4dc712286f
commit
50e53fbe53
3 changed files with 77 additions and 10 deletions
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include <QTcpServer>
|
||||
#include <QMutex>
|
||||
#include <QSslCertificate>
|
||||
#include <QSslKey>
|
||||
#include "server.h"
|
||||
|
||||
class QSqlDatabase;
|
||||
|
|
@ -33,18 +35,31 @@ class GameReplay;
|
|||
class Servatrice;
|
||||
class ServerSocketInterface;
|
||||
|
||||
class Servatrice_TcpServer : public QTcpServer {
|
||||
class Servatrice_GameServer : public QTcpServer {
|
||||
Q_OBJECT
|
||||
private:
|
||||
Servatrice *server;
|
||||
bool threaded;
|
||||
public:
|
||||
Servatrice_TcpServer(Servatrice *_server, bool _threaded, QObject *parent = 0)
|
||||
Servatrice_GameServer(Servatrice *_server, bool _threaded, QObject *parent = 0)
|
||||
: QTcpServer(parent), server(_server), threaded(_threaded) { }
|
||||
protected:
|
||||
void incomingConnection(int socketDescriptor);
|
||||
};
|
||||
|
||||
class Servatrice_NetworkServer : public QTcpServer {
|
||||
Q_OBJECT
|
||||
private:
|
||||
Servatrice *server;
|
||||
QSslCertificate cert;
|
||||
QSslKey privateKey;
|
||||
public:
|
||||
Servatrice_NetworkServer(Servatrice *_server, const QSslCertificate &_cert, const QSslKey &_privateKey, QObject *parent = 0)
|
||||
: QTcpServer(parent), server(_server), cert(_cert), privateKey(_privateKey) { }
|
||||
protected:
|
||||
void incomingConnection(int socketDescriptor);
|
||||
};
|
||||
|
||||
class Servatrice : public Server
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -94,7 +109,8 @@ private:
|
|||
AuthenticationMethod authenticationMethod;
|
||||
DatabaseType databaseType;
|
||||
QTimer *pingClock, *statusUpdateClock;
|
||||
QTcpServer *tcpServer;
|
||||
Servatrice_GameServer *gameServer;
|
||||
Servatrice_NetworkServer *networkServer;
|
||||
QString serverName;
|
||||
QString loginMessage;
|
||||
QString dbPrefix;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue