forked from mff/mysql_base
Improve a bit the code...
..., remove one deprecated function, use mod.conf for name and description.
This commit is contained in:
7
init.lua
7
init.lua
@ -11,12 +11,14 @@ function thismod.mklog(level, modname)
|
||||
minetest.log(level, "[" .. modname .. "] " .. str)
|
||||
end
|
||||
end
|
||||
|
||||
local LogI = thismod.mklog('action', modname)
|
||||
local LogE = thismod.mklog('error', modname)
|
||||
|
||||
local singleplayer = minetest.is_singleplayer() -- Caching is OK since you can't open a game to
|
||||
-- multiplayer unless you restart it.
|
||||
if minetest.setting_get(modname .. '.enable_singleplayer') ~= 'true' and singleplayer then
|
||||
|
||||
if minetest.settings:get(modname .. '.enable_singleplayer') ~= 'true' and singleplayer then
|
||||
LogI("Not enabling because of singleplayer game")
|
||||
return
|
||||
end
|
||||
@ -202,6 +204,7 @@ local function ping()
|
||||
end
|
||||
minetest.after(1800, ping)
|
||||
end
|
||||
|
||||
minetest.after(10, ping)
|
||||
|
||||
local shutdown_callbacks = {}
|
||||
@ -229,4 +232,4 @@ function thismod.table_exists(name)
|
||||
return exists
|
||||
end
|
||||
|
||||
dofile(modpath .. '/abstraction.lua')
|
||||
dofile(modpath .. '/abstraction.lua')
|
Reference in New Issue
Block a user