[Mod] Simple protection [simple_protection]

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

[Mod] Simple protection [simple_protection]

by Krock » Sat Apr 12, 2014 12:18

Simple protection



+ Preview images


A Minetest area protection mod, based on a fixed claim grid. It is based on ideas of the LandRush mod and splits the world into claim-cuboids. Every cuboid/area is 16x80x16 nodes large (adjustable) and allows sharing access with other players.

Areas can be claimed using a Claim Stick (simple_protection:claim):
Image
Punch a node somewhere in the area you would like to claim. A green text with your name will appear on the bottom left side if it succeed.
Admins get some additional power with the simple_protection privilege which allows editing, modifying and deleting any area.

The following contents might be more up-to-date on GitHub.
Features
  • Easy, single-click protection
  • Fixed claim grid: 16x80x16 by default
  • ^ To configure: see default_settings.lua header text
  • Minimap-like radar to see areas nearby
  • Visual area border feedback, as seen in the protector mod
  • List of claimed areas
  • Shared Chest for exchanging items
  • Translation support
  • Optional setting to require an area before digging

Chat commands
Code: Select all
/area <command> [<args> ...]
   show              -> Provides information about the current area
   radar             -> Displays a minimap-like area overview
   share <name>      -> Shares the current area with <name>
   unshare <name>    -> Unshares the current area with <name>
   shareall <name>   -> Shares all your areas with <name>
   unshareall <name> -> Unshares all your areas with <name>
   list [<name>]     -> Lists all areas (optional <name>)
   unclaim           -> Unclaims the current area
   delete <name>     -> Removes all areas of <name> (requires "server" privilege)


About "/area show"
Area status: Not claimable
  • Shown when the area can not be claimed
  • Happens (by default) in the underground
Players with access: foo, bar*, leprechaun, *all
  • foo, leprechaun: Regular single area share
  • bar*: Has access to all areas with the same owner
  • *all: Everybody can build and dig in the area

Possible configuration adjustments
Claim area size: X/Z square and Y height
Depth-based claim limit: Areas below this limit can not be claimed

Dependencies
  • default: Crafting recipes
Optional dependencies
  • intllib: Translations
  • areas: HUD compatibility
  • landrush: Only to prevent shared chests from turning into unknown nodes

License: CC0
Links: .git clone, View sauce, Unhandy *.zip
Last edited by Krock on Wed Oct 04, 2017 16:33, edited 7 times in total.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 2318
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

by TenPlus1 » Sat Apr 12, 2014 20:09

I seem to be missing something here... Installed mod, ran server, claimed area with stick and logged out... Logged in as different user and tampered with area and it let me do anything even though it was clearly shown as someone else's area... ? any ideas ?
 

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

by Krock » Sun Apr 13, 2014 06:59

TenPlus1 wrote:I seem to be missing something here... Installed mod, ran server, claimed area with stick and logged out... Logged in as different user and tampered with area and it let me do anything even though it was clearly shown as someone else's area... ? any ideas ?


Krock wrote:The "simple_protection" privilege allows to modify and delete every area.

Maybe you've got all privileges on the 2nd account? Else I've got no idea what could cause this.
Last edited by Krock on Sun Apr 13, 2014 06:59, edited 1 time in total.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 2318
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

by TenPlus1 » Sun Apr 13, 2014 08:25

My bad, the 2nd user had 'simple_protecion' privs without me knowing... pah!... works fine dude, like that it stops bucket drops and errant rotatable blocks as well... nicely done...
 

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

by Krock » Sun Apr 13, 2014 08:27

TenPlus1 wrote:like that it stops bucket drops and errant rotatable blocks as well... nicely done...

Thanks but that all is not my work, they seem to use the "minetest.is_protected(pos, player)" function :3
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

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

by Sokomine » Sun Apr 13, 2014 19:45

The vote options do not fit. I don't like mods that hurt players who dig flowers in seemingly untouched nature and who ban regular players on a regular basis because..well..regular players tend to build, and not all neighbours might be considerate enough to constantly share all areas.

Also, an 8x8 blocks area is pretty small. Even my houses usually won't fit in there. Considering the price for a claim stick, people might be discouraged from larger buildings.
A list of my mods can be found here.
 

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

by Krock » Sun Apr 13, 2014 19:59

Sokomine wrote:I don't like mods that hurt players who dig flowers

I know that :)
By default, there's no punishment for griefers.

Sokomine wrote:Also, an 8x8 blocks area is pretty small. Even my houses usually won't fit in there. Considering the price for a claim stick, people might be discouraged from larger buildings.

Hmm I think it's easy to get 4 steel and 4 copper while 10 minutes of digging with a stone pickaxe.
Also, it's possible to change the claim size in the configuration file.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

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

by Sokomine » Sun Apr 13, 2014 20:25

Krock wrote:I know that :)
By default, there's no punishment for griefers.

The very idea of including that functionality is frowned upon by me :-)
A list of my mods can be found here.
 

User avatar
Achilles
Member
 
Posts: 247
Joined: Sun Dec 15, 2013 11:55
Location: Excuse Me???? -_-
In-game: Achilles

by Achilles » Mon Apr 14, 2014 17:49

Nice mod
The Ironic Thing About Common Sense Is That It Isn't Very Common
 

User avatar
Achilles
Member
 
Posts: 247
Joined: Sun Dec 15, 2013 11:55
Location: Excuse Me???? -_-
In-game: Achilles

by Achilles » Mon Apr 14, 2014 18:11

Sokomine wrote:
Krock wrote:I know that :)
By default, there's no punishment for griefers.

The very idea of including that functionality is frowned upon by me :-)


I like the idea of there being a punishment however it would be better if the punishment was only given if a player continually tried to place or break the exact same block in a protected area. That way you would not be punishing a client who placed a block by mistake.
Last edited by Achilles on Mon Apr 14, 2014 18:12, edited 1 time in total.
The Ironic Thing About Common Sense Is That It Isn't Very Common
 

User avatar
TenPlus1
Member
 
Posts: 2318
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Simple protection [simple_protection]

by TenPlus1 » Sun May 11, 2014 14:00

I have simple_protection running on a standalone server and after some testing found that I cannot open locked chests or doors properly, the weirder thing is that they work so long as I'm holding a wooden door while opening them ?!?!?! I know, strange... And now random wooden doors appear throughout the map and it only happens when this mod is active...

Any ideas ???
 

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

Re: [Mod] Simple protection [simple_protection]

by Krock » Sun May 11, 2014 18:29

TenPlus1 wrote:Any ideas ???

Yes, try to open it with a stick or a not-node item.
Have you got a screenshot of "random wooden doors appear throughout the map"?
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 2318
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Simple protection [simple_protection]

by TenPlus1 » Mon May 12, 2014 07:20

Krock, sorry dude I removed them all after disabling simple_protection from Xanadu server... They were appearing everywhere an area was protected but only at sea level and below...
 

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

Re: [Mod] Simple protection [simple_protection]

by Krock » Mon May 12, 2014 11:03

Thanks for the bugreport, I'll check this bug as far I've got some free time.


EDIT: I'm sorry but I can not reproduce your bug. Please give me more information, maybe there are more protection systems or an outdated "doors" mod.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 2318
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Simple protection [simple_protection]

by TenPlus1 » Mon May 12, 2014 18:57

Xanadu server was using the latest daily build with only simple_protection mod as protection... The mod had the same symptoms on standalone v6, v7 mapgens with only simple_protection loaded... Am using Lubuntu 14.04 32-bit (that shouldn't be an issue)... Will try to nap some screenshots next time I had a blank world loaded with mod enabled and left for some time to gather doors...
 

User avatar
balthazariv
Member
 
Posts: 214
Joined: Mon Apr 07, 2014 15:48

Re: [Mod] Simple protection [simple_protection]

by balthazariv » Sun Aug 17, 2014 07:24

Hello Krock,

I report a bug in Simple Shooter and [Mod] Tunnel Boring Machine [0.4 beta] [tbm]
I have a minetest crash with only Simple protection and Simple shooter when i use "Flare Gun" in Simple shooter mod
I have a minetest crash with only Simple protection and TBM when it start.
And nothing in debug.txt. Separately it works
If you want to test.

Thanks
 

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

Re: [Mod] Simple protection [simple_protection]

by Krock » Sat Dec 20, 2014 15:21

Recent changes



Added global shared claims
It's now possible to share all areas with a player. The player also will have access to areas which were claimed after saying that command.


Added a force-claim setting
With the setting
Code: Select all
simple_protection.claim_to_dig = true

It is possible now to force players to claim an area before they can dig anything.
Warning! The player won't be able to dig trees or anything other to craft a claim stick. It is required to give them a claim stick when they join or when they ask for one.
The only exception is under the maximal claim depth (if enabled)
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

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

Re: [Mod] Simple protection [simple_protection]

by Krock » Sun Aug 07, 2016 07:41

Recent changes


Rename table simple_protection -> s_protect
- Renamed the mod-internal table name to 's_protect' to follow the naming of the configuration files
- Corrected the spelling error in the settings: 'claim_heigh' -> 'claim_height'
- Increased the default area size to the landrush default: 16x16 (Y-axis still 80 nodes)
- Fully backwards compatible with already existing world settings

Localize the hud table and tidy up the chat commands
- Small corrections to make the code look better
- Fixed a bug caused by the commit mentioned above

Found a bug? Report it instead of keeping, they're not worthful at all.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

Byakuren
Member
 
Posts: 777
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Simple protection [simple_protection]

by Byakuren » Mon Aug 08, 2016 00:06

Why not change your mod name to match the table name too? This is the convention and prevents globals collisions.
Every time a mod API is left undocumented, a koala dies.
 

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

Re: [Mod] Simple protection [simple_protection]

by Krock » Tue Aug 09, 2016 07:26

Byakuren wrote:Why not change your mod name to match the table name too? This is the convention and prevents globals collisions.

That's a good point but this would require a manual change in the world config when someone wants to update it. Also the Github link would become invalid and requires a new configuration too - thus it's better to keep the mod name this way.

I'm not worried about the globals collisions - using two protection mods on a server is not recommended anyway. If there somewhen appear such issues (when we have a thousand mods more) then it's best to create an issue for that, so it can be resolved quickly.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

Byakuren
Member
 
Posts: 777
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Simple protection [simple_protection]

by Byakuren » Tue Aug 09, 2016 08:50

You could also have deprecated the use of s_protect config files and used simple_protection ones.
Every time a mod API is left undocumented, a koala dies.
 

miloszs
Member
 
Posts: 184
Joined: Thu Jul 07, 2016 21:20
Location: Poland
GitHub: miloszs
IRC: miloszs mmmm
In-game: miloszs mmmm
 

User avatar
AccidentallyRhine
Member
 
Posts: 226
Joined: Sun Aug 02, 2015 05:43

Re: [Mod] Simple protection [simple_protection]

by AccidentallyRhine » Sun Aug 21, 2016 02:53

Using the command "/area show" crashes with:

Code: Select all
 Runtime error in callback on_chat_message():
~/init.lua:28: invalid replacement value (a table)
stack traceback:
[C]: in function 'gettext'
~/init.lua:28: in function 'SR'
~/init.lua:102: in function 'func'
...


I'll try my hand at figuring it out, if not I will just disable area show since it is non-critical to gameplay.
 

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

Re: [Mod] Simple protection [simple_protection]

by Krock » Sun Aug 21, 2016 11:21

AnxiousInfusion wrote:Using the command "/area show" crashes with:

<snip>

Thanks for the bug report. I wonder why I haven't got this error while testing.
Commit: Fix error in function gettext_replace
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
BirgitLachner
Member
 
Posts: 356
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] Simple protection [simple_protection]

by BirgitLachner » Wed Oct 26, 2016 05:51

Can the user claim as many areas as he wants? Would be nice, if I can restrict it as admin ... lets say to 5 areas per player.

You said that by default, there's no punishment for griefers. So, who is able to enable this? Only the admin in the config-file or every player for his own area?

Thanks.
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: Skamiz Kazzarch and 8 guests