From 52122c342d335a2561ace87c9d8deaa16a136604 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 31 Mar 2012 16:23:26 +0300 Subject: Add 'fly' and 'fast' privileges and the underlying privileges-to-client system --- src/client.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/client.h') diff --git a/src/client.h b/src/client.h index 302dd8005..72ab70abd 100644 --- a/src/client.h +++ b/src/client.h @@ -20,8 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef CLIENT_HEADER #define CLIENT_HEADER -#ifndef SERVER - #include "connection.h" #include "environment.h" #include "common_irrlicht.h" @@ -35,6 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "inventorymanager.h" #include "filesys.h" #include "filecache.h" +#include "localplayer.h" struct MeshMakeData; class MapBlockMesh; @@ -262,14 +261,8 @@ public: u16 getHP(); - float getAvgRtt() - { - try{ - return m_con.GetPeerAvgRTT(PEER_ID_SERVER); - } catch(con::PeerNotFoundException){ - return 1337; - } - } + bool checkPrivilege(const std::string &priv) + { return (m_privileges.count(priv) != 0); } bool getChatMessage(std::wstring &message); void typeChatMessage(const std::wstring& message); @@ -312,6 +305,8 @@ public: virtual u16 allocateUnknownNodeId(const std::string &name); virtual ISoundManager* getSoundManager(); virtual MtEventManager* getEventManager(); + virtual bool checkLocalPrivilege(const std::string &priv) + { return checkPrivilege(priv); } private: @@ -392,9 +387,10 @@ private: std::map m_sounds_client_to_server; // And relations to objects std::map m_sounds_to_objects; -}; -#endif // !SERVER + // Privileges + std::set m_privileges; +}; #endif // !CLIENT_HEADER -- cgit v1.2.3