1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Add ModMetadata API (#5131)

* mod can create a ModMetadata object where store its values and retrieve it.
* Modmetadata object can only be fetched at mod loading
* Save when modified using same time as map interval or at server stop
* add helper function to get mod storage path
* ModMetadata has exactly same calls than all every other Metadata
This commit is contained in:
Loïc Blot 2017-02-08 00:15:55 +01:00 committed by GitHub
parent 0680c47d6c
commit ef6feca501
12 changed files with 384 additions and 12 deletions

View file

@ -174,7 +174,7 @@ void RemotePlayer::deSerialize(std::istream &is, const std::string &playername,
const Json::Value::Members attr_list = attr_root.getMemberNames();
for (Json::Value::Members::const_iterator it = attr_list.begin();
it != attr_list.end(); ++it) {
it != attr_list.end(); ++it) {
Json::Value attr_value = attr_root[*it];
sao->setExtendedAttribute(*it, attr_value.asString());
}