diff options
author | ShadowNinja <shadowninja@minetest.net> | 2014-11-16 15:31:57 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2015-03-06 00:20:45 -0500 |
commit | 708337dfc2b3871dc6de983e781e4a4a60a1881d (patch) | |
tree | 97352d676d9d76b036d8b559ae4d3c6fe83bbf12 /src/database-redis.h | |
parent | c7454d4732dee0f7364ccb8e07002df1a037b94d (diff) | |
download | minetest-708337dfc2b3871dc6de983e781e4a4a60a1881d.tar.gz minetest-708337dfc2b3871dc6de983e781e4a4a60a1881d.tar.bz2 minetest-708337dfc2b3871dc6de983e781e4a4a60a1881d.zip |
Clean up database API and save the local map on an interval
Diffstat (limited to 'src/database-redis.h')
-rw-r--r-- | src/database-redis.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/database-redis.h b/src/database-redis.h index 3c4e2b6d8..45e702c83 100644 --- a/src/database-redis.h +++ b/src/database-redis.h @@ -28,24 +28,28 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <hiredis.h> #include <string> -class ServerMap; +class Settings; class Database_Redis : public Database { public: - Database_Redis(ServerMap *map, std::string savedir); + Database_Redis(Settings &conf); + ~Database_Redis(); + virtual void beginSave(); virtual void endSave(); - virtual bool saveBlock(v3s16 blockpos, std::string &data); - virtual std::string loadBlock(v3s16 blockpos); - virtual bool deleteBlock(v3s16 blockpos); + + virtual bool saveBlock(const v3s16 &pos, const std::string &data); + virtual std::string loadBlock(const v3s16 &pos); + virtual bool deleteBlock(const v3s16 &pos); virtual void listAllLoadableBlocks(std::vector<v3s16> &dst); - virtual int Initialized(void); - ~Database_Redis(); + private: - ServerMap *srvmap; redisContext *ctx; std::string hash; }; + +#endif // USE_REDIS + #endif -#endif + |