2018-01-02 23:51:38 +00:00
|
|
|
minetest.register_can_bypass_userlimit(function(name, ip)
|
|
|
|
local pstat, discard = ctf_stats.player_or_nil(name)
|
|
|
|
local actual_max_users = tonumber(minetest.settings:get("max_users")) +
|
|
|
|
tonumber(minetest.settings:get("max_extra_users") or "10")
|
|
|
|
local req_score = tonumber(minetest.settings:get("userlimit_bypass_required_score") or "10000")
|
2018-01-03 01:44:24 +00:00
|
|
|
local can_connect = pstat and pstat.score > req_score and #minetest.get_connected_players() < actual_max_users
|
2018-01-03 03:02:40 +00:00
|
|
|
if can_connect then
|
|
|
|
return true
|
|
|
|
end
|
2018-01-02 23:51:38 +00:00
|
|
|
end)
|