Refactor Game class (part 2) (#5422)
[oweals/minetest.git] / src / database-redis.h
index da76775d409c4530b7c49f081f1c825936a7ac87..3addaa20a7ad0c8e6e01fd997f03973d28353dc5 100644 (file)
@@ -28,23 +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);
-       virtual void beginSave();
-       virtual void endSave();
-       virtual void saveBlock(MapBlock *block);
-       virtual MapBlock* loadBlock(v3s16 blockpos);
-       virtual void listAllLoadableBlocks(std::list<v3s16> &dst);
-       virtual int Initialized(void);
+       Database_Redis(Settings &conf);
        ~Database_Redis();
+
+       void beginSave();
+       void endSave();
+
+       bool saveBlock(const v3s16 &pos, const std::string &data);
+       void loadBlock(const v3s16 &pos, std::string *block);
+       bool deleteBlock(const v3s16 &pos);
+       void listAllLoadableBlocks(std::vector<v3s16> &dst);
+
 private:
-       ServerMap *srvmap;
        redisContext *ctx;
        std::string hash;
 };
+
+#endif // USE_REDIS
+
 #endif
-#endif
+