diff options
author | Peter Powell <petpow@saberuk.com> | 2019-05-13 17:24:25 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-10-14 11:03:03 +0100 |
commit | d0f802e30c492cb1b7e55f51063bfd38b29931c6 (patch) | |
tree | a11cbb5c48fae151d285e0536d4f51b2b09659da /include/users.h | |
parent | 51b9b4c9b404bd801be194644133be47bd035b58 (diff) |
Implement serialisation of users.
This allows for various things which will be coming in the future.
e.g. Transferring users to another server on upgrade.
Diffstat (limited to 'include/users.h')
-rw-r--r-- | include/users.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/users.h b/include/users.h index e58e8e316..6cc7f423b 100644 --- a/include/users.h +++ b/include/users.h @@ -676,6 +676,12 @@ class CoreExport User : public Extensible */ virtual ~User(); CullResult cull() CXX11_OVERRIDE; + + /** @copydoc Serializable::Deserialize. */ + bool Deserialize(Data& data) CXX11_OVERRIDE; + + /** @copydoc Serializable::Deserialize. */ + bool Serialize(Serializable::Data& data) CXX11_OVERRIDE; }; class CoreExport UserIOHandler : public StreamSocket @@ -729,6 +735,8 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node<Local public: LocalUser(int fd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server); + LocalUser(int fd, const std::string& uuid, Serializable::Data& data); + CullResult cull() CXX11_OVERRIDE; UserIOHandler eh; @@ -872,6 +880,12 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node<Local * @param msg Message to send. */ void Send(ClientProtocol::EventProvider& protoevprov, ClientProtocol::Message& msg); + + /** @copydoc Serializable::Deserialize. */ + bool Deserialize(Data& data) CXX11_OVERRIDE; + + /** @copydoc Serializable::Deserialize. */ + bool Serialize(Serializable::Data& data) CXX11_OVERRIDE; }; class RemoteUser : public User |