[Mod] Simple protection [simple_protection]

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

[Mod] Simple protection [simple_protection]

by Krock » Post

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
Last edited by Krock on Sun Dec 08, 2019 18:03, edited 8 times in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

by TenPlus1 » Post

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: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

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.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

by TenPlus1 » Post

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: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

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
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

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: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

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.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

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
In-game: Achilles
Location: Excuse Me???? -_-

by Achilles » Post

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
In-game: Achilles
Location: Excuse Me???? -_-

by Achilles » Post

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: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Simple protection [simple_protection]

by TenPlus1 » Post

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: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Simple protection [simple_protection]

by Krock » Post

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"?
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Simple protection [simple_protection]

by TenPlus1 » Post

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: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Simple protection [simple_protection]

by Krock » Post

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.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Simple protection [simple_protection]

by TenPlus1 » Post

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
Contact:

Re: [Mod] Simple protection [simple_protection]

by balthazariv » Post

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: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Simple protection [simple_protection]

by Krock » Post

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)
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: [Mod] Simple protection [simple_protection]

by Krock » Post

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.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: [Mod] Simple protection [simple_protection]

by Byakuren » Post

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: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Simple protection [simple_protection]

by Krock » Post

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.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: [Mod] Simple protection [simple_protection]

by Byakuren » Post

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
GitHub: miloszs
IRC: miloszs mmmm
In-game: miloszs mmmm
Location: Poland

Re: [Mod] Simple protection [simple_protection]

by miloszs » Post

very nice mod

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

Re: [Mod] Simple protection [simple_protection]

by AccidentallyRhine » Post

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: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Simple protection [simple_protection]

by Krock » Post

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
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: [Mod] Simple protection [simple_protection]

by BirgitLachner » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests