#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
+