diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2015-03-19 00:59:37 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2015-03-19 00:59:37 +0100 |
| commit | 3d01ec1643191822370ba01c11ec6cc247e06599 (patch) | |
| tree | 20177a2f860de93203533e4c051880d11f98697b /ClientInfo.hpp | |
| parent | 8983d3b38421843db67a05edee180028959c1b51 (diff) | |
| download | manager-3d01ec1643191822370ba01c11ec6cc247e06599.tar.gz manager-3d01ec1643191822370ba01c11ec6cc247e06599.zip | |
Added Managemen-Interface on TCP port 9372 listening on localhost.
Diffstat (limited to 'ClientInfo.hpp')
| -rw-r--r-- | ClientInfo.hpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/ClientInfo.hpp b/ClientInfo.hpp index f3def0e..a9010eb 100644 --- a/ClientInfo.hpp +++ b/ClientInfo.hpp @@ -4,7 +4,18 @@ enum ClientInterface { Clonk = 1, - IRC = 1 << 1 + IRC = 1 << 1, + Management = 1 << 2 +}; + + +class ManagementConnection { +public: + ManagementConnection() {} + ManagementConnection(QTcpSocket* socket, const QString& name = "") : socket(socket), name(name) {} + + QTcpSocket* socket = 0; + QString name = ""; }; class ClientInfo @@ -19,6 +30,8 @@ public: bool activated = false; QString target = ""; + ManagementConnection management; + static inline ClientInfo ircClient(QString nick, QString target = "") { @@ -44,6 +57,15 @@ public: return ret; } + static inline ClientInfo managementClient(ManagementConnection conn) + { + ClientInfo ret; + ret.interface = Management; + ret.management = conn; + ret.nick = conn.name; + return ret; + } + inline bool operator==(const ClientInfo& other) { return other.interface == interface && other.nick == nick && (interface == Clonk ? other.pcName == pcName && other.CUID == CUID : true); |
