1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-25 05:35:25 +02:00

Add server-side enforcement of the 'fast' privilege; also fix client checking 'fly' instead of 'fast'

This commit is contained in:
Perttu Ahola
2012-03-31 17:08:39 +03:00
parent 0fbef74f31
commit 13159c1a48
4 changed files with 32 additions and 9 deletions

View File

@@ -105,7 +105,8 @@ private:
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);
~PlayerSAO();
u8 getType() const
{ return ACTIVEOBJECT_TYPE_PLAYER; }
@@ -182,6 +183,10 @@ public:
m_time_from_last_punch = 0.0;
return r;
}
void updatePrivileges(const std::set<std::string> &privs)
{
m_privs = privs;
}
private:
std::string getPropertyPacket();
@@ -198,6 +203,8 @@ private:
bool m_armor_groups_sent;
bool m_properties_sent;
struct ObjectProperties m_prop;
// Cached privileges for enforcement
std::set<std::string> m_privs;
public:
// Some flags used by Server