diff options
Diffstat (limited to 'src/Net')
-rw-r--r-- | src/Net/Connection.cpp | 1 | ||||
-rw-r--r-- | src/Net/Connection.h | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/Net/Connection.cpp b/src/Net/Connection.cpp index da1ff3f..22f4570 100644 --- a/src/Net/Connection.cpp +++ b/src/Net/Connection.cpp @@ -281,6 +281,7 @@ void Connection::doDisconnect() { peer = 0; authenticated = false; + name.clear(); state = DISCONNECTED; } diff --git a/src/Net/Connection.h b/src/Net/Connection.h index 58e7291..953ccc8 100644 --- a/src/Net/Connection.h +++ b/src/Net/Connection.h @@ -20,11 +20,13 @@ #ifndef MAD_NET_CONNECTION_H_ #define MAD_NET_CONNECTION_H_ +#include "Packet.h" + #include <queue> +#include <string> #include <gnutls/gnutls.h> #include <sigc++/signal.h> #include <poll.h> -#include "Packet.h" namespace Mad { namespace Net { @@ -55,6 +57,7 @@ class Connection { sigc::signal<void,Connection*,const Packet&> signal; bool authenticated; + std::string name; void doHandshake(); @@ -152,6 +155,9 @@ class Connection { sigc::signal<void,Connection*,const Packet&> signalReceive() const {return signal;} + std::string getName() const {return name;} + void setName(const std::string& name0) {name = name0;} + static void init() { gnutls_global_init(); } |