minetestmapper/db-redis.h
Christophe Le Roy 53706e811b DBRedis: add replyTypeStr
Maps Redis response constants to strings
2016-10-21 20:36:21 +02:00

25 lines
487 B
C++

#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);
virtual ~DBRedis();
private:
static std::string replyTypeStr(int type);
void loadPosCache();
std::vector<BlockPos> posCache;
redisContext *ctx;
std::string hash;
};
#endif // DB_REDIS_HEADER