Герхард PICCORO Lenz McKAY
cfb83aab12
* using https://codeberg.org/minenux/minetest-mod-formspecs * using https://codeberg.org/minenux/minetest-mod-auth_rx * changes: ** provide a way to initialize files if there is not one currently doe snot touch the auth.txt file neither converted ** solves: close: https://codeberg.org/minenux/minetest-mod-auth_rx/issues/6 ** solved: close: https://bitbucket.org/sorcerykid/auth_rx/issues/7 ** init the files when are fresh install, still do not convert from auth.txt ** player object check for problematic joins on inpcomplete auth process ** close fixed https://codeberg.org/minenux/minetest-mod-auth_rx/issues/2 ** added missing depends formspecs (it work without in basics but, some commands needs) ** we will later aded formspecs checks to made optional
185 lines
4.2 KiB
Mathematica
185 lines
4.2 KiB
Mathematica
#####################################################################
|
|
#
|
|
# only allow administrator access (by username or IP address)
|
|
#
|
|
#####################################################################
|
|
|
|
pass any
|
|
if $addr eq 172.16.100.1
|
|
if $addr eq 172.16.100.2
|
|
if $name eq "admin"
|
|
continue
|
|
|
|
fail now
|
|
|
|
#####################################################################
|
|
#
|
|
# block access from a range of IP addresses
|
|
#
|
|
#####################################################################
|
|
|
|
try "This subnet is blocked by the administrator."
|
|
|
|
fail any
|
|
if $addr is /192.88.99.6</a
|
|
if $addr is /203.0.113.?/a
|
|
if $addr is /192.168.12^14.?/a
|
|
continue
|
|
|
|
pass now
|
|
|
|
#####################################################################
|
|
#
|
|
# only allow access from whitelisted players
|
|
#
|
|
#####################################################################
|
|
|
|
try "The account '$name' is not permitted to join this server."
|
|
|
|
when $name in @whitelist.txt pass
|
|
|
|
fall now
|
|
|
|
#####################################################################
|
|
#
|
|
# never allow access from blacklisted players
|
|
#
|
|
#####################################################################
|
|
|
|
try "The account '$name' is not permitted to join this server."
|
|
|
|
when $name in @blacklist.txt fail
|
|
|
|
pass now
|
|
|
|
#####################################################################
|
|
#
|
|
# notify players that the server is unavailable right now
|
|
#
|
|
#####################################################################
|
|
|
|
try "The server is temporarily offline for maintenance."
|
|
|
|
fail now
|
|
|
|
#####################################################################
|
|
#
|
|
# disallow players with all uppercase names
|
|
#
|
|
#####################################################################
|
|
|
|
try "Sorry, we do not accept all uppercase player names."
|
|
|
|
when $name eq uc($name) fail
|
|
|
|
pass now
|
|
|
|
#####################################################################
|
|
#
|
|
# disallow players with very short or very long names
|
|
#
|
|
#####################################################################
|
|
|
|
try "Sorry, this player name is too long or too short."
|
|
|
|
fail any
|
|
if $name->len() gt 20
|
|
if $name->len() lt 3
|
|
continue
|
|
|
|
pass now
|
|
|
|
#####################################################################
|
|
#
|
|
# disallow users that appear to be bots or guests
|
|
#
|
|
#####################################################################
|
|
|
|
try "Sorry, we do not accept autogenerated player names."
|
|
|
|
fail any
|
|
if $name is /;*;*##/
|
|
if $name is /;*;*###/
|
|
if $name is /Player#/
|
|
if $name is /Player##/
|
|
if $name is /Guest#/
|
|
if $name is /Guest##/
|
|
continue
|
|
|
|
pass now
|
|
|
|
#####################################################################
|
|
#
|
|
# disallow new players when the server is near capacity
|
|
#
|
|
#####################################################################
|
|
|
|
try "There are too many players online right now."
|
|
|
|
fail all
|
|
if $is_new eq $true
|
|
if $cur_users gte $max_users->mul(0.8)
|
|
continue
|
|
|
|
pass now
|
|
|
|
#####################################################################
|
|
#
|
|
# prevent players from joining with a reserved name
|
|
#
|
|
#####################################################################
|
|
|
|
try "Sorry, this acccount has been permanently restricted."
|
|
|
|
fail all
|
|
if $is_new eq $true
|
|
if ("moderator","server","client","owner","player","system","operator","minetest") has $name
|
|
continue
|
|
|
|
pass now
|
|
|
|
#####################################################################
|
|
#
|
|
# disallow players that have been inactive for 90 days
|
|
#
|
|
#####################################################################
|
|
|
|
try "Sorry, this acccount has been disabled for inactivity."
|
|
|
|
fail all
|
|
if $is_new eq $false
|
|
if age($newlogin) gt 90d
|
|
continue
|
|
|
|
pass now
|
|
|
|
#####################################################################
|
|
#
|
|
# disallow new players during the weekends
|
|
#
|
|
#####################################################################
|
|
|
|
try "Sorry, we are not accepting new players at this time."
|
|
|
|
fail now
|
|
if $is_new eq $true
|
|
if $clock->day() in ("Sat","Sun")
|
|
continue
|
|
|
|
pass now
|
|
|
|
#####################################################################
|
|
#
|
|
# prevent players from spam-logging the server
|
|
#
|
|
#####################################################################
|
|
|
|
try "You are doing that too much. Please wait awhile."
|
|
|
|
fail all
|
|
if $is_new eq $false
|
|
if age($newlogin) lt 15s
|
|
continue
|
|
|
|
pass now
|