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

24/7minetester
Member
 
Posts: 43
Joined: Fri Jun 05, 2015 22:36
IRC: riff or riff2 if riff is taken
In-game: riff

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

by 24/7minetester » Wed Jan 25, 2017 11:27

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.
 

User avatar
juli
Member
 
Posts: 109
Joined: Sat Jun 11, 2016 10:31
GitHub: cpdef
In-game: juli

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

by juli » Wed Jan 25, 2017 19:24

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)
Please tell me if i have written bad english.
Planets/Asteroids mod: https://forum.minetest.net/viewtopic.php?t=15933
servers where i'am:
mars-server
jungle-server
buildersworld
 

24/7minetester
Member
 
Posts: 43
Joined: Fri Jun 05, 2015 22:36
IRC: riff or riff2 if riff is taken
In-game: riff

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

by 24/7minetester » Fri Jan 27, 2017 12:52

Where would I save this? How would I implement this?

Thanks
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

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

by ExeterDad » Fri Jan 27, 2017 13:39

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
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

Miner_48er
Member
 
Posts: 15
Joined: Fri Oct 05, 2012 21:32

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

by Miner_48er » Sun Jan 29, 2017 20:14

Open auth.txt in a text editor and use replace all with areas, as your search term.
 


Return to Minetest Servers

Who is online

Users browsing this forum: No registered users and 16 guests

cron