auth_rx - backported fix get key configuration helper access

* seems something related to syntactic sugar seems
  do not works anymore.. as i asked repect some commits
  at https://notabug.org/TenPlus1/nssm/issues/19
* reduce default privilegies if do not retrieve from config to minimal
  cos thi is subnasa
* backported 2aef6adf19
* backported 2aef6adf19
master
mckaygerhard 2023-06-15 23:57:23 -04:00
parent 497e34f102
commit ef47f6c97a
1 changed files with 7 additions and 7 deletions

View File

@ -10,16 +10,16 @@
-----------------------------------------------------
local is_46 = minetest.has_feature("add_entity_with_staticdata")
if is_46 then
get_minetest_config = function( key )
minetest.settings:get( key )
function get_minetest_config( key )
if is_46 then
return minetest.settings:get( key )
else
return core.setting_get( key ) -- backwards compatibility
end
else
get_minetest_config = core.setting_get -- backwards compatibility
end
function convert_ipv4( str )
if not str then str = "127.0.0.1" end
if not str then str = "127.0.0.1" end -- started in local game or load the mod incorrectly
local ref = string.split( str, ".", false )
return tonumber( ref[ 1 ] ) * 16777216 + tonumber( ref[ 2 ] ) * 65536 + tonumber( ref[ 3 ] ) * 256 + tonumber( ref[ 4 ] )
end
@ -30,7 +30,7 @@ end
function get_default_privs( )
local default_privs = { }
local config_privs = get_minetest_config( "default_privs" ) or "interact, shout, fast, home"
local config_privs = get_minetest_config( "default_privs" ) or "interact, shout"
for _, p in pairs( string.split( config_privs, "," ) ) do
table.insert( default_privs, string.trim( p ) )
end