diff options
author | Manuel Schneider | 2014-05-22 11:41:31 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-05-22 11:44:19 +0200 |
commit | b2dd6e8b0b86446cb4d3f32403b029ee2496cc11 (patch) | |
tree | 7791fd2792b4c3ee4acb1b22c6b8bbeb20b55601 /src/server/net/client.h | |
parent | [Client] Make setTutor inline and drop the communication stuff since the clie... (diff) | |
download | pvs2-b2dd6e8b0b86446cb4d3f32403b029ee2496cc11.tar.gz pvs2-b2dd6e8b0b86446cb4d3f32403b029ee2496cc11.tar.xz pvs2-b2dd6e8b0b86446cb4d3f32403b029ee2496cc11.zip |
Fix segfault. Drop nullpointer polls since SslSocket is now const. [id == _VNCCLIENT] Logical reduction. Cleanup header.
Diffstat (limited to 'src/server/net/client.h')
-rw-r--r-- | src/server/net/client.h | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/server/net/client.h b/src/server/net/client.h index 389d05c..c148e76 100644 --- a/src/server/net/client.h +++ b/src/server/net/client.h @@ -46,16 +46,20 @@ public: inline const int id() const { return _id; } inline const int desiredProjectionSource() const { return _desiredProjectionSource; } inline const int currentProjectionSource() const { return _currentProjectionSource; } + // To be replaced by states + inline const bool isActiveVncClient() const { return _activeVncClient; } + inline const bool isActiveVncServer() const { return _vncPort > 0; } + inline const bool isProjectionSource() const { return _isProjectionSource; } // Setters inline void setProjectionSource(bool enable) { _isProjectionSource = enable; } inline void setDesiredProjectionSource(int source) { _desiredProjectionSource = source; } inline void setTutor(bool enable){ _isTutor = enable; } - // To be replaced by states - inline const bool isActiveVncClient() const { return _activeVncClient; } - inline const bool isActiveVncServer() const { return _vncPort > 0; } - inline const bool isProjectionSource() const { return _isProjectionSource; } + + //New ones +//b void startVncServer(); + //Send message stuff @@ -69,29 +73,24 @@ public: private: QSslSocket * const _socket; - State _state; - - static int _clientIdCounter; - int _authed; // 0 = challenge sent, awaiting reply 1 = challenge ok, client challenge replied, awaiting login, 2 = ESTABLISHED - QString _name; - QString _host; - QByteArray _challenge; - qint64 _pingTimeout; + State _state; + int _authed; // 0 = challenge sent, awaiting reply 1 = challenge ok, client challenge replied, awaiting login, 2 = ESTABLISHED + QString _name; + QString _host; + QByteArray _challenge; + qint64 _pingTimeout; NetworkMessage _fromClient; - 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 - // 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 + int _timerIdAuthTimeout, _timerPingTimeout; + int _id; // this client's unique id + 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 + + static int _clientIdCounter; void handleMsg(); void sendMessage(NetworkMessage& message); |