From 4da27b664af5c1e203bf7084a9386753478df4d3 Mon Sep 17 00:00:00 2001 From: rarkenin Date: Sun, 3 Mar 2013 20:25:14 -0500 Subject: [PATCH] begin remote management Begin with remote query. --- .../mods/added/landclaim_0gb_us/init.lua | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/0gb.us_game/mods/added/landclaim_0gb_us/init.lua b/0gb.us_game/mods/added/landclaim_0gb_us/init.lua index 11abf96..40195f5 100644 --- a/0gb.us_game/mods/added/landclaim_0gb_us/init.lua +++ b/0gb.us_game/mods/added/landclaim_0gb_us/init.lua @@ -271,6 +271,29 @@ minetest.register_chatcommand("mayedit", { end, }) +minetest.register_chatcommand("mayedit_remote", { + params = "", + description = "lists the people who may edit a remote location", + privs = {interact=true}, + func = function(name, param) + local pos ={} + pos.x, pos.y, pos.z = string.match(param, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$") + -- pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects + local mayedit = landclaim_0gb_us.get_owner(pos) + if mayedit then + local chunk = landclaim_0gb_us.get_chunk(pos) + for user, user in pairs(claims[chunk].shared) do + mayedit = mayedit..", "..user + end + minetest.chat_send_player(name, mayedit) + local entpos = landclaim_0gb_us.get_chunk_center(pos) + minetest.env:add_entity(entpos, "landclaim_0gb_us:showarea") + else + minetest.chat_send_player(name, "This area is unowned.") + end + end, +}) + minetest.register_entity("landclaim_0gb_us:showarea",{ on_activate = function(self, staticdata, dtime_s)