2019-02-22 05:15:44 +01:00
|
|
|
--
|
|
|
|
-- Minetest lurkcoin mod
|
|
|
|
--
|
|
|
|
-- © 2019 by luk3yx
|
|
|
|
--
|
|
|
|
|
|
|
|
lurkcoin = {}
|
|
|
|
|
|
|
|
local modpath = minetest.get_modpath('lurkcoin')
|
|
|
|
|
|
|
|
-- Load bank.lua
|
|
|
|
dofile(modpath .. '/bank.lua')
|
|
|
|
|
|
|
|
-- Load the minibank submod thing if required
|
|
|
|
if not lurkcoin.bank then
|
|
|
|
dofile(modpath .. '/minibank.lua')
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Request the HTTP(S) API and load core.lua.
|
|
|
|
local http = minetest.request_http_api()
|
|
|
|
assert(loadfile(modpath .. '/core.lua'))(http)
|
|
|
|
|
|
|
|
-- Load the ATM core code
|
|
|
|
dofile(modpath .. '/atm-core.lua')
|
|
|
|
|
|
|
|
-- Load the ATM blocks
|
|
|
|
dofile(modpath .. '/atm-nodes.lua')
|
|
|
|
|
2019-06-10 11:43:17 +02:00
|
|
|
-- Backport https://github.com/minetest/minetest/pull/8420 if required
|
2019-03-05 03:09:35 +01:00
|
|
|
if not minetest.get_modpath('cloaking') or not cloaking.hide_player then
|
2019-03-02 02:25:23 +01:00
|
|
|
table.insert(minetest.registered_on_chat_messages, 1, function(name, msg)
|
|
|
|
if msg:find('[\r\n]') then
|
|
|
|
minetest.chat_send_player(name,
|
|
|
|
'Error sending message: https://xkcd.com/327')
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
|
|
|
|
local log = minetest.log
|
|
|
|
function minetest.log(level, text)
|
|
|
|
level = level:gsub('[\r\n]', ' ')
|
|
|
|
if text then
|
|
|
|
text = text:gsub('[\r\n]', ' ')
|
|
|
|
else
|
|
|
|
text = level
|
|
|
|
level = 'none'
|
|
|
|
end
|
|
|
|
return log(level, text)
|
2019-03-02 01:44:00 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-02-22 05:15:44 +01:00
|
|
|
-- Display loaded message
|
|
|
|
minetest.log('action', '[lurkcoin] Loaded on server "' ..
|
|
|
|
lurkcoin.server_name .. '".')
|