summaryrefslogtreecommitdiff
path: root/src/client.cpp
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.cpp
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.cpp')
-rw-r--r--src/client.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 7f1b39c33..de3c63698 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1674,6 +1674,21 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
m_sound->stopSound(client_id);
}
}
+ else if(command == TOCLIENT_PRIVILEGES)
+ {
+ std::string datastring((char*)&data[2], datasize-2);
+ std::istringstream is(datastring, std::ios_base::binary);
+
+ m_privileges.clear();
+ infostream<<"Client: Privileges updated: ";
+ u16 num_privileges = readU16(is);
+ for(u16 i=0; i<num_privileges; i++){
+ std::string priv = deSerializeString(is);
+ m_privileges.insert(priv);
+ infostream<<priv<<" ";
+ }
+ infostream<<std::endl;
+ }
else
{
infostream<<"Client: Ignoring unknown command "