diff --git a/description.txt b/description.txt deleted file mode 100644 index 322cec3..0000000 --- a/description.txt +++ /dev/null @@ -1,3 +0,0 @@ -Auth Redux is a drop-in replacement for the builtin authentication handler of Minetest. It is designed from the ground up to be robust and secure enough for use on high-traffic Minetest servers, while also addressing a number of outstanding engine bugs. - -For more information: https://forum.minetest.net/viewtopic.php?f=9&t=20393 diff --git a/helpers.lua b/helpers.lua index 46fdc7b..0032d03 100644 --- a/helpers.lua +++ b/helpers.lua @@ -9,7 +9,9 @@ -- Global Helper Functions ----------------------------------------------------- -get_minetest_config = core.setting_get -- backwards compatibility +get_minetest_config = function( key ) + minetest.settings:get( key ) +end function convert_ipv4( str ) local ref = string.split( str, ".", false ) diff --git a/init.lua b/init.lua index aecfbd2..c6163f7 100644 --- a/init.lua +++ b/init.lua @@ -22,7 +22,15 @@ local auth_filter = AuthFilter( world_path, "greenlist.mt" ) local auth_db = AuthDatabase( world_path, "auth.db" ) local auth_watchdog = AuthWatchdog( ) -if minetest.register_on_auth_fail then +if minetest.register_on_authplayer then + minetest.register_on_authplayer( function ( player_name, player_ip, is_success ) + if is_success then + return + end + auth_db.on_login_failure( player_name, player_ip ) + auth_watchdog.on_failure( convert_ipv4( player_ip ) ) + end ) +elseif minetest.register_on_auth_fail then minetest.register_on_auth_fail( function ( player_name, player_ip ) auth_db.on_login_failure( player_name, player_ip ) auth_watchdog.on_failure( convert_ipv4( player_ip ) ) diff --git a/mod.conf b/mod.conf index df6b094..57cb578 100644 --- a/mod.conf +++ b/mod.conf @@ -2,3 +2,4 @@ name = auth_rx title = Auth Redux author = sorcerykid license = MIT +description = Auth Redux is a drop-in replacement for the builtin authentication handler of Minetest. It is designed from the ground up to be robust and secure enough for use on high-traffic Minetest servers, while also addressing a number of outstanding engine bugs. For more information: https://forum.minetest.net/viewtopic.php?f=9&t=20393