mirror of
https://github.com/minetest-mods/areas.git
synced 2024-12-25 18:20:39 +01:00
Fix license, add comment about owner_defs support
This commit is contained in:
parent
d026b42a79
commit
ad04e7b5f6
2
init.lua
2
init.lua
@ -1,6 +1,6 @@
|
|||||||
-- Areas mod by ShadowNinja
|
-- Areas mod by ShadowNinja
|
||||||
-- Based on node_ownership
|
-- Based on node_ownership
|
||||||
-- License: GPLv2+
|
-- License: LGPLv2+
|
||||||
|
|
||||||
areas = {}
|
areas = {}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ minetest.register_chatcommand("legacy_load_areas", {
|
|||||||
privs = {areas=true, server=true, privs=true},
|
privs = {areas=true, server=true, privs=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
minetest.chat_send_player(name, "Converting areas...")
|
minetest.chat_send_player(name, "Converting areas...")
|
||||||
err = areas:legacy_load()
|
err = areas:node_ownership_load()
|
||||||
if err then
|
if err then
|
||||||
minetest.chat_send_player(name, "Error loading legacy file: "..err)
|
minetest.chat_send_player(name, "Error loading legacy file: "..err)
|
||||||
return
|
return
|
||||||
@ -39,7 +39,8 @@ minetest.register_chatcommand("legacy_load_areas", {
|
|||||||
end})
|
end})
|
||||||
|
|
||||||
-- The old load function from node_ownership (with minor modifications)
|
-- The old load function from node_ownership (with minor modifications)
|
||||||
function areas:legacy_load()
|
-- Licensed GPLv2 as it is only slightly modified.
|
||||||
|
function areas:node_ownership_load()
|
||||||
local filename = minetest.get_worldpath().."/owners.tbl"
|
local filename = minetest.get_worldpath().."/owners.tbl"
|
||||||
tables, err = loadfile(filename)
|
tables, err = loadfile(filename)
|
||||||
if err then
|
if err then
|
||||||
@ -106,6 +107,7 @@ IsPlayerNodeOwner = areas.isNodeOwner
|
|||||||
GetNodeOwnerName = areas.getNodeOwnerName
|
GetNodeOwnerName = areas.getNodeOwnerName
|
||||||
HasOwner = areas.hasOwner
|
HasOwner = areas.hasOwner
|
||||||
|
|
||||||
|
-- This is entirely untested and may break in strange and new ways.
|
||||||
if areas.legacy_table then
|
if areas.legacy_table then
|
||||||
owner_defs = {}
|
owner_defs = {}
|
||||||
setmetatable(owner_defs, {
|
setmetatable(owner_defs, {
|
||||||
|
Loading…
Reference in New Issue
Block a user