1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Clean up database API and save the local map on an interval

This commit is contained in:
ShadowNinja 2014-11-16 15:31:57 -05:00
parent c7454d4732
commit 708337dfc2
16 changed files with 391 additions and 519 deletions

View file

@ -28,24 +28,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <hiredis.h>
#include <string>
class ServerMap;
class Settings;
class Database_Redis : public Database
{
public:
Database_Redis(ServerMap *map, std::string savedir);
Database_Redis(Settings &conf);
~Database_Redis();
virtual void beginSave();
virtual void endSave();
virtual bool saveBlock(v3s16 blockpos, std::string &data);
virtual std::string loadBlock(v3s16 blockpos);
virtual bool deleteBlock(v3s16 blockpos);
virtual bool saveBlock(const v3s16 &pos, const std::string &data);
virtual std::string loadBlock(const v3s16 &pos);
virtual bool deleteBlock(const v3s16 &pos);
virtual void listAllLoadableBlocks(std::vector<v3s16> &dst);
virtual int Initialized(void);
~Database_Redis();
private:
ServerMap *srvmap;
redisContext *ctx;
std::string hash;
};
#endif // USE_REDIS
#endif
#endif