From c38985825f299999135cc01aaf0052ec9138135a Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 26 Nov 2016 17:35:25 +0100 Subject: 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. --- src/server.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/server.h') diff --git a/src/server.h b/src/server.h index 9e844e36c..cc2bcef25 100644 --- a/src/server.h +++ b/src/server.h @@ -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 m_detached_inventories; + // value = "" (visible to all players) or player name + std::map m_detached_inventories_player; DISABLE_CLASS_COPY(Server); }; -- cgit v1.2.3