Page 1 of 2
[Mod] Protector+ [protectorplus]

Posted:
Tue Nov 06, 2012 06:05
by Aqua
Hello this mod is basically glomie's
protector mod, but with more protect's with bigger ranges. Also it doesn't depend on moreores. There is also multiple owners and sharing land by left-clicking on block and typing names in the space! I will add lava prevention in next version!
Features:
-Protect(5 block range) crafted with steel ingots surrounding a locked chest.
-Bigger Protect(10 block range) crafted with a protect on top of another protect.
-Biggest Protect(20 block range) crafted with 4 bigger protects in a 2x2 square.
1.0 (Doesn't Work)
2.0 (Works! And now with multiple owners aka sharing land!)
License: WTFPL
Screenshots:

Biggest Protector In Action.


Posted:
Tue Nov 06, 2012 06:32
by Nightfighter
wow it could protect+1
cool textures too.

Posted:
Tue Nov 06, 2012 09:27
by Zeg9
You could use my code for multiple members, it's in glomie's topic.

Posted:
Tue Nov 06, 2012 09:56
by trukoil
Lol i was thinking to make this mod! Good job

Posted:
Tue Nov 06, 2012 10:53
by Aqua
Zeg9 wrote:You could use my code for multiple members, it's in glomie's topic.
That's a good idea thanks =D

Posted:
Tue Nov 06, 2012 15:52
by Lelix
good

Posted:
Wed Nov 07, 2012 07:39
by trukoil
A server got griefed by lava, so i thought, it's possible for the protector block to convert lava, in its range, to air?

Posted:
Wed Nov 07, 2012 08:03
by Aqua
trukoil wrote:A server got griefed by lava, so i thought, it's possible for the protector block to convert lava, in its range, to air?
Yes, i think i can do that for the next update. Thanks!

Posted:
Wed Nov 07, 2012 08:35
by trukoil
Or even better, a master lava protector, available only for admins, that convert lava in air for 1000 blocks in every direction, except the bottom, so caves will still have lava, but there won't be lava from the ground to the upper limit (some server limits the upper to 1000, so no one could put lava over) and an inversed master lava protector that gives protection to the bottom instead of the upper.

Posted:
Wed Nov 07, 2012 09:13
by Aqua
Great idea trukoil!

Posted:
Thu Nov 08, 2012 07:36
by 0gb.us
Aw. You beat me to releasing a protection plugin that doesn't depend on moreores. I finished building it, I've just been to busy to release it. Meh. Mine still protects against bucket-based attacks, so I'll still release it when I have time. My main feature though is the lack of dependency.
I like the varied ranges on yours. Sometimes you just what to protect a bigger area, but don't want to see protect blocks everywhere. These would go great in a twinkly cave on my server. SOmeone found a large cave half filled with water, covered the top in glass, and placed underwater torches. The effect is mesmerizing, but the current short-range protect blocks detract from the beauty.

Posted:
Thu Nov 08, 2012 15:28
by Sokomine
What impact does the larger protector have on server performance? 5x5x5=125 but 20x20x20=8000. Even if we take into account that on average only halve that many blocks have to be searched it's still ~63 vs 4000....on every dig/place. For larger areas, the node/area protection approach seems more sensible to me. Maybe there is a useful way of mixing both?

Posted:
Fri Nov 09, 2012 04:33
by Aqua
Sokomine wrote:What impact does the larger protector have on server performance? 5x5x5=125 but 20x20x20=8000. Even if we take into account that on average only halve that many blocks have to be searched it's still ~63 vs 4000....on every dig/place. For larger areas, the node/area protection approach seems more sensible to me. Maybe there is a useful way of mixing both?
I sort of understand you. Are you saying that this larger area of protection might effect the server performance? What do you mean in your last two sentences?

Posted:
Fri Nov 09, 2012 05:47
by Sokomine
The protector mod and derived mods protect the land by plugging into the place/dig routines of Minetest. If a player places or digs a node, a function in the protector mod is called and checks if the operation is allowed or not. In order to find out what to reply, the function searches for possible protector nodes in the environment. With a normal protector that protects within a radius of 5 blocks, the mod has to search 5 blocks into each direction (they could all be the protector we're looking for). Thus it's even worse than what I stated above...the normal protector already needs to search 10x10x10=1000 nodes. A protector that has a radius of 20 covers 40x40x40=64000 blocks. And players dig up and place a lot of blocks. Computers are fast nowerdays and the data is most likely already in memory so it might work. But it is not efficient.
For larger areas (especially if the total amount of areas that are to be protected is rather small) the other approach seems better: Store who owns which area and check against that list on every place/dig. That is the approach node_ownership takes. The disadvantage of that is that you have to know the coordinates, take care of overlapping regions etc. - plus someone with privs has to do the actual protection whereas protector-mod allows players to protect their areas with a simple block.
Basicly I'd take the node_ownership approach (because it's much more efficient) and add protector-like blocks for easier handling of the areas.

Posted:
Fri Nov 09, 2012 14:21
by sky
i dont get it what this protector protects?? and from who protects??

Posted:
Sat Nov 10, 2012 07:14
by Aqua
This protect if placed by a player will not allow other players to build or destroy in the protects range. It is used on servers for protection from griefers.

Posted:
Sat Nov 10, 2012 07:35
by sky
nice idea with this someone can make a server and to be someone admin and admin to give to players protector blocks to protect they'r area nice mode Aqua

Posted:
Sun Dec 09, 2012 01:10
by tux_peng
There should be a permission node to bypass all protections
Also, the game has 'default:chest_locked', but the mod refers to 'default:locked_chest'

Posted:
Sun Dec 09, 2012 03:08
by Aqua
tux_peng wrote:There should be a permission node to bypass all protections
Also, the game has 'default:chest_locked', but the mod refers to 'default:locked_chest'
I'll look into it =D

Posted:
Mon Dec 10, 2012 03:16
by tux_peng
only biggest_protect seems to do anything
I just found another bug, an area can overlap another- making a place where noone can build
http://minetest.net/forum/viewtopic.php?pid=55913#p55913

Posted:
Mon Dec 10, 2012 06:27
by Aqua
Yes, you are right only the biggest protect works, but only up to 5 blocks. Okay back to the init.

Posted:
Mon Dec 10, 2012 07:06
by Aqua
Okay, I have fixed the crafting and the biggest protect which now works with a range of 20 blocks in all directions. The other two still don't work. I'm ripping my hair out here!!! =(

Posted:
Mon Dec 10, 2012 10:15
by Aqua
I spent the whole day fixing it up and now it works! I've tried it and made sure everything works! Now there can be multiple player (sharing)!

Posted:
Mon Dec 31, 2012 00:24
by tux_peng
Maybe I got bad files, I will redownload now. But the smaller protectors still don't seem toi work...

Posted:
Mon Dec 31, 2012 04:14
by Aqua
Works fine for me I've tested it in a LAN game

Posted:
Mon Dec 31, 2012 18:29
by tux_peng
Weird, I modified the begest protect to be half the size, so It would work for my server-- do you think it would be possible to create a PvP flag?

Posted:
Tue Jan 01, 2013 00:52
by Aqua
I'll look at the code again and yes I think its possible to make a PvP flag.

Posted:
Tue Jan 01, 2013 03:25
by tux_peng
Aqua wrote:I'll look at the code again and yes I think its possible to make a PvP flag.
Cool, thank. My server is currently NoPvP, but areas would make it interesting

Posted:
Tue Jan 01, 2013 03:56
by tux_peng
I made a small change to init.lua
http://pastebin.com/duhTwNTzIt replaces the hard coded protector sizes with variables defined at the top of the file

Posted:
Fri Mar 08, 2013 09:05
by Shizaku
can someone plz tell me how to get the protector to work seems like only the biggest one is working. i seen in the forms someone was working on it all day and got it to work. can you plz show what you didn under init to fix this its not working and i would really like this to work so i can build things without people recking them dont want to place the biggest one everywhere.