From da66780a569712c23ae4f2996cfb4608a9f9d69d Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 1 Apr 2016 20:02:19 -0400 Subject: copy all standard Dreambuilder mods in from the old subgame (exactly as last supplied there, updates to these mods will follow later) --- xban2/importers/minetest.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 xban2/importers/minetest.lua (limited to 'xban2/importers/minetest.lua') diff --git a/xban2/importers/minetest.lua b/xban2/importers/minetest.lua new file mode 100644 index 0000000..e19c3c6 --- /dev/null +++ b/xban2/importers/minetest.lua @@ -0,0 +1,29 @@ + +function xban.importers.minetest() + local f, e = io.open(minetest.get_worldpath().."/ipban.txt") + if not f then + return false, "Unable to open `ipban.txt': "..e + end + for line in f:lines() do + local ip, name = line:match("([^|]+)%|(.+)") + if ip and name then + local entry + entry = xban.find_entry(ip, true) + entry.banned = true + entry.reason = "Banned in `ipban.txt'" + entry.names[name] = true + entry.names[ip] = true + entry.time = os.time() + entry.expires = nil + entry.source = "xban:importer_minetest" + table.insert(entry.record, { + source = entry.source, + reason = entry.reason, + time = entry.time, + expires = nil, + }) + end + end + f:close() + return true +end -- cgit v1.2.3