diff options
author | Manuel Schneider | 2014-05-27 00:33:53 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-05-27 00:33:53 +0200 |
commit | bb97450ce228a86de631f3f8538f64415b2ee338 (patch) | |
tree | e39658c76bc38a1815662cf33011a5569c992215 | |
parent | Drop _desiredProjectionSource. Dont send a stopVncClient if it has not been s... (diff) | |
download | pvs2-bb97450ce228a86de631f3f8538f64415b2ee338.tar.gz pvs2-bb97450ce228a86de631f3f8538f64415b2ee338.tar.xz pvs2-bb97450ce228a86de631f3f8538f64415b2ee338.zip |
Drop _activeVncClient. _currentProjectionSource holds this information.
-rw-r--r-- | src/server/net/client.cpp | 5 | ||||
-rw-r--r-- | src/server/net/client.h | 10 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp index 4478e28..ef131fc 100644 --- a/src/server/net/client.cpp +++ b/src/server/net/client.cpp @@ -23,7 +23,6 @@ Client::Client(QSslSocket* socket) : _socket(socket) _isBroadcastSource = false; _currentProjectionSource = 0; _vncPort = 0; - _activeVncClient = false; _isTutor = false; _id = ++_clientIdCounter; @@ -189,10 +188,8 @@ void Client::handleMsg() else if (id == _VNCCLIENT) { // Client tells us that it started or stopped displaying a remote screen via VNC - _activeVncClient = (_fromClient.getFieldString("ENABLED").toInt() != 0); const int projectionSource = (int)_fromClient.getFieldString("CLIENTID").toInt(); - - if (_activeVncClient) + if (_fromClient.getFieldString("ENABLED").toInt() != 0) { qDebug() << "Client " << _name << " started its VNC client (watching " << projectionSource << ")"; emit vncClientStateChange(this, _currentProjectionSource); diff --git a/src/server/net/client.h b/src/server/net/client.h index 5623717..14e0f0e 100644 --- a/src/server/net/client.h +++ b/src/server/net/client.h @@ -45,10 +45,9 @@ public: inline const QString ip() const { return _socket->peerAddress().toString(); } inline const int id() const { return _id; } 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 isBroadcastSource() const { return _isBroadcastSource; } + inline const bool isActiveVncClient() const { return _currentProjectionSource > 0; } + inline const bool isActiveVncServer() const { return _vncPort > 0; } + inline const bool isBroadcastSource() const { return _isBroadcastSource; } // Setters inline void setBroadcastSource(bool enable) { _isBroadcastSource = enable; } @@ -75,10 +74,9 @@ private: int _timerIdAuthTimeout, _timerPingTimeout; int _id; // this client's unique id bool _isBroadcastSource; // 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 + int _currentProjectionSource; // VNCclient state. 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; |