add unblocking all

master
Tai Kedzierski 2018-02-22 22:26:52 +00:00
parent f1b66f5ab8
commit ef7725f0de
3 changed files with 19 additions and 0 deletions

View File

@ -26,6 +26,8 @@ Whether to kick newly created players
## Commands
Comands require the `nonew` privilege.
* `nn_state [ on | off]`
Without arguments, displays the general state of NoNew ; else sets its state
@ -38,3 +40,7 @@ Adds a player to the block list and kick them if `nonew.state` is on
Removes a player form the block list ; only effective if the player had already previously joined.
* `nn_unblockall`
Unblock all players - do this after you have banned the accounts you needed to.

View File

@ -10,6 +10,14 @@ local function tokenize(argstring)
return args
end
minetest.register_chatcommand("nn_unblockall", {
description = "Unblock all players",
privs = {nonew = true},
func = function(caller, argstring)
nonew:unblock_all()
end,
})
minetest.register_chatcommand("nn_unblock", {
description = "Unblock players",
privs = {nonew = true},

View File

@ -21,6 +21,11 @@ function nonew:action(playername)
end
end
function nonew:unblock_all()
nonew.players = {}
write_blocked_players()
end
local function write_blocked_players()
local sdata = minetest.serialize(nonew.players)