Page 1 of 3

[Mod] Simple protection [simple_protection]

Posted: Sat Apr 12, 2014 12:18
by Krock

Simple protection

... is a fixed-grid protection mod based on ideas of the LandRush mod. Protect one of the "cells" by tapping the ground using a claim stick ("simple_protection:claim", see preview images).
Spoiler
/area show
Image
/area radar
Image
Claim Stick recipe
Image
Default claim size: 16m * 80m * 16m nodes

Features
  • Easy single-click protection
  • Share individual claims with someone
  • Share all your claims with someone
  • Share individual claims with everyone (public access)
  • "simple_protection" privilege for admins to manage areas
  • Minimap-like radar to explore nearby claims
  • Claim border highlighting as seen in protector
  • Shared Chest to exchange items
  • Client-side translation support
See also: README.md
Customization: See "default_settings.lua" and "doc/mod_api.txt"

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)
"/area show" output explanation
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 License: CC0
Links: .git clone link, Source code, *.zip

Posted: Sat Apr 12, 2014 20:09
by TenPlus1
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 ?

Posted: Sun Apr 13, 2014 06:59
by Krock
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.

Posted: Sun Apr 13, 2014 08:25
by TenPlus1
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...

Posted: Sun Apr 13, 2014 08:27
by Krock
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

Posted: Sun Apr 13, 2014 19:45
by Sokomine
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.

Posted: Sun Apr 13, 2014 19:59
by Krock
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.

Posted: Sun Apr 13, 2014 20:25
by Sokomine
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 :-)

Posted: Mon Apr 14, 2014 17:49
by Achilles
Nice mod

Posted: Mon Apr 14, 2014 18:11
by Achilles
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.

Re: [Mod] Simple protection [simple_protection]

Posted: Sun May 11, 2014 14:00
by TenPlus1
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 ???

Re: [Mod] Simple protection [simple_protection]

Posted: Sun May 11, 2014 18:29
by Krock
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"?

Re: [Mod] Simple protection [simple_protection]

Posted: Mon May 12, 2014 07:20
by TenPlus1
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...

Re: [Mod] Simple protection [simple_protection]

Posted: Mon May 12, 2014 11:03
by Krock
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.

Re: [Mod] Simple protection [simple_protection]

Posted: Mon May 12, 2014 18:57
by TenPlus1
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...

Re: [Mod] Simple protection [simple_protection]

Posted: Sun Aug 17, 2014 07:24
by balthazariv
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

Re: [Mod] Simple protection [simple_protection]

Posted: Sat Dec 20, 2014 15:21
by Krock

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)

Re: [Mod] Simple protection [simple_protection]

Posted: Sun Aug 07, 2016 07:41
by Krock

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.

Re: [Mod] Simple protection [simple_protection]

Posted: Mon Aug 08, 2016 00:06
by Byakuren
Why not change your mod name to match the table name too? This is the convention and prevents globals collisions.

Re: [Mod] Simple protection [simple_protection]

Posted: Tue Aug 09, 2016 07:26
by Krock
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.

Re: [Mod] Simple protection [simple_protection]

Posted: Tue Aug 09, 2016 08:50
by Byakuren
You could also have deprecated the use of s_protect config files and used simple_protection ones.

Re: [Mod] Simple protection [simple_protection]

Posted: Wed Aug 17, 2016 10:05
by miloszs
very nice mod

Re: [Mod] Simple protection [simple_protection]

Posted: Sun Aug 21, 2016 02:53
by AccidentallyRhine
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.

Re: [Mod] Simple protection [simple_protection]

Posted: Sun Aug 21, 2016 11:21
by Krock
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

Re: [Mod] Simple protection [simple_protection]

Posted: Wed Oct 26, 2016 05:51
by BirgitLachner
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.