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
49
servatrice/src/isl_interface.h
Normal file
49
servatrice/src/isl_interface.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#ifndef ISL_INTERFACE_H
|
||||
#define ISL_INTERFACE_H
|
||||
|
||||
#include "servatrice.h"
|
||||
#include <QSslCertificate>
|
||||
#include <QWaitCondition>
|
||||
|
||||
class Servatrice;
|
||||
class QSslSocket;
|
||||
class QSslKey;
|
||||
class IslMessage;
|
||||
|
||||
class IslInterface : public QObject {
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
void readClient();
|
||||
void catchSocketError(QAbstractSocket::SocketError socketError);
|
||||
void flushOutputBuffer();
|
||||
signals:
|
||||
void outputBufferChanged();
|
||||
private:
|
||||
int serverId;
|
||||
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 IslMessage &item);
|
||||
void sharedCtor(const QSslCertificate &cert, const QSslKey &privateKey);
|
||||
public slots:
|
||||
void initServer();
|
||||
void initClient();
|
||||
public:
|
||||
IslInterface(int socketDescriptor, const QSslCertificate &cert, const QSslKey &privateKey, Servatrice *_server);
|
||||
IslInterface(int _serverId, const QString &peerHostName, const QString &peerAddress, int peerPort, const QSslCertificate &peerCert, const QSslCertificate &cert, const QSslKey &privateKey, Servatrice *_server);
|
||||
~IslInterface();
|
||||
|
||||
void transmitMessage(const IslMessage &item);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue