From 3aecefc73a9eb4e3db02fa9b0dca64f0765dfe01 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Sun, 11 Jun 2023 03:12:28 -0400 Subject: [PATCH] auth_rx - fix crash when load locally and host server from gui, fix nil permissions * backported https://git.minetest.io/minenux/minetest-mod-auth_rx/commit/b79404f7fa1eeb63e408c4164f6652353e8ff699 * backported https://codeberg.org/minenux/minetest-mod-auth_rx/commit/b79404f7fa1eeb63e408c4164f6652353e8ff699 --- mods/auth_rx/helpers.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/auth_rx/helpers.lua b/mods/auth_rx/helpers.lua index 226b20b..7598837 100644 --- a/mods/auth_rx/helpers.lua +++ b/mods/auth_rx/helpers.lua @@ -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