mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix and improve Server's privilege get/setters
This commit is contained in:
parent
6298878bfa
commit
5957fed9a7
3 changed files with 40 additions and 37 deletions
27
src/server.h
27
src/server.h
|
@ -465,32 +465,13 @@ public:
|
|||
m_shutdown_requested = true;
|
||||
}
|
||||
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
// Thread-safe
|
||||
u64 getPlayerAuthPrivs(const std::string &name);
|
||||
void setPlayerAuthPrivs(const std::string &name, u64 privs);
|
||||
u64 getPlayerEffectivePrivs(const std::string &name);
|
||||
|
||||
// Changes a player's password, password must be given as plaintext
|
||||
// If the player doesn't exist, a new entry is added to the auth manager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue