improve the auth handler on fails for recent versions of mineshit
* i dont use troltest 5.6 version so i try to provide compatibility layer in some way this means that for older engines we dont have in 0.4.X or 5.1.X way to know what was the fail player, 5.2+ has such feature.
This commit is contained in:
parent
e1ddc0ffaf
commit
896a64e835
26
init.lua
26
init.lua
@ -23,12 +23,28 @@ AuthInitFile( world_path, "auth.db" )
|
||||
local auth_filter = AuthFilter( world_path, "greenlist.mt" )
|
||||
local auth_db = AuthDatabase( world_path, "auth.db" )
|
||||
local auth_watchdog = AuthWatchdog( )
|
||||
local is_50 = minetest.has_feature("object_use_texture_alpha")
|
||||
local is_54 = minetest.has_feature("object_use_texture_alpha")
|
||||
|
||||
if 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 ) )
|
||||
end )
|
||||
if is_50 then
|
||||
if 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 ) )
|
||||
end )
|
||||
end
|
||||
end
|
||||
|
||||
if is_54 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 )
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_prejoinplayer( function ( player_name, player_ip )
|
||||
|
Loading…
x
Reference in New Issue
Block a user