Giter VIP home page Giter VIP logo

simple_protection's Introduction

simple_protection

A Minetest area protection mod, based on a fixed claim grid, like seen in landrush.

You can claim areas by punching those with a claim stick.

Screenshot

License: CC0

Dependencies

  • Minetest 5.0.0+
  • default: Crafting recipes

Optional dependencies

  • areas: HUD compatibility

Features

  • Easy, single-click protection
  • Fixed claim grid: 16x150x16 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 command(s)

/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

simple_protection's People

Contributors

antumdeluge avatar brunomine avatar d-stephane avatar smalljoker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple_protection's Issues

s_protect.claim_to_dig = true -> server crash

Hi,

I have a problem : the server crashes if i put a block out of the protected area.
My server version : 0.4.15

My config :

s_protect.claim_size = 16
s_protect.claim_height = 80
s_protect.start_underground = 20
s_protect.underground_claim = false
s_protect.underground_limit = -300
s_protect.claim_return = true
s_protect.claim_to_dig = true
s_protect.area_list = true
s_protect.max_claims = 100

I just changed the setting : s_protect.claim_to_dig

Log :

2017-07-03 01:27:01: ERROR[Main]: ServerError: Lua: Runtime error from mod 'default' in callback item_OnPlace(): ...test-0.4.15/bin/../mods/simple_protection/protection.lua:33: attempt to index local 'data' (a nil value)
2017-07-03 01:27:01: ERROR[Main]: stack traceback:
2017-07-03 01:27:01: ERROR[Main]: ...test-0.4.15/bin/../mods/simple_protection/protection.lua:33: in function <...test-0.4.15/bin/../mods/simple_protection/protection.lua:17>

Use sqlite storage

Pros:

  • Faster access
  • Clear data separation (not squashed into a line of text)
  • Optimized disk writing
  • Higher data safety on crash
  • Deprecates line-read-and-split methods

Cons:

  • Yet requires an exception in the mod security to load lsqlite3
  • Inaccuracy of doubles when selecting a certain index
  • Inefficient when indexing by string

Internationalization

This mod seems to be very useful for almost all servers. I am willing to translate it to portuguese (my native language). Must be compatible with Intllib

A bit confusing

I hosted a local server and joined with two players from the same computer, the frist one named singleplayer1 (hoster), the second one named singleplayer2.

I protected an area with singleplayer1, but singleplayer2 can dig and places nodes there and this player has only shout and interact as privilegs.

Maximum number of claims

Being able to set a maximum number of claims per player will be immensely helpful agains hoarding. It could be called s_protect.max_claims.

List of mods that have player grouping features

I'm currently thinking of adding an API to register groups support. If two players share the same group, the can access each other's areas.

Potential mods to provide support:

For example: /area shareall #classroom. is_protected would then run a callback to check whether another player may access this area.

API Documentation

The core functions should (finally) be documented properly.

TODO:

  • s_protect.share
  • s_protect.load_shareall()
  • Somehow remove the table_* functions or get them outside the global namespace

/area shareall command not working as intended

when using /area shareall with more than one person, only the last person has acces to the area. i.e. player one uses share all to grant access to Player 2, Player 2 can now dig everywhere. Player one then subsequently ises share all to grant access to player 3. Player 3 can now dig normally and player 2 cannot.

this behavior only happens with share all. this does not happen when using the share command on individual lots.

Support parallel running protection mods

The support for them is very poor right now and should be extended to allow server admins to use multiple protection mods for different area sizes or features.

This is a note to myself for the future development but PRs are always welcome ;)

Improve Area HUD to show unclaimed areas

Just an issue so we can if need be further discuss how/what this needs to be done

Currently we only show a HUD when we are in a claimed area, if we wanted a (tri-color) colored HUD then we'd want to show:

  • claimed (with access)
  • claimed (with no access)
  • unclaimed

I'm thinking Green when it's claimed and you have access (maybe a brighter green if it's one of your own claims you actually claimed),
Red for claimed by you don't have access, and Grey or White for unclaimed. (thus I'm calling it a tri-colored HUD)

/area unclaim

I have all privs on my server including "simple_protection, but i still can't unclaim area's owned by others. I get the "Do not try to modify" msg.

I suspect it may be permissions on the protection.data file on my server.

Formspec GUI

Would you consider adding a sfinv tab with a formspec that allows players to manage what now is only available through the command line?

Shared chests

Chests with access, depending on the area where they were placed.
Already seen in: landrush, default (furnace), chesttools, ...??

Reminder for myself or for potential contributors.

[Q]: How do we handle Spawn?

Perhaps we'd want to add a admin only claim item which claims it as only admin / anyone with server priv has access.

bug in the translation

I am getting several errors in the translated strings, I do not understand. Because you used $ unlike using @n.

bug_translation
bug_translation2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.