1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

hopefully fixed the privilege problems

--HG--
extra : rebase_source : 9826d20176134a53ff232816a10407465d8c0f50
This commit is contained in:
Perttu Ahola
2011-05-29 22:34:04 +03:00
parent e8b8ed0280
commit e81919c818
6 changed files with 72 additions and 22 deletions

View File

@@ -424,7 +424,29 @@ public:
// Envlock and conlock should be locked when calling this
void SendMovePlayer(Player *player);
u64 getPlayerAuthPrivs(const std::string &name)
{
try{
return m_authmanager.getPrivs(name);
}
catch(AuthNotFoundException &e)
{
dstream<<"WARNING: Auth not found for "<<name<<std::endl;
return 0;
}
}
void setPlayerAuthPrivs(const std::string &name, u64 privs)
{
try{
return m_authmanager.setPrivs(name, privs);
}
catch(AuthNotFoundException &e)
{
dstream<<"WARNING: Auth not found for "<<name<<std::endl;
}
}
private:
@@ -493,6 +515,8 @@ private:
void handlePeerChange(PeerChange &c);
void handlePeerChanges();
u64 getPlayerPrivs(Player *player);
/*
Variables
*/