Page 1 of 9

[Mod] Advanced area protection [areas]

Posted: Tue Sep 17, 2013 16:51
by ShadowNinja
Areas is a advanced area protection mod based on node_ownership.

Features:
  • Players with the 'areas' privilege can dig and place in protected areas without having to grant themselves control over it.
  • Areas can be named.
  • Simpler to use.
  • Players that have a certain privilege will be able to protect a set number of areas within a size limit by themselves using the /protect command. (If the server administrator enables it)
  • Areas made with node_ownership can be converted with one simple command.
  • Areas can intersect.
  • Area owners are displayed on the HUD.
  • Players do not have to be online for you to grant them areas.
  • Cleaner and faster code. :-)
To convert the area data from a node_ownership installation run /legacy_load_areas 0

License: LGPLv2.1+
Dependencies: None
GitHub: https://github.com/ShadowNinja/areas
Download: https://github.com/ShadowNinja/areas/archive/master.zip

Posted: Tue Sep 17, 2013 17:07
by PilzAdam
You should have called it "YAPM", Yet Another Protection Mod.

Posted: Tue Sep 17, 2013 17:20
by Sokomine
All those protection mods out there do have one or the other flaw/limitation. Some are fine for very small areas - and small houses are easier to build well for less skilled players than large projects - but do not work at all for middle-sized to huge projects.

node_ownership is the protection mod I like most: It works, it protects well, it's fast - so it makes every sense to improve that mod further.

One issue I have with it is the way areas are marked. That got improved a lot in this mod, but it's still not optimal. I'd like players to be able to mark their aras on their own (at least the smaller ones). Fiddling with coordinates is too confusing for most players. Marking all four corners of an area with nodes that are well visible seems to come more natural to people. Unfortionately, most players on Redcrabs server are utterly confused when I ask them to show me two diagonally opposite corners of their area. So perhaps letting them mark all four corners and offering a formspec on those marker nodes where the players can enter how deep they want to go their area into the ground and the sky respectively and how they want it called may help.

Posted: Tue Sep 17, 2013 19:35
by jojoa1997
Maybe you could have areas protected by mapblock.

Posted: Wed Sep 18, 2013 08:09
by rubenwardy
PilzAdam wrote:You should have called it "YAPM", Yet Another Protection Mod.
Copyrighted by YAMM: Yet Another Mob Mod!

Posted: Wed Sep 18, 2013 12:10
by PilzAdam
rubenwardy wrote:
PilzAdam wrote:You should have called it "YAPM", Yet Another Protection Mod.
Copyrighted by YAMM: Yet Another Mob Mod!
I have all rights for "YAMM", I invented that too: http://irc.minetest.ru/minetest/2013-04-25#i_3049464

Posted: Wed Sep 18, 2013 12:14
by rubenwardy
But you did not baggisy / trademark it! (neither did i)

Posted: Wed Sep 18, 2013 12:35
by hoodedice
(c) Minetest C-55 (tm)(R) All Rights Reserved LGPL 2 Celeron C-55.

Code: Select all

ALL YOUR MODS ARE BELONG TO US

-[i]Celeron-55[/i]

Posted: Wed Sep 18, 2013 19:09
by ShadowNinja
jojoa1997 wrote:Maybe you could have areas protected by mapblock.
That is what 0gb.us's landclaim_0gb_us mod does.
Unfortunately that makes it impossible to protect a precise area and very difficult to protect a large area.

Posted: Wed Sep 18, 2013 21:33
by fairiestoy
Why not mixin the landrush mod then? (which is a modified fork of landclaim_0gb_us) but instead of dividing the map into chunks, let the user decide what area to use. About storage: Just detect the outermost corners of the area protected and save all four points (if only horizontal coordinates are taken into account) of this area. How you solve the protections is your task, but i suggest to let the user set a node which has a formspec within where one can define the size of the area to be protected (as long as it doesn't intersect with another area) up to a specific limit ( we don't want users to claim the entire map ). As a visualization help, there could be a button within the formspec to show an entity ( /showarea in the landrush mod for example ) which shows the boundaries of the area to be protected. Its simple to use for new players ( due to visualization ) and it allows dynamic size settings. About the node: Once the user presses 'Proceed', the node disappears and the area is protected. Sounds intuitive enough for me.

Posted: Thu Sep 19, 2013 02:05
by Sokomine
The showarea command of the landrush mod is indeed very helpful for checking the area. It also seems pretty easy to use for players. I personally do not like the landrush mod as such because it is bundled with attacking the player upon trying to dig/build in protected aeras which are not always recognizable as such. Both mods are very diffrent in implementation.

Perhaps "mark four corners and enter height, depth and region name in a formspec" would really be easiest? How do players want to mark their regions?

Posted: Sat Sep 21, 2013 12:20
by Cooper97
I like this mod but there is a bug:
If I execute /area_pos1 or /area_pos2 it crashes the server and says: "ServerError: LuaError: error: ...\minetest-0.4.7\minetest-0.4.7\bin\...\mods\areas\pos.lua:62 attempt to index a global 'vector' (a nil value)"

Can you fix this bug please? Seems to be in pos.lua, line 62

Posted: Sat Sep 21, 2013 13:01
by PilzAdam
Cooper97 wrote:I like this mod but there is a bug:
If I execute /area_pos1 or /area_pos2 it crashes the server and says: "ServerError: LuaError: error: ...\minetest-0.4.7\minetest-0.4.7\bin\...\mods\areas\pos.lua:62 attempt to index a global 'vector' (a nil value)"

Can you fix this bug please? Seems to be in pos.lua, line 62
You need a dev version of Minetest, this mod doesnt work with 0.4.7 stable.

Posted: Thu Sep 26, 2013 14:48
by ShadowNinja
I have added a owners display to the HUD, inspired by the landrush mod by Brenaweb.
This will only work on very recent servers (from today). Otherwise moving from one area to another will just change the color of the text to black.
I have attempted to add a /show_area command, and it almost worked. The issue is that Minetest only accepts X and Y values for visual_scale, Z is ignored. For now you will have to use the /select_area command, which places markers at the opposite corners of the area.
The protection management node is a good idea, I will see if I can implement it in a way that makes things easier for players. Perhaps it would only have settings for width, height, and depth.

Posted: Fri Sep 27, 2013 16:11
by Sokomine
Thanks for further developing the mod! I hope a way can be found so that it is really easy to use. The node_ownership mod was already very good as far as protection and ressource efficency go. With that code cleaned up and improved where needed, plus some easy handling that can be done by players, there's hope for a really good protection mod.

Posted: Sat Sep 28, 2013 01:03
by fairiestoy
A few things i would like to mention too:
( i didn't take a closer look into your code )
Keep in mind what TNT and Technic stuff does. On landrush we fixed already problems with TNT (somehow) and the screwdriver which had a really annoying security issue. But still the problem with constructers remain. Also stuff from the circular are not behaving correctly, so many stuff to workaround.

Posted: Sun Nov 24, 2013 17:04
by CraigyDavi
Is there any plan to support screwdrivers and buckets.

You can open steel doors and use a screwdriver within protected areas.

You can place water and lava in a protected areas, although it stops you placing lava_source and water_source.

Otherwise great mod. But these issues would be good to resolve.

Posted: Sun Nov 24, 2013 18:46
by ShadowNinja
CraigyDavi wrote:Is there any plan to support screwdrivers and buckets.
Yes, however this has to be fixed in the buckets and screwdriver mods, not individual protection mods. See minetest_game #221.

Posted: Sun Nov 24, 2013 22:00
by fairiestoy
Shadow, since you are ( iirc ) also working on technic, you should then consider updating the cans. Griefing with them is still possible, when we are talking about the responsibility of this specific mods :)

Posted: Mon Nov 25, 2013 14:58
by CraigyDavi
ShadowNinja wrote:
CraigyDavi wrote:Is there any plan to support screwdrivers and buckets.
Yes, however this has to be fixed in the buckets and screwdriver mods, not individual protection mods. See minetest_game #221.
Thanks. I will change my bucket file now.

Posted: Mon Nov 25, 2013 18:49
by CraigyDavi
ShadowNinja wrote:
CraigyDavi wrote:Is there any plan to support screwdrivers and buckets.
Yes, however this has to be fixed in the buckets and screwdriver mods, not individual protection mods. See minetest_game #221.
Unfortunatly it does not work for me :(
Can anyone see the problem with it? My error is something about a nil value from the start (line 22).

Posted: Mon Nov 25, 2013 21:15
by fairiestoy
Probably your minetest version is outdatet. Since the minetest.is_protected interface is not that old. Consider updating your minetest and it should work then.

Posted: Wed Dec 11, 2013 13:31
by Megaf
Thanks ShadowNinja, Using this mod now to replace node_ownership, it works fine. Thank you!
ShadowNinja wrote:Areas is a advanced area protection mod based on node_ownership.

Features:
  • Players with the 'areas' privilege can dig and place in protected areas without having to grant themselves control over it.
  • Areas can be named.
  • Simpler to use.
  • Players that have a certain privilege will be able to protect a set number of areas within a size limit by themselves using the /protect command. (If the server administrator enables it)
  • Areas made with node_ownership can be converted with one simple command.
  • Areas can intersect.
  • Area owners are displayed on the HUD.
  • Players do not have to be online for you to grant them areas.
  • Cleaner and faster code. :-)
To convert the area data from a node_ownership installation run /legacy_load_areas 0

License: LGPLv2+
Dependencies: None
GitHub: https://github.com/ShadowNinja/areas
Download: https://github.com/ShadowNinja/areas/archive/master.zip

Posted: Wed Dec 11, 2013 17:54
by minermoder27
Maybe if you give someone a sub area you should be able to remove it.

Posted: Wed Dec 11, 2013 19:16
by ShadowNinja
Megaf wrote:Thanks ShadowNinja, Using this mod now to replace node_ownership, it works fine. Thank you!
You're welcome, glad you like it. :-)
minermoder27 wrote:Maybe if you give someone a sub area you should be able to remove it.
You can, use /remove_area (or /recursive_remove_areas if they have their own sub-areas that you want to remove).