[Mod] Advanced area protection [areas]

User avatar
WebWolf
Member
 
Posts: 15
Joined: Thu Jun 19, 2014 05:00

Re: [Mod] Advanced area protection [areas]

by WebWolf » Tue Jun 24, 2014 23:16

Hi ShadowNinja,

Is there a possibility to include a new feature: the admin (or the player with a specific privilege/grant) can set or select a specific area to have PVP turned off (desactivated), when in PVP servers?
(in other words, PVP is active in the world, except in those lands/claims/protectedAreas where the admin turned the flag off for PVP)
As a real (and the main reason for the request) example, there is the Spawn area in a server: the player will not be able to hurt or kill another player; and he will not be hurted or killed (no damage taken) by other player too, when in the Spawn (or in some other specific protected area when pvp flag is turned off for that protected area).

This special option in a Mod for protecting land (where admins are able to disable PvP only in protected areas) has been asked since 2012, almost 2 years ago, without success till now. :(
https://forum.minetest.net/viewtopic.php?f=6&t=4108

Please, can you add this new feature/option?

Thank you.
 

User avatar
ShadowNinja
Developer
 
Posts: 199
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Advanced area protection [areas]

by ShadowNinja » Wed Jun 25, 2014 00:49

brunob.santos wrote:Could you make areas hurt players who try to violate the areas?

Yes, but:
  1. This can be done much more generically with a separate mod using register_on_protection_violation
  2. I don't like these deterrents because they hurt legitimate players and do nothing if the player messes with a unprotected area. If the area is protected they can't touch it and damaging them is pointless.

RHR wrote:Is it possible to remove a piece of a protected area? For example if you want to protect a huge area and make some small areas unprotected.

Yes, protect the large area and each small area, then use /area_open on the small areas that you want to be public.
The best way to contact me is usually IRC (InchraNet, freenode).
 

User avatar
ShadowNinja
Developer
 
Posts: 199
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Advanced area protection [areas]

by ShadowNinja » Wed Jun 25, 2014 00:55

WebWolf wrote:Is it possible to have areas where PvP is enabled or disabled? [Edited for clarity and brevity]

No. The PvP setting is server-wide, and clients might cache it. However it's probably possible to fake it by overriding on_punch or a similar callback in all entities to make it check where it is before accepting damage. This would be ugly though, would probably produce incorrect client-side damage prediction, and is definitely best suited for a external mod. Areas provides an API for external mods to use.
The best way to contact me is usually IRC (InchraNet, freenode).
 

User avatar
WebWolf
Member
 
Posts: 15
Joined: Thu Jun 19, 2014 05:00

Re: [Mod] Advanced area protection [areas]

by WebWolf » Wed Jun 25, 2014 06:05

ShadowNinja wrote:No. (...) However it's probably possible to fake it by overriding on_punch or a similar callback in all entities to make it check where it is before accepting damage. This would be ugly though, would probably produce incorrect client-side damage prediction, and is definitely best suited for a external mod. Areas provides an API for external mods to use.


OK. So maybe there is some kind of light (possibility) in the future (through a new Mod)..
Thank you. :)
 

lotek
Member
 
Posts: 22
Joined: Mon Jun 02, 2014 20:21
Location: Switzerland
GitHub: LotekHeavy
IRC: lotek
In-game: lotek

Re: [Mod] Advanced area protection [areas]

by lotek » Sat Jul 19, 2014 13:34

how could I achieve that this mod (or another) also prevent users from digging through walls and to creep into "protected" buildings?
----
Mine Heavy
http://mine.heavy.ch
 

User avatar
Krock
Developer
 
Posts: 4107
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] Advanced area protection [areas]

by Krock » Sat Jul 19, 2014 14:43

lotek wrote:how could I achieve that this mod (or another) also prevent users from digging through walls and to creep into "protected" buildings?

Revoke them "interact" or use (almost) not breakable nodes. Lags can happen.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
ShadowNinja
Developer
 
Posts: 199
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Advanced area protection [areas]

by ShadowNinja » Sat Jul 19, 2014 23:18

lotek wrote:how could I achieve that this mod (or another) also prevent users from digging through walls and to creep into "protected" buildings?

This is impossible. Clients will always be able to go into protected buildings, even if it takes a modified client or disconnecting a network cable to do it. However, you can use a mod like my bedrock mod to slow down less determined players though.
The best way to contact me is usually IRC (InchraNet, freenode).
 

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

Re: [Mod] Advanced area protection [areas]

by ak399g » Wed Jul 23, 2014 02:29

I recall one mod that dealt damage to players that dug protected nodes. It wouldn't completely protect the inside, but with a high enough damage setting, players would die upon entry.
 

User avatar
Calinou
Moderator
 
Posts: 3145
Joined: Mon Aug 01, 2011 14:26
Location: Troyes, France
GitHub: Calinou
IRC: Calinou
In-game: Calinou

Re: [Mod] Advanced area protection [areas]

by Calinou » Wed Jul 23, 2014 08:35

ak399g wrote:I recall one mod that dealt damage to players that dug protected nodes. It wouldn't completely protect the inside, but with a high enough damage setting, players would die upon entry.


It's incredibly annoying to do such a thing, because it's hard enough to see whether a node is protected or not already. The only way where it would be acceptable is where it hurts you, then your health is given back after a few seconds.
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Advanced area protection [areas]

by Sokomine » Wed Jul 23, 2014 14:29

Calinou wrote:It's incredibly annoying to do such a thing, because it's hard enough to see whether a node is protected or not already.

That's right. It usually annoys me a lot as well. Fortionately, the Landrush landclaim mod evolved. Brandon included some code (at least on his server) so that players who have been online for some time did no longer get attacked by the mod. No damage at all would still be better (that flower standing in the wild landscape without any indication of a building miles around may be protected), but with that exception for players who have been on some time, it usually works fine.
A list of my mods can be found here.
 

User avatar
Don
Member
 
Posts: 1642
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Advanced area protection [areas]

by Don » Sun Sep 28, 2014 02:47

I have created a tool but the tool can be used in protected areas. I looked at the bucket code and the door code but I don't understand how to make it work. After I registered my tool I used this code to make it do something.
Code: Select all
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
   if puncher:get_wielded_item():get_name() == "staff:staff"
   and node.name == "default:cobble" then
   minetest.set_node(pos,{name = "default:sand"})
   end


Any chance you could help me out.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
ShadowNinja
Developer
 
Posts: 199
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Advanced area protection [areas]

by ShadowNinja » Mon Sep 29, 2014 00:52

Don wrote:I have created a tool but the tool can be used in protected areas [whereas it shouldn't]. Any chance you could help me out?

Yes, Areas supports Minetest's built-in protection API. Use minetest.is_protected(pos, player_name) to check if an area is protected from a player. If the area is protected you should probably call minetest.record_protection_violation(pos, player_name), which will send the user a warning chat message (and with other protection mods might do other things, such as inflicting damage on the player).
For example:
Code: Select all
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
   if puncher:get_wielded_item():get_name() == "staff:staff"
         and node.name == "default:cobble" then
      local player_name = punchar:get_player_name()
      if minetest.is_protected(pos, player_name) then
         minetest.record_protection_violation(pos, player_name)
         return
      end
      minetest.set_node(pos, {name = "default:sand"})
   end
end
The best way to contact me is usually IRC (InchraNet, freenode).
 

User avatar
jp
Member
 
Posts: 706
Joined: Wed Dec 18, 2013 09:03
Location: France
GitHub: kilbith

Re: [Mod] Advanced area protection [areas]

by jp » Wed Oct 29, 2014 11:00

- Idea -

Seeing the stars on GitHub or the sustained motivation brings by the 'likes' on FB, I thought that players may appreciate be starred for the quality of their construction. It can be interpretated like a simple thank you, a measurable valuation that authors can check anytime, or an effective way to visit the interesting buildings by priority.

Example :

(/star for starring a protected area)
Image
[Mods] Crafting GuideSpectator ModeX-Decor[+]
[Maps] New York CityMinecraft Imported Maps
[Textures] PixelBOX Reloaded

Like my stuff? Consider donating.
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
Location: On earth
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Advanced area protection [areas]

by Sokomine » Thu Oct 30, 2014 05:20

jp wrote:Seeing the stars on GitHub or the sustained motivation brings by the 'likes' on FB, I thought that players may appreciate be starred for the quality of their construction. It can be interpretated like a simple thank you, a measurable valuation that authors can check anytime, or an effective way to visit the interesting buildings by priority.

That would be very nice to have. I've seen many great buildings where I wanted to thank the people who had built them for doing so. The areas mod and its data structure is also a natural place that comes to mind for storing such praise.
A general "thank you", "recommend this to others" and maybe "report a problem" (in case lava gone wild or something else which might require intervention) might work best. If stars are assigned, a rating of e.g. 1-5 stars comes to mind - which might not work so well as everyone might have a diffrent opinon about what ought to be ranked how, whereas a "thank you" is more neutral.
Another reason for wanting to have such an option could be to allow players to self-protect more areas if the areas they have already found the approval of other players. This might be a protection against land-grabbing.
A list of my mods can be found here.
 

Sol
Member
 
Posts: 73
Joined: Thu Jul 31, 2014 05:21
In-game: sol

Re: [Mod] Advanced area protection [areas]

by Sol » Thu Oct 30, 2014 06:08

Great idea, jp. I'll implement that on my server at some point.
There is no such thing as duty. If you know that a thing is right, you want to do it. If you don't want to do it—it isn't right. If it's right and you don't want to do it—you don't know what right is and you're not a man. -- Ayn Rand
 

User avatar
ShadowNinja
Developer
 
Posts: 199
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Advanced area protection [areas]

by ShadowNinja » Fri Oct 31, 2014 01:24

jp wrote:Idea: Area staring.

This seems like more of a "cool" feature than a "useful" one, so I think it would be better implemented with a separate mod using the Areas API. It wouldn't be as simple as your mockup though because you can be standing in multiple areas at a time and you'd have to explicitly pass an area ID.
The best way to contact me is usually IRC (InchraNet, freenode).
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
Location: On earth
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun
 

User avatar
Krock
Developer
 
Posts: 4107
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] Advanced area protection [areas]

by Krock » Fri Oct 31, 2014 16:30

Minetestforfun wrote:@ShadowNinja
I think also, we need a separate mod for this "stars idea" :)

How about extending a configuration file with a setting to enable/disable this feature?
I like the stars-idea and I hope it's not possible to give a star more than once on an area.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Advanced area protection [areas]

by Sokomine » Fri Oct 31, 2014 22:32

ShadowNinja wrote:This seems like more of a "cool" feature than a "useful" one, so I think it would be better implemented with a separate mod using the Areas API.

I think it could actually be useful on a server where quality is more important than quantity. On the Minecraft classic server I started getting to know this kind of game, players started on one map, and then subsequently gained access to other maps/areas where they got permission to built after their buildings where inspected by moderators and found good enough. Most Minetest servers are very diffrent in this regard. A problem they do have is that the area around spawn is limited and valuable, and that players sometimes grab too much land.

ShadowNinja wrote: It wouldn't be as simple as your mockup though because you can be standing in multiple areas at a time and you'd have to explicitly pass an area ID.

My marker stone attempts to figure out - amongst other things - which area is the smallest (and thus most fitting) one at the place the stone is located. A formspec where the name of the player is listed and the thank you/approval can be given could help.
A list of my mods can be found here.
 

Neizi
New member
 
Posts: 3
Joined: Thu Jan 08, 2015 04:30

Re: [Mod] Advanced area protection [areas]

by Neizi » Thu Jan 08, 2015 07:37

sorry but it plain does not work. i was playign on a server with this mod installed, my lane was protected and people can still A: open your doors B: break anything they want on your property. i had 2 retards go onto my land, break my windows, walls, doors, steal my chicken eggs, steal diamonds out of my chests, and the list goes on. all in front of me to. sorry but a mod like this CANT have a way around it or im sorry, it may as well not exist, and no, im not going to be nice about it either. your mod stats it will keep people from breaking things built on your land and it doesn't.
 

User avatar
Don
Member
 
Posts: 1642
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Advanced area protection [areas]

by Don » Thu Jan 08, 2015 15:25

Neizi wrote:sorry but it plain does not work. i was playign on a server with this mod installed, my lane was protected and people can still A: open your doors B: break anything they want on your property. i had 2 retards go onto my land, break my windows, walls, doors, steal my chicken eggs, steal diamonds out of my chests, and the list goes on. all in front of me to. sorry but a mod like this CANT have a way around it or im sorry, it may as well not exist, and no, im not going to be nice about it either. your mod stats it will keep people from breaking things built on your land and it doesn't.

I have this mod on my server. It works exactly how it is suppose to. Either you are doing something wrong or the server is not set up right.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
ShadowNinja
Developer
 
Posts: 199
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Advanced area protection [areas]

by ShadowNinja » Thu Jan 08, 2015 16:52

I've had a server owner come to me with a similar complaint. The problem was that they had areas (the administration privilege) granted by default to all players.
It's quite likely that the server is mis-configured or you're misusing the mod.
If most things are protected but one or two things aren't, it's likely that a different mod is using custom digging / placing code and neglecting to check for protection with the protection API.

Doors are intentionaly still useable in protected areas, use steel doors if you want them to be protected. Likewise with chests and locked chests.
The best way to contact me is usually IRC (InchraNet, freenode).
 

disableclouds
New member
 
Posts: 4
Joined: Sat Dec 13, 2014 03:57

Re: [Mod] Advanced area protection [areas]

by disableclouds » Tue Jan 13, 2015 17:45

Hi, chickens from mod simple_mobs lay eggs in a protected area and only the owner can remove them. Is it easily possible to add a whitelist of objects/nodes that would be exempt from protection?
 

User avatar
ShadowNinja
Developer
 
Posts: 199
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Advanced area protection [areas]

by ShadowNinja » Tue Jan 13, 2015 20:14

disableclouds wrote:Hi, chickens from mod simple_mobs lay eggs in a protected area and only the owner can remove them.

This is an issue with simple_mobs.
If eggs are entities, areas doesn't do any protection handling for entities and simple_mobs is doing this.
If eggs are nodes, simple_mobs is missing a protection check before placing the egg.
The best way to contact me is usually IRC (InchraNet, freenode).
 

PreviousNext

Return to Mod Releases



Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], LionsDen and 11 guests