1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Add LevelDB auth database. (#9476)

* Add leveldb auth database.
This commit is contained in:
luk3yx 2020-04-23 23:07:19 +12:00 committed by GitHub
parent ce5b0932f8
commit 914dbeaa0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 122 additions and 1 deletions

View file

@ -45,4 +45,21 @@ private:
leveldb::DB *m_database;
};
class AuthDatabaseLevelDB : public AuthDatabase
{
public:
AuthDatabaseLevelDB(const std::string &savedir);
virtual ~AuthDatabaseLevelDB();
virtual bool getAuth(const std::string &name, AuthEntry &res);
virtual bool saveAuth(const AuthEntry &authEntry);
virtual bool createAuth(AuthEntry &authEntry);
virtual bool deleteAuth(const std::string &name);
virtual void listNames(std::vector<std::string> &res);
virtual void reload();
private:
leveldb::DB *m_database;
};
#endif // USE_LEVELDB