mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
renamed servernetwork to ISL (inter-server link), join/leave is working
This commit is contained in:
parent
dda78661ea
commit
5963c2239c
9 changed files with 155 additions and 78 deletions
|
|
@ -1,48 +0,0 @@
|
|||
#ifndef NETWORKSERVERINTERFACE_H
|
||||
#define NETWORKSERVERINTERFACE_H
|
||||
|
||||
#include "servatrice.h"
|
||||
#include <QSslCertificate>
|
||||
#include <QSslKey>
|
||||
#include <QWaitCondition>
|
||||
|
||||
class Servatrice;
|
||||
class QSslSocket;
|
||||
class ServerNetworkMessage;
|
||||
|
||||
class NetworkServerInterface : public QObject {
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
void readClient();
|
||||
void catchSocketError(QAbstractSocket::SocketError socketError);
|
||||
void flushOutputBuffer();
|
||||
signals:
|
||||
void outputBufferChanged();
|
||||
private:
|
||||
int socketDescriptor;
|
||||
QString peerHostName, peerAddress;
|
||||
int peerPort;
|
||||
QSslCertificate peerCert;
|
||||
|
||||
QMutex outputBufferMutex;
|
||||
Servatrice *server;
|
||||
QSslSocket *socket;
|
||||
|
||||
QByteArray inputBuffer, outputBuffer;
|
||||
bool messageInProgress;
|
||||
int messageLength;
|
||||
|
||||
void processMessage(const ServerNetworkMessage &item);
|
||||
void sharedCtor(const QSslCertificate &cert, const QSslKey &privateKey);
|
||||
public slots:
|
||||
void initServer();
|
||||
void initClient();
|
||||
public:
|
||||
NetworkServerInterface(int socketDescriptor, const QSslCertificate &cert, const QSslKey &privateKey, Servatrice *_server);
|
||||
NetworkServerInterface(const QString &peerHostName, const QString &peerAddress, int peerPort, const QSslCertificate &peerCert, const QSslCertificate &cert, const QSslKey &privateKey, Servatrice *_server);
|
||||
~NetworkServerInterface();
|
||||
|
||||
void transmitMessage(const ServerNetworkMessage &item);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue