Page 1 of 1

How to revoke a priv from a large # of players at a time?

PostPosted: Wed Jan 25, 2017 11:27
by 24/7minetester
This may or may not belong here, but it's the best section I could find.

Ok. I have a server and it's ran by 2 people, me and someone else. Apparently when I installed the areas mod, it edited the server config file and added it's areas admin priv to the initial privs section of said file. Now I have to remove said priv from all non-admin players, and fast. Is there any way I could do so?

Thanks.

Re: How to revoke a priv from a large # of players at a time

PostPosted: Wed Jan 25, 2017 19:24
by juli
You could make a function on_join_player or so, that all players which join the game change their privs.
For example like this
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_on_joinplayer(function(player)
   local privs = minetest.get_player_privs(playername)
        privs.areas = false ---or what ever u want to disable ...
        minetest.set_player_privs(playername, privs)
end)

Re: How to revoke a priv from a large # of players at a time

PostPosted: Fri Jan 27, 2017 12:52
by 24/7minetester
Where would I save this? How would I implement this?

Thanks

Re: How to revoke a priv from a large # of players at a time

PostPosted: Fri Jan 27, 2017 13:39
by ExeterDad
24/7minetester wrote:Where would I save this? How would I implement this?

Thanks

Add that to any mod in the init.lua file.
Or make your own in your mods directory.

- Make a folder named rmpriv.
- in that folder make a new file "init.lua"
- Paste the code in it, and save.
- enable mod, and restart server.
- test by checking privs of joined players.

@juli Nice solution btw

Re: How to revoke a priv from a large # of players at a time

PostPosted: Sun Jan 29, 2017 20:14
by Miner_48er
Open auth.txt in a text editor and use replace all with areas, as your search term.