diff options
author | Treeki <treeki@gmail.com> | 2014-01-28 00:08:33 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2014-01-28 00:08:33 +0100 |
commit | b95ed984f8bd2fe413d53d4b8677fe3d04bc1ad9 (patch) | |
tree | 5da2f4d891215fb709f7165644fd4a0c92f1aefd /bouncer/core.h | |
parent | 277c08cbc35f4cb2b72f1b00ab3e5f8efd2f8fb2 (diff) | |
download | bounce4-b95ed984f8bd2fe413d53d4b8677fe3d04bc1ad9.tar.gz bounce4-b95ed984f8bd2fe413d53d4b8677fe3d04bc1ad9.zip |
implement server configuration loading/saving
Diffstat (limited to '')
-rw-r--r-- | bouncer/core.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bouncer/core.h b/bouncer/core.h index 8817b77..1a13a1d 100644 --- a/bouncer/core.h +++ b/bouncer/core.h @@ -284,6 +284,9 @@ public: Server(NetCore *_netCore); virtual ~Server(); + virtual void loadFromConfig(std::map<std::string, std::string> &data) = 0; + virtual void saveToConfig(std::map<std::string, std::string> &data) = 0; + protected: void connect(const char *hostname, int _port, bool _useTls); @@ -361,6 +364,9 @@ private: public: // This probably *shouldn't* be public... >< void deleteQuery(Query *query); + + virtual void loadFromConfig(std::map<std::string, std::string> &data); + virtual void saveToConfig(std::map<std::string, std::string> &data); }; @@ -389,8 +395,12 @@ public: Client *findClientWithSessionKey(uint8_t *key) const; private: virtual Client *constructClient() = 0; + virtual Server *constructServer(const char *type) = 0; public: + void loadConfig(); + void saveConfig(); + int registerServer(Server *server); // THIS FUNCTION WILL BE PROTECTED LATER protected: void deregisterServer(int id); @@ -400,6 +410,7 @@ protected: class Bouncer : public NetCore { private: virtual Client *constructClient(); + virtual Server *constructServer(const char *type); }; |