2014-04-26 15:01:35 +02:00
|
|
|
#ifndef DB_REDIS_HEADER
|
|
|
|
#define DB_REDIS_HEADER
|
|
|
|
|
|
|
|
#include "db.h"
|
|
|
|
#include <hiredis.h>
|
|
|
|
|
|
|
|
class DBRedis : public DB {
|
|
|
|
public:
|
|
|
|
DBRedis(const std::string &mapdir);
|
|
|
|
virtual std::vector<BlockPos> getBlockPos();
|
|
|
|
virtual void getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos);
|
2016-10-13 23:26:59 +02:00
|
|
|
virtual ~DBRedis();
|
2014-04-26 15:01:35 +02:00
|
|
|
private:
|
2016-10-09 00:27:31 +02:00
|
|
|
static std::string replyTypeStr(int type);
|
|
|
|
|
2014-04-26 15:01:35 +02:00
|
|
|
void loadPosCache();
|
|
|
|
|
|
|
|
std::vector<BlockPos> posCache;
|
|
|
|
|
|
|
|
redisContext *ctx;
|
|
|
|
std::string hash;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DB_REDIS_HEADER
|