Page 1 of 1

[Mod] Node Owner [20120817][node_owner] - auto node protection

PostPosted: Thu Aug 16, 2012 15:37
by cornernote
Node Owner for Minetest

Blocks you place are owned by you and others cannot dig them or place onto them.

Documentation | GitHub Project

Image

About

This module is open source, so it's distributed freely. If you find it useful then I ask not for your wealth, but simply to spare your time to consider the world we share by watching Earthlings, a multi-award winning film available to watch online for free. A must-see for anyone who wishes to make the world a better place.

Credits

mauvebic - code ideas came from his universal_node_ownership mod
randomproof - code ideas came from his node_ownership mod

License

BSD-3-Clause, Copyright © 2014 Brett O'Donnell

PostPosted: Thu Aug 16, 2012 22:57
by tinoesroho
Whoo!

PostPosted: Thu Oct 04, 2012 16:27
by GuestX
How to use it?

PostPosted: Thu Oct 04, 2012 22:25
by cornernote
Put it in mods folder, then place a node and get another player to try dig it. They should not be able to.

PostPosted: Fri May 10, 2013 15:46
by vktRus
Admin can not remove any block?
Add a timeout for the protection of the week.

PostPosted: Sat May 11, 2013 09:36
by pagliaccio
vktRus wrote:Admin can not remove any block?
Add a timeout for the protection of the week.



i do it, https://github.com/pagliaccio/minetest-node_owner/

i have send a pull request at cornernote on github

PostPosted: Tue Sep 03, 2013 12:32
by Pythagoras
revokes and grants are not correctly evaluated in some test cases. probably caused by "privs" being nowhere defined inside the mod.
it works if you replace

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
privs.admin_node ~= true

with
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.get_player_privs(player)["admin_node"] ~= true

PostPosted: Tue Sep 03, 2013 21:16
by ak399g
How would one add a privelege that gives players the ability to place protected nodes rather than node protection being enabled for all players by default?

Re: [Mod] Node Owner [20120817][node_owner] - auto node prot

PostPosted: Tue Jul 07, 2015 15:23
by bbaez
Hi,

My server was crashing because privs was nil. I checked for nil as follows.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
aa0001@minetest01:~/minetest/mods$ diff node_owner/node_owner/init.lua ~/minetest/minetest-0.4.12-neuromancer/mods/node_owner/node_owner/init.lua
23,26c23,28
<     if owner ~= player and owner ~= '' and privs.admin_node ~= true then
<               minetest.chat_send_player(player, "You can not place nodes here because it is owned by "..owner..".")
<               return itemstack
<     end
---
>       if (privs ~= nil) then
>               if owner ~= player and owner ~= '' and privs.admin_node ~= true then
>                       minetest.chat_send_player(player, "You can not place nodes here because it is owned by "..owner..".")
>                       return itemstack
>               end
>       end
46,48c48,52
<       if owner ~= player and owner ~= '' and privs.admin_node ~= true then
<               minetest.chat_send_player(player, "You can not dig this node because it is owned by "..owner..".")
<               return
---
>       if (privs ~= nil) then
>               if owner ~= player and owner ~= '' and privs.admin_node ~= true then
>                       minetest.chat_send_player(player, "You can not dig this node because it is owned by "..owner..".")
>                       return
>               end


The issue is now itemstack is not returned if privs are nil. This is causing the cannons mod to crash. Could you help resolve the issue since my fix is half baked. I have a lot of mods, only the cannons is crashing so maybe the fix has to be there. Either way, willing to help resolve the issue.

Re: [Mod] Node Owner [20120817][node_owner] - auto node prot

PostPosted: Tue Jul 07, 2015 15:37
by CWz
My advice would be to use the areas mod this mod is outdated and hasn't been updated since 2012

Re: [Mod] Node Owner [20120817][node_owner] - auto node prot

PostPosted: Tue Jul 07, 2015 18:14
by bbaez
Thanks for the info!

Ben