mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Use a database for mod storage (#11763)
This commit is contained in:
parent
b81948a14c
commit
bf22569019
21 changed files with 798 additions and 127 deletions
|
@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "database.h"
|
||||
#include "irrlichttypes.h"
|
||||
|
||||
class Database_Dummy : public MapDatabase, public PlayerDatabase
|
||||
class Database_Dummy : public MapDatabase, public PlayerDatabase, public ModMetadataDatabase
|
||||
{
|
||||
public:
|
||||
bool saveBlock(const v3s16 &pos, const std::string &data);
|
||||
|
@ -37,10 +37,17 @@ public:
|
|||
bool removePlayer(const std::string &name);
|
||||
void listPlayers(std::vector<std::string> &res);
|
||||
|
||||
bool getModEntries(const std::string &modname, StringMap *storage);
|
||||
bool setModEntry(const std::string &modname,
|
||||
const std::string &key, const std::string &value);
|
||||
bool removeModEntry(const std::string &modname, const std::string &key);
|
||||
void listMods(std::vector<std::string> *res);
|
||||
|
||||
void beginSave() {}
|
||||
void endSave() {}
|
||||
|
||||
private:
|
||||
std::map<s64, std::string> m_database;
|
||||
std::set<std::string> m_player_database;
|
||||
std::unordered_map<std::string, StringMap> m_mod_meta_database;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue