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 * backported2aef6adf19
* backported2aef6adf19
This commit is contained in:
parent
497e34f102
commit
ef47f6c97a
@ -10,16 +10,16 @@
|
|||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
local is_46 = minetest.has_feature("add_entity_with_staticdata")
|
local is_46 = minetest.has_feature("add_entity_with_staticdata")
|
||||||
|
|
||||||
if is_46 then
|
function get_minetest_config( key )
|
||||||
get_minetest_config = function( key )
|
if is_46 then
|
||||||
minetest.settings:get( key )
|
return minetest.settings:get( key )
|
||||||
|
else
|
||||||
|
return core.setting_get( key ) -- backwards compatibility
|
||||||
end
|
end
|
||||||
else
|
|
||||||
get_minetest_config = core.setting_get -- backwards compatibility
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function convert_ipv4( str )
|
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 )
|
local ref = string.split( str, ".", false )
|
||||||
return tonumber( ref[ 1 ] ) * 16777216 + tonumber( ref[ 2 ] ) * 65536 + tonumber( ref[ 3 ] ) * 256 + tonumber( ref[ 4 ] )
|
return tonumber( ref[ 1 ] ) * 16777216 + tonumber( ref[ 2 ] ) * 65536 + tonumber( ref[ 3 ] ) * 256 + tonumber( ref[ 4 ] )
|
||||||
end
|
end
|
||||||
@ -30,7 +30,7 @@ end
|
|||||||
|
|
||||||
function get_default_privs( )
|
function get_default_privs( )
|
||||||
local 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
|
for _, p in pairs( string.split( config_privs, "," ) ) do
|
||||||
table.insert( default_privs, string.trim( p ) )
|
table.insert( default_privs, string.trim( p ) )
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user