mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Add server-side enforcement of the 'fast' privilege; also fix client checking 'fly' instead of 'fast'
This commit is contained in:
parent
0fbef74f31
commit
13159c1a48
4 changed files with 32 additions and 9 deletions
|
@ -4315,13 +4315,16 @@ void Server::reportPrivsModified(const std::string &name)
|
|||
i = m_clients.getIterator();
|
||||
i.atEnd() == false; i++){
|
||||
RemoteClient *client = i.getNode()->getValue();
|
||||
SendPlayerPrivileges(client->peer_id);
|
||||
Player *player = m_env->getPlayer(client->peer_id);
|
||||
reportPrivsModified(player->getName());
|
||||
}
|
||||
} else {
|
||||
Player *player = m_env->getPlayer(name.c_str());
|
||||
if(!player)
|
||||
return;
|
||||
SendPlayerPrivileges(player->peer_id);
|
||||
player->getPlayerSAO()->updatePrivileges(
|
||||
getPlayerEffectivePrivs(name));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4520,7 +4523,8 @@ PlayerSAO* Server::emergePlayer(const char *name, u16 peer_id)
|
|||
/*
|
||||
Create a new player active object
|
||||
*/
|
||||
PlayerSAO *playersao = new PlayerSAO(m_env, player, peer_id);
|
||||
PlayerSAO *playersao = new PlayerSAO(m_env, player, peer_id,
|
||||
getPlayerEffectivePrivs(player->getName()));
|
||||
|
||||
/* Add object to environment */
|
||||
m_env->addActiveObject(playersao);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue