auth_rx - fix crash when load locally and host server from gui, fix nil permissions

* backported b79404f7fa
* backported b79404f7fa
This commit is contained in:
mckaygerhard 2023-06-11 03:15:31 -04:00
parent a3ce2df387
commit 7b4df32b60

View File

@ -19,6 +19,7 @@ else
end
function convert_ipv4( str )
if not str then str = "127.0.0.1" end
local ref = string.split( str, ".", false )
return tonumber( ref[ 1 ] ) * 16777216 + tonumber( ref[ 2 ] ) * 65536 + tonumber( ref[ 3 ] ) * 256 + tonumber( ref[ 4 ] )
end
@ -29,7 +30,8 @@ end
function get_default_privs( )
local default_privs = { }
for _, p in pairs( string.split( get_minetest_config( "default_privs" ), "," ) ) do
local config_privs = get_minetest_config( "default_privs" ) or "interact, shout, fast, home"
for _, p in pairs( string.split( config_privs, "," ) ) do
table.insert( default_privs, string.trim( p ) )
end
return default_privs