mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-11-25 17:03:47 +01:00
DBRedis: add replyTypeStr
Maps Redis response constants to strings
This commit is contained in:
parent
26b62933ed
commit
53706e811b
20
db-redis.cpp
20
db-redis.cpp
@ -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()
|
void DBRedis::loadPosCache()
|
||||||
{
|
{
|
||||||
redisReply *reply;
|
redisReply *reply;
|
||||||
|
@ -11,6 +11,8 @@ public:
|
|||||||
virtual void getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos);
|
virtual void getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos);
|
||||||
virtual ~DBRedis();
|
virtual ~DBRedis();
|
||||||
private:
|
private:
|
||||||
|
static std::string replyTypeStr(int type);
|
||||||
|
|
||||||
void loadPosCache();
|
void loadPosCache();
|
||||||
|
|
||||||
std::vector<BlockPos> posCache;
|
std::vector<BlockPos> posCache;
|
||||||
|
Loading…
Reference in New Issue
Block a user