mirror of
https://github.com/SmallJoker/names_per_ip.git
synced 2025-01-06 23:50:18 +01:00
Not unlimited. Extend limit by 2 accounts more
This commit is contained in:
parent
04adaffa64
commit
214f1651f5
9
init.lua
9
init.lua
@ -11,6 +11,8 @@ ipnames.whitelist_file = minetest.get_worldpath().."/ipnames_whitelist.data"
|
|||||||
|
|
||||||
-- Limit 2 = maximal 2 accounts, the 3rd under the same IP gets blocked
|
-- Limit 2 = maximal 2 accounts, the 3rd under the same IP gets blocked
|
||||||
ipnames.name_per_ip_limit = tonumber(minetest.setting_get("max_names_per_ip")) or 2
|
ipnames.name_per_ip_limit = tonumber(minetest.setting_get("max_names_per_ip")) or 2
|
||||||
|
-- 2 + 2 = 4 accounts as limit for "ignored" players
|
||||||
|
ipnames.extended_limit = 2
|
||||||
|
|
||||||
-- Interval where the IP list gets saved/updated
|
-- Interval where the IP list gets saved/updated
|
||||||
ipnames.save_interval = 240
|
ipnames.save_interval = 240
|
||||||
@ -62,11 +64,12 @@ minetest.register_on_prejoinplayer(function(name, ip)
|
|||||||
|
|
||||||
local count = 1
|
local count = 1
|
||||||
local names = ""
|
local names = ""
|
||||||
|
local limit_ext = false
|
||||||
for k, v in pairs(ipnames.data) do
|
for k, v in pairs(ipnames.data) do
|
||||||
if v[1] == ip then
|
if v[1] == ip then
|
||||||
if ipnames.whitelist[k] then
|
if not limit_ext and ipnames.whitelist[k] then
|
||||||
count = 0
|
count = count - ipnames.extended_limit
|
||||||
break
|
limit_ext = true
|
||||||
end
|
end
|
||||||
count = count + 1
|
count = count + 1
|
||||||
names = names..k..", "
|
names = names..k..", "
|
||||||
|
Loading…
Reference in New Issue
Block a user