diff options
author | sr | 2013-02-05 19:48:39 +0100 |
---|---|---|
committer | sr | 2013-02-05 19:48:39 +0100 |
commit | e9b4cb4721b7c7f02728e22f92f5ad7a94828521 (patch) | |
tree | 14e7573bf8ec0764cb9b9519f81ceb49830b777a /src/server/net/client.h | |
parent | ... (diff) | |
download | pvs2-e9b4cb4721b7c7f02728e22f92f5ad7a94828521.tar.gz pvs2-e9b4cb4721b7c7f02728e22f92f5ad7a94828521.tar.xz pvs2-e9b4cb4721b7c7f02728e22f92f5ad7a94828521.zip |
[SERVER] Go back from ClientId to int, so queued signal/slot connections work
Diffstat (limited to 'src/server/net/client.h')
-rw-r--r-- | src/server/net/client.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/server/net/client.h b/src/server/net/client.h index 08cac71..ce17c18 100644 --- a/src/server/net/client.h +++ b/src/server/net/client.h @@ -16,14 +16,12 @@ struct ClientLogin QString ip; }; -typedef int ClientId; - class Client : public QObject { Q_OBJECT private: - static ClientId _clientIdCounter; + static int _clientIdCounter; QSslSocket *_socket; int _authed; // 0 = challenge sent, awaiting reply 1 = challenge ok, client challenge replied, awaiting login, 2 = ESTABLISHED @@ -35,18 +33,18 @@ private: NetworkMessage _toClient, _fromClient; int _timerIdAuthTimeout, _timerDelete; - ClientId _id; // this client's unique id + 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. - ClientId _desiredProjectionSource; + int _desiredProjectionSource; // This boolean tells whether this client is currently the VNC broadcast source. This // version only allows "one to all others" setups bool _isProjectionSource; - ClientId _currentProjectionSource; + int _currentProjectionSource; QString _vncRwPass, _vncRoPass; int _vncPort; @@ -71,18 +69,18 @@ public: 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 ClientId id() const { return _id; } + 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 ClientId desiredProjectionSource() const { return _desiredProjectionSource; } - inline void setDesiredProjectionSource(ClientId source) { _desiredProjectionSource = source; } + inline const int desiredProjectionSource() const { return _desiredProjectionSource; } + inline void setDesiredProjectionSource(int source) { _desiredProjectionSource = source; } inline const bool isProjectionSource() const { return _isProjectionSource; } inline void setProjectionSource(bool enable) { _isProjectionSource = enable; } - inline const ClientId currentProjectionSource() const { return _currentProjectionSource; } + inline const int currentProjectionSource() const { return _currentProjectionSource; } void startVncServer(); void stopVncServer(); void stopVncClient(); @@ -93,7 +91,7 @@ signals: void authenticated(Client* client); void thumbUpdated(Client* client, const QPixmap& thumb); void vncServerStateChange(Client* client); - void vncClientStateChange(Client* client, ClientId lastProjectionSource); + void vncClientStateChange(Client* client, int lastProjectionSource); void disconnected(); private slots: |