You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4KB

  1. --
  2. -- Minetest lurkcoin mod
  3. --
  4. -- © 2019 by luk3yx
  5. --
  6. lurkcoin = {}
  7. local modpath = minetest.get_modpath('lurkcoin')
  8. -- Load bank.lua
  9. dofile(modpath .. '/bank.lua')
  10. -- Load the minibank submod thing if required
  11. if not lurkcoin.bank then
  12. dofile(modpath .. '/minibank.lua')
  13. end
  14. -- Request the HTTP(S) API and load core.lua.
  15. local http = minetest.request_http_api()
  16. assert(loadfile(modpath .. '/core.lua'))(http)
  17. -- Load the ATM core code
  18. dofile(modpath .. '/atm-core.lua')
  19. -- Load the ATM blocks
  20. dofile(modpath .. '/atm-nodes.lua')
  21. -- Backport https://github.com/minetest/minetest/pull/8420 if required
  22. if not minetest.get_modpath('cloaking') or not cloaking.hide_player then
  23. table.insert(minetest.registered_on_chat_messages, 1, function(name, msg)
  24. if msg:find('[\r\n]') then
  25. minetest.chat_send_player(name,
  26. 'New lines are not permitted in chat messages')
  27. return true
  28. end
  29. end)
  30. -- Also tweak minetest.log because of paranoia.
  31. local log = minetest.log
  32. function minetest.log(level, text)
  33. level = level:gsub('[\r\n]', ' ')
  34. if text then
  35. text = text:gsub('[\r\n]', ' ')
  36. else
  37. text = level
  38. level = 'none'
  39. end
  40. return log(level, text)
  41. end
  42. end
  43. -- Display loaded message
  44. minetest.log('action', '[lurkcoin] Loaded on server "' ..
  45. lurkcoin.server_name .. '".')