diff options
author | Manuel Schneider | 2014-05-20 16:05:02 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-05-20 16:05:02 +0200 |
commit | 04931d80789a860c912358fd8c706585bb82a613 (patch) | |
tree | 4d2f919f0b35dabe8db827d5f9445569afc18eb8 /src/server/net | |
parent | Remvoe unneccesary membervariable _toClient and method buildErrorMessage (imp... (diff) | |
download | pvs2-04931d80789a860c912358fd8c706585bb82a613.tar.gz pvs2-04931d80789a860c912358fd8c706585bb82a613.tar.xz pvs2-04931d80789a860c912358fd8c706585bb82a613.zip |
Make vnc credentials completely private to client. Make VNCConnect work client-internally only. Drop Client::computerID() (equivalent to Client::ip() XD )
Diffstat (limited to 'src/server/net')
-rw-r--r-- | src/server/net/client.cpp | 17 | ||||
-rw-r--r-- | src/server/net/client.h | 10 |
2 files changed, 10 insertions, 17 deletions
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp index 9422e81..9bee319 100644 --- a/src/server/net/client.cpp +++ b/src/server/net/client.cpp @@ -298,7 +298,6 @@ void Client::handleMsg() /******************************************************************************/ void Client::startVncServer() { - _vncPort = 0; NetworkMessage msg; msg.setField(_ID, _VNCSERVER); msg.setField(_ENABLE, __TRUE); @@ -315,25 +314,23 @@ void Client::stopVncServer() } /******************************************************************************/ -void Client::stopVncClient() +void Client::startVncClient(const Client * const to) { - _activeVncClient = false; NetworkMessage msg; msg.setField(_ID, _VNCCLIENT); + msg.setField("HOST", to->_host); + msg.setField("PORT", QString::number(to->_vncPort)); + msg.setField("ROPASS", to->_vncRoPass); + msg.setField("CLIENTID", QString::number(to->_id)); + msg.setField("CAPTION", to->_name + " @ " + to->_host); sendMessage(msg); } /******************************************************************************/ -void Client::startVncClient(QString host, int port, QString pass, int id, QString caption) +void Client::stopVncClient() { - _activeVncClient = false; NetworkMessage msg; msg.setField(_ID, _VNCCLIENT); - msg.setField("HOST", host); - msg.setField("PORT", QString::number(port)); - msg.setField("ROPASS", pass); - msg.setField("CLIENTID", QString::number(id)); - msg.setField("CAPTION", caption); sendMessage(msg); } diff --git a/src/server/net/client.h b/src/server/net/client.h index e0bdfe8..bbd7ed0 100644 --- a/src/server/net/client.h +++ b/src/server/net/client.h @@ -31,12 +31,7 @@ public: 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& computerId() const { return _ip; } const inline int id() const { return _id; } - - inline const QString& vncRwPass() const { return _vncRwPass; } - inline const QString& vncRoPass() const { return _vncRoPass; } - inline const int vncPort() const { return _vncPort; } inline const bool isActiveVncClient() const { return _activeVncClient; } inline const bool isActiveVncServer() const { return _vncPort > 0; } inline const int desiredProjectionSource() const { return _desiredProjectionSource; } @@ -44,12 +39,13 @@ public: inline const bool isProjectionSource() const { return _isProjectionSource; } inline void setProjectionSource(bool enable) { _isProjectionSource = enable; } inline const int currentProjectionSource() const { return _currentProjectionSource; } + void setTutor(bool enable); + //Send message stuff void startVncServer(); void stopVncServer(); - void startVncClient(QString host, int port, QString pass, int id, QString caption); + void startVncClient(Client const * const to ); void stopVncClient(); void lockScreen(bool); - void setTutor(bool enable); private: static int _clientIdCounter; |