DBRedis: add replyTypeStr

Maps Redis response constants to strings
This commit is contained in:
Christophe Le Roy 2016-10-09 00:27:31 +02:00 committed by sfan5
parent 26b62933ed
commit 53706e811b
2 changed files with 22 additions and 0 deletions

View File

@ -71,6 +71,26 @@ std::vector<BlockPos> DBRedis::getBlockPos()
}
std::string DBRedis::replyTypeStr(int type) {
switch(type) {
case REDIS_REPLY_STATUS:
return "REDIS_REPLY_STATUS";
case REDIS_REPLY_ERROR:
return "REDIS_REPLY_ERROR";
case REDIS_REPLY_INTEGER:
return "REDIS_REPLY_INTEGER";
case REDIS_REPLY_NIL:
return "REDIS_REPLY_NIL";
case REDIS_REPLY_STRING:
return "REDIS_REPLY_STRING";
case REDIS_REPLY_ARRAY:
return "REDIS_REPLY_ARRAY";
default:
return "UNKNOWN_REPLY_TYPE";
}
}
void DBRedis::loadPosCache()
{
redisReply *reply;

View File

@ -11,6 +11,8 @@ public:
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;