minetest-mods / skinsdb

Player skin mod, supporting unified_inventory, sfinv and smart_inventory
27 stars 41 forks source link

Use Mod_storage #17

Closed Lejo1 closed 6 years ago

Lejo1 commented 6 years ago

This is for player_backend = dummy

SmallJoker commented 6 years ago

This needs backwards compat so the player attribute is used when it's present.

bell07 commented 6 years ago

I like the change. This way it is possible to change skin of offline players. But does an "official statement" exist the mod storage should be preferred above the player backend in mods? Is player backend storage obsolete?

SmallJoker commented 6 years ago

Both can be used for the same effect as long it's player-specific. Mod MetaData can also used for world-specific settings,or lists of players (just to name some), whereas player attributes/MetaData is limited to players.

bell07 commented 6 years ago

Both can be used for the same effect as long it's player-specific.

That is why I ask why the player meta storage should be replaced by mod meta storage? Is player meta Storage obsolete?

SmallJoker commented 6 years ago

I didn't mention anything about that it's obsolete, because it isn't. Otherwise the Lua API would state that and offer an alternative method to save the data. Player metadata might be faster when it comes to a large data amount because the mod storage is serialized and written to a plaintext file, whereas it's only serialized and put into the player database for the player metadata.

bell07 commented 6 years ago

Understand. If both backends are not obsolete so the server admin should decide which backend should be used. @Lejo1, can you pls. add a parameter (anything like) "skinsdb_storage" with values "player" or "mod", so the server admin can select the storage backend? By default the playermeta should be used, but if "player_backend = dummy" is set, the "mod" could be activated.

EDIT: Or exits a reason to use the mod-meta backend only in skinsdb?