diff options
author | Manuel Schneider | 2014-05-20 14:47:42 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-05-20 14:47:42 +0200 |
commit | 58646932664b6ab9014a410dc75dd443fb4f58b9 (patch) | |
tree | a4a1f6f8b414abfa16dba6145e9c8dffb542d2c5 /src/server/net/client.h | |
parent | Merge branch 'master' of git.openslx.org:pvs2 (diff) | |
download | pvs2-58646932664b6ab9014a410dc75dd443fb4f58b9.tar.gz pvs2-58646932664b6ab9014a410dc75dd443fb4f58b9.tar.xz pvs2-58646932664b6ab9014a410dc75dd443fb4f58b9.zip |
Remove any knowledge of Networkmesage in Mainwindow
Diffstat (limited to 'src/server/net/client.h')
-rw-r--r-- | src/server/net/client.h | 79 |
1 files changed, 34 insertions, 45 deletions
diff --git a/src/server/net/client.h b/src/server/net/client.h index a6d9001..e9bd46b 100644 --- a/src/server/net/client.h +++ b/src/server/net/client.h @@ -21,55 +21,10 @@ class Client : public QObject { Q_OBJECT -private: - static int _clientIdCounter; - - QSslSocket *_socket; - 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 _toClient, _fromClient; - int _timerIdAuthTimeout, _timerDelete, _timerPingTimeout; - - // this client's unique id - int _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 - // questionable if this makes sense, as it might just be confusing if several - // groups students watch different other students. Also, visualizing such a - // situation in the GUI in a meaningful way would be hard. - int _desiredProjectionSource; - - - bool _isProjectionSource; // Tells whether this client is currently the VNC broadcast source. - int _currentProjectionSource; - - QString _vncRwPass, _vncRoPass; - - // Indicates the state of the client. The clients acts as VNC server if this - // port is set. If this value is less than or equal to 0 ist is no server. - int _vncPort; - - // Flag indicating that the client is displaying a remote screen via VNC - bool _activeVncClient; - - // Flag indicating that the client has been set as a tutor - bool _isTutor; - - void handleMsg(); - -protected: - void timerEvent(QTimerEvent* event); - public: explicit Client(QSslSocket* socket); ~Client(); void requestThumb(const int width, const int height); - void sendMessage(NetworkMessage& message); //void acceptData(); const inline bool isAuthed() const { return _authed == 2; } const inline QString& name() const { return _name; } @@ -91,9 +46,43 @@ public: inline const int currentProjectionSource() const { return _currentProjectionSource; } void startVncServer(); void stopVncServer(); + void startVncClient(QString host, int port, QString pass, int id, QString caption); void stopVncClient(); + void lockScreen(bool); void setTutor(bool enable); +private: + static int _clientIdCounter; + + QSslSocket *_socket; + 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 _toClient, _fromClient; + int _timerIdAuthTimeout, _timerDelete, _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 + // questionable if this makes sense, as it might just be confusing if several + // groups students watch different other students. Also, visualizing such a + // situation in the GUI in a meaningful way would be hard. + int _desiredProjectionSource; + bool _isProjectionSource; // Tells whether this client is currently the VNC broadcast source. + int _currentProjectionSource; + QString _vncRwPass, _vncRoPass; + int _vncPort; // VNCserver state. Greater 0 -> active on this port. Equals 0 -> no server. + bool _activeVncClient; // Flag indicating that the client is displaying a remote screen via VNC + bool _isTutor; // Flag indicating that the client has been set as a tutor + + void handleMsg(); + void sendMessage(NetworkMessage& message); + +protected: + void timerEvent(QTimerEvent* event); + signals: void authenticating(Client* client, ClientLogin* request); void authenticated(Client* client); |