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.
*/
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();
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; }
void rightClick(ServerActiveObject *clicker);
s16 getHP() const;
void setHP(s16 hp);
+
void setArmorGroups(const ItemGroupList &armor_groups);
+ ObjectProperties* accessObjectProperties();
+ void notifyObjectPropertiesModified();
/*
Inventory interface
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();
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