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

Post Reply
cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

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

by cornernote » Post

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
Last edited by cornernote on Thu Jan 16, 2014 11:10, edited 1 time in total.

tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

Whoo!
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

GuestX

by GuestX » Post

How to use it?

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

Put it in mods folder, then place a node and get another player to try dig it. They should not be able to.

vktRus
Member
Posts: 67
Joined: Wed May 01, 2013 07:23

by vktRus » Post

Admin can not remove any block?
Add a timeout for the protection of the week.

pagliaccio
Member
Posts: 65
Joined: Tue Jul 31, 2012 07:38
Location: italy

by pagliaccio » Post

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

User avatar
Pythagoras
Member
Posts: 14
Joined: Mon Nov 05, 2012 00:29
Location: Vienna

by Pythagoras » Post

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

Code: Select all

privs.admin_node ~= true
with

Code: Select all

minetest.get_player_privs(player)["admin_node"] ~= true

User avatar
ak399g
Member
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR
Contact:

by ak399g » Post

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?
aka SAFR

bbaez
Member
Posts: 51
Joined: Wed Jul 09, 2014 15:24

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

by bbaez » Post

Hi,

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

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.

CWz
Member
Posts: 197
Joined: Tue Dec 24, 2013 17:01
GitHub: chaoswormz
IRC: CWz
In-game: CWz
Location: Banana Land

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

by CWz » Post

My advice would be to use the areas mod this mod is outdated and hasn't been updated since 2012

bbaez
Member
Posts: 51
Joined: Wed Jul 09, 2014 15:24

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

by bbaez » Post

Thanks for the info!

Ben

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

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

by ShadMOrdre » Post

Thanks to Cornernote for this mod.

Updated by me to work with Minetest v0.4.16, might work with versions from v0.4.13, but this is untested by me.

The solution was to simply add the param2 parameter to Cornernotes custom item_place_node definition.

DOWNLOAD: https://github.com/ShadMOrdre/node_owne ... master.zip
Browse Code: https://github.com/ShadMOrdre/node_owner

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 21 guests