[Mod] Simple protection [simple_protection]

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

[Mod] Simple protection [simple_protection]

by Krock » Sat Apr 12, 2014 12:18

Simple protection

Image

This mod adds land claims to your world.
It is based on ideas of the LandRush mod and splits the world into claim-cuboids.
Every cuboid is 16x80x16 nodes big (can be changed in the config) and allows sharing access with other players.

To get an area, you need 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.

Chat commands:
/area show -> Shows up the information about the current area
/area share <name> -> Shares the current area with <name>
/area unshare <name> -> Unshares the current area with <name>
/area shareall <name> -> Shares all your areas with <name>
/area unshareall <name> -> Unshares all your areas with <name>
/area unclaim -> Unclaims the current area

About /area show:
Area status: Not claimable -> By default, it's not possible to claim areas in the underground
Players with access: foo, bar*, leprechaun, *all
^ foo, leprechaun: A regular /area share, only for this area
^ bar*: All areas with this owner are shared with that player
^ *all: Everybody can build and dig in the area

Possible modifications per world: (see settings.conf)
Claim size/heigh
Starting position of claims
Limitations of claims in the underground
Giving back claim sticks when /area unclaim is used

Other things to know:
simple_protection privilege: Allows to modify and delete every area
Area owner HUD: Green = you can modify it, otherwise it is white
init.lua: Add your own punishments when players try to grief an area

Depends: default
License: WTFPL
Links: Download *.zip, View source
Last edited by Krock on Sat Jan 07, 2017 09:25, edited 6 times in total.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 1874
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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 1874
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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
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
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

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: 246
Joined: Sun Dec 15, 2013 11:55
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: 246
Joined: Sun Dec 15, 2013 11:55
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: 1874
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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
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"?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 1874
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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 1874
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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
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
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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)
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

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: 166
Joined: Thu Jul 07, 2016 21:20
GitHub: miloszs
IRC: miloszs mmmm
In-game: miloszs mmmm

Re: [Mod] Simple protection [simple_protection]

by miloszs » Wed Aug 17, 2016 10:05

very nice mod
 

User avatar
AnxiousInfusion
Member
 
Posts: 146
Joined: Sun Aug 02, 2015 05:43
GitHub: AnxiousInfusion[GitLab]
IRC: AnxiousInfusion
In-game: AnxiousInfusion

Re: [Mod] Simple protection [simple_protection]

by AnxiousInfusion » Sun Aug 21, 2016 02:53

Using the command "/area show" crashes with:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
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
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

BirgitLachner
Member
 
Posts: 135
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.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Simple protection [simple_protection]

by Krock » Wed Oct 26, 2016 17:55

BirgitLachner wrote: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.

Currently there's no way to limit this - The players can claim as many areas they want. But each area costs again some materials, so remember that they will not get protected space for free.
Usually it's enough to call "/area unclaim" to free an area that is not used for a long time.

BirgitLachner wrote:So, who is able to enable this? Only the admin in the config-file or every player for his own area?

Uncomment the two lines in init.lua#L37-L38 to take one HP from the player each time he tries to dig into a protected area. The area owners can not change this behaviour individually - it is handled the same way for all areas. Feel free to change the damage value of 1 to smoething higher if necessary.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
AnxiousInfusion
Member
 
Posts: 146
Joined: Sun Aug 02, 2015 05:43
GitHub: AnxiousInfusion[GitLab]
IRC: AnxiousInfusion
In-game: AnxiousInfusion

Re: [Mod] Simple protection [simple_protection]

by AnxiousInfusion » Tue Nov 01, 2016 00:50

Krock wrote:Uncomment the two lines in init.lua#L37-L38 to take one HP from the player each time he tries to dig into a protected area. The area owners can not change this behaviour individually - it is handled the same way for all areas. Feel free to change the damage value of 1 to smoething higher if necessary.


Nice! I can't believe I overlooked this. Now players will be discouraged from "phasing" through walls. I've had a breaking and entering problem on my server for some time now.

I still have one practical issue with simple protection and the answer is probably buried somewhere but: How can an admin clear a claimed area that belongs to a normal user?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Simple protection [simple_protection]

by Krock » Tue Nov 01, 2016 18:49

AnxiousInfusion wrote:How can an admin clear a claimed area that belongs to a normal user?

Simply walk into the area and use the command "/area unclaim". It will unclaim the current area either when you're the owner or when you've got the "simple_protection" privilege. Code reference
I've also opened an issue to add the parameter "all", to unclaim all areas at once. Will add it ASAP.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
AnxiousInfusion
Member
 
Posts: 146
Joined: Sun Aug 02, 2015 05:43
GitHub: AnxiousInfusion[GitLab]
IRC: AnxiousInfusion
In-game: AnxiousInfusion

Re: [Mod] Simple protection [simple_protection]

by AnxiousInfusion » Tue Nov 01, 2016 19:03

Thanks for the link, it helped me figure out the problem.

So I don't know if I grabbed an outdated build or if I accidentally hit a key while tinkering but a stray "s" found its way behind the local "priv" variable in line 231. Deleted it and all is working now.
 

Fixerol
Member
 
Posts: 633
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer

Re: [Mod] Simple protection [simple_protection]

by Fixerol » Tue Nov 08, 2016 23:38

I like simplicity of the mod :)
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 10 guests

cron