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

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

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

by cornernote » Thu Aug 16, 2012 15:37

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 » Thu Aug 16, 2012 22:57

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 » Thu Oct 04, 2012 16:27

How to use it?
 

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

by cornernote » Thu Oct 04, 2012 22:25

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 » Fri May 10, 2013 15:46

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 » Sat May 11, 2013 09:36

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 » Tue Sep 03, 2013 12:32

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

by ak399g » Tue Sep 03, 2013 21:16

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 » Tue Jul 07, 2015 15:23

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: 195
Joined: Tue Dec 24, 2013 17:01
Location: Banana Land
GitHub: chaoswormz
IRC: CWz
In-game: CWz

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

by CWz » Tue Jul 07, 2015 15:37

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
 

ShadMOrdre
Member
 
Posts: 126
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

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

by ShadMOrdre » Sat Jan 20, 2018 00:08

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_owner/archive/master.zip
Browse Code: https://github.com/ShadMOrdre/node_owner
My other virtual world is an Opensimulator.
 


Return to Mod Releases



Who is online

Users browsing this forum: sirrobzeroone and 5 guests