mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 03:28:49 -07:00
new files
This commit is contained in:
parent
7921b5f82d
commit
58e803c3e7
10 changed files with 452 additions and 0 deletions
45
cockatrice/src/remoteclient.h
Normal file
45
cockatrice/src/remoteclient.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef REMOTECLIENT_H
|
||||
#define REMOTECLIENT_H
|
||||
|
||||
#include <QTcpSocket>
|
||||
#include "protocol_datastructures.h"
|
||||
#include "abstractclient.h"
|
||||
|
||||
class QTimer;
|
||||
class QXmlStreamReader;
|
||||
class QXmlStreamWriter;
|
||||
|
||||
class RemoteClient : public AbstractClient {
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void maxPingTime(int seconds, int maxSeconds);
|
||||
void serverTimeout();
|
||||
void socketError(const QString &errorString);
|
||||
void protocolVersionMismatch(int clientVersion, int serverVersion);
|
||||
void protocolError();
|
||||
private slots:
|
||||
void slotConnected();
|
||||
void readData();
|
||||
void slotSocketError(QAbstractSocket::SocketError error);
|
||||
void ping();
|
||||
void loginResponse(ResponseCode response);
|
||||
private:
|
||||
static const int maxTimeout = 10;
|
||||
|
||||
QTimer *timer;
|
||||
QTcpSocket *socket;
|
||||
QXmlStreamReader *xmlReader;
|
||||
QXmlStreamWriter *xmlWriter;
|
||||
TopLevelProtocolItem *topLevelItem;
|
||||
public:
|
||||
RemoteClient(QObject *parent = 0);
|
||||
~RemoteClient();
|
||||
QString peerName() const { return socket->peerName(); }
|
||||
|
||||
void connectToServer(const QString &hostname, unsigned int port, const QString &_userName, const QString &_password);
|
||||
void disconnectFromServer();
|
||||
|
||||
void sendCommandContainer(CommandContainer *cont);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue