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

Allow restricting detached inventories to one player

This combats the problem of sending the hundreds of
"creative" / "armor" or whatever detached invs that
exist on popular servers to each and every player
on join or on change of said invs.
This commit is contained in:
sfan5 2016-11-26 17:35:25 +01:00
parent 2fe3bf5a18
commit c38985825f
5 changed files with 25 additions and 13 deletions

View file

@ -270,7 +270,7 @@ public:
void deleteParticleSpawner(const std::string &playername, u32 id);
// Creates or resets inventory
Inventory* createDetachedInventory(const std::string &name);
Inventory* createDetachedInventory(const std::string &name, const std::string &player="");
// Envlock and conlock should be locked when using scriptapi
GameScripting *getScriptIface(){ return m_script; }
@ -647,6 +647,8 @@ private:
*/
// key = name
std::map<std::string, Inventory*> m_detached_inventories;
// value = "" (visible to all players) or player name
std::map<std::string, std::string> m_detached_inventories_player;
DISABLE_CLASS_COPY(Server);
};