summaryrefslogtreecommitdiff
path: root/src/client.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-31 16:23:26 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-03-31 16:25:02 +0300
commit52122c342d335a2561ace87c9d8deaa16a136604 (patch)
tree33ed625674d82c505b347adf26307748c85c8cfc /src/client.h
parent96ee73f79018c8aae22a392af6f66f9a05cb0174 (diff)
downloadminetest-52122c342d335a2561ace87c9d8deaa16a136604.tar.gz
minetest-52122c342d335a2561ace87c9d8deaa16a136604.tar.bz2
minetest-52122c342d335a2561ace87c9d8deaa16a136604.zip
Add 'fly' and 'fast' privileges and the underlying privileges-to-client system
Diffstat (limited to 'src/client.h')
-rw-r--r--src/client.h20
1 files changed, 8 insertions, 12 deletions
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<int, s32> m_sounds_client_to_server;
// And relations to objects
std::map<int, u16> m_sounds_to_objects;
-};
-#endif // !SERVER
+ // Privileges
+ std::set<std::string> m_privileges;
+};
#endif // !CLIENT_HEADER