summaryrefslogtreecommitdiffstats
path: root/src/server/net/client.h
diff options
context:
space:
mode:
authorManuel Schneider2014-05-21 12:07:58 +0200
committerManuel Schneider2014-05-21 12:07:58 +0200
commit52f3b434a7d26c2cf7fb614ca14ada0b1abdb378 (patch)
tree494d91c39f93997c44280baf7ea3e56d94db052c /src/server/net/client.h
parentFix ip bug (diff)
downloadpvs2-52f3b434a7d26c2cf7fb614ca14ada0b1abdb378.tar.gz
pvs2-52f3b434a7d26c2cf7fb614ca14ada0b1abdb378.tar.xz
pvs2-52f3b434a7d26c2cf7fb614ca14ada0b1abdb378.zip
Several changes:
* [Client] Remove unneccessary members _ip, * [Client] Remove unneccessary class forward of QSslSocket * [Client] Make member initializer list of non-const members part of ctor * [Client] Make _socket pointer const member * [Client] Drop socket-delete indirektion
Diffstat (limited to 'src/server/net/client.h')
-rw-r--r--src/server/net/client.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/server/net/client.h b/src/server/net/client.h
index bbd7ed0..244411d 100644
--- a/src/server/net/client.h
+++ b/src/server/net/client.h
@@ -2,12 +2,13 @@
#define CLIENT_H_
#include <QtCore>
-#include <QSslError>
+#include <QHostAddress>
#include <QAbstractSocket>
#include <QSslSocket>
+#include <QSslError>
#include "../../shared/networkmessage.h"
-class QSslSocket;
+//class QSslSocket;
struct ClientLogin
{
@@ -17,20 +18,20 @@ struct ClientLogin
QString ip;
};
+
class Client : public QObject
{
Q_OBJECT
-public:
+public:
explicit Client(QSslSocket* socket);
~Client();
+
void requestThumb(const int width, const int height);
- //void acceptData();
const inline bool isAuthed() const { return _authed == 2; }
const inline QString& name() const { return _name; }
const inline QString& host() const { return _host; }
- const inline QString& ip() const { return _ip; }
- // The computer ID (used eg. for saving the frame positions) is currently the IP, but this is an extra method for easier modification later on
+ const inline QString ip() const { return _socket->peerAddress().toString(); }
const inline int id() const { return _id; }
inline const bool isActiveVncClient() const { return _activeVncClient; }
inline const bool isActiveVncServer() const { return _vncPort > 0; }
@@ -48,17 +49,17 @@ public:
void lockScreen(bool);
private:
- static int _clientIdCounter;
- QSslSocket *_socket;
+ QSslSocket * const _socket;
+
+ static int _clientIdCounter;
int _authed; // 0 = challenge sent, awaiting reply 1 = challenge ok, client challenge replied, awaiting login, 2 = ESTABLISHED
QString _name;
QString _host;
- QString _ip;
QByteArray _challenge;
qint64 _pingTimeout;
NetworkMessage _fromClient;
- int _timerIdAuthTimeout, _timerDelete, _timerPingTimeout;
+ int _timerIdAuthTimeout, _timerPingTimeout;
int _id; // this client's unique id
// If this client should be projected to from another client, the other
// client's id is set here. 0 otherwise. This is not currently used and it is