Browse Source

Add cloaking integration™

master
luk3yx 5 months ago
parent
commit
04d44f21e8
3 changed files with 22 additions and 18 deletions
  1. 1
    0
      depends.txt
  2. 20
    17
      init.lua
  3. 1
    1
      mod.conf

+ 1
- 0
depends.txt View File

@@ -1,5 +1,6 @@
atm?
bank_accounts?
cloaking?
currency?
default?
economy?

+ 20
- 17
init.lua View File

@@ -26,25 +26,27 @@ dofile(modpath .. '/atm-core.lua')
-- Load the ATM blocks
dofile(modpath .. '/atm-nodes.lua')

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
-- Tweak minetest.log for extra security, unless cloaking already has.
if not minetest.get_modpath('cloaking') or not cloaking.version then
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)
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)
end

-- Display loaded message

+ 1
- 1
mod.conf View File

@@ -1,2 +1,2 @@
name = lurkcoin
optional_depends = atm,bank_accounts,currency,default,economy,money,money2
optional_depends = atm,bank_accounts,cloaking,currency,default,economy,money,money2

Loading…
Cancel
Save