]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/content_sao.h
Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2...
[dragonfireclient.git] / src / content_sao.h
index f0788cbd52f6375c933d33123b22fb8a99763d66..6efb9e3ec84d422518b8ed4d7e40802acd3fa753 100644 (file)
@@ -3,16 +3,16 @@ Minetest-c55
 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+GNU Lesser General Public License for more details.
 
-You should have received a copy of the GNU General Public License along
+You should have received a copy of the GNU Lesser General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
@@ -61,6 +61,8 @@ class LuaEntitySAO : public ServerActiveObject
        void setHP(s16 hp);
        s16 getHP() const;
        void setArmorGroups(const ItemGroupList &armor_groups);
+       ObjectProperties* accessObjectProperties();
+       void notifyObjectPropertiesModified();
        /* LuaEntitySAO-specific */
        void setVelocity(v3f velocity);
        v3f getVelocity();
@@ -103,7 +105,8 @@ class LuaEntitySAO : public ServerActiveObject
 class PlayerSAO : public ServerActiveObject
 {
 public:
-       PlayerSAO(ServerEnvironment *env_, Player *player_, u16 peer_id_);
+       PlayerSAO(ServerEnvironment *env_, Player *player_, u16 peer_id_,
+                       const std::set<std::string> &privs, bool is_singleplayer);
        ~PlayerSAO();
        u8 getType() const
        { return ACTIVEOBJECT_TYPE_PLAYER; }
@@ -137,7 +140,10 @@ class PlayerSAO : public ServerActiveObject
        void rightClick(ServerActiveObject *clicker);
        s16 getHP() const;
        void setHP(s16 hp);
+       
        void setArmorGroups(const ItemGroupList &armor_groups);
+       ObjectProperties* accessObjectProperties();
+       void notifyObjectPropertiesModified();
 
        /*
                Inventory interface
@@ -177,6 +183,12 @@ class PlayerSAO : public ServerActiveObject
                m_time_from_last_punch = 0.0;
                return r;
        }
+       void updatePrivileges(const std::set<std::string> &privs,
+                       bool is_singleplayer)
+       {
+               m_privs = privs;
+               m_is_singleplayer = is_singleplayer;
+       }
 
 private:
        std::string getPropertyPacket();
@@ -193,6 +205,9 @@ class PlayerSAO : public ServerActiveObject
        bool m_armor_groups_sent;
        bool m_properties_sent;
        struct ObjectProperties m_prop;
+       // Cached privileges for enforcement
+       std::set<std::string> m_privs;
+       bool m_is_singleplayer;
 
 public:
        // Some flags used by Server