This is much much more than "is_protected". This is more like ACL (Access Control List). Think factions and areas combined, but with refined permissions.
So this is something I've been thinking about for a while. I want more than just "is_protected". I want to know if the user is allowed to pull from inventory, allowed to dig, allowed to place, etc. I want separate permissions for each of these. I hope that this can eventually adopted by MTG and maybe even partially implemented in the client engine.
Goals:
Be more flexible than any other protection mods so far
Be efficient and scalable (able to use on servers with many users with minimal lag)
Be easy to use for n00bs
Contain advanced functionality for server admins
Rules have a priority property so if multiple rules match, priority can be used to determine allow-ability
Features:
Create groups and add users to them
Add any types of permissions. Some of the defaults will be dig, take_from, insert, place, interact, live, breathe, fly, noclip, teleport, PvP
Use plain text or SQLite as a backend
Use plain LUA or SQLite to perform queries (I don't currently know which of these would be faster but both will be available in the future
Possibilities:
Take my Blink mod as an example. It could add a Blink permission. It could then use crulz to check if Blink is allowed at the current pos.
Another application is spawn areas. Let's say you want people to be able to PvP or open chests at spawn but not dig or place blocks. Simply create a rule for that area.
Define areas where players can fly or are not allowed to breathe. Define an area that players are not allowed to live and will instantly die . The individual mod will have to decide what to do with the player but crulz will quickly provide whether the user is allowed the given permission in the given area
Q/A:
How will this be easy for n00bs to use?
A default included rule will mimic "is_protected" and users will be able to use an item to mark the boundaries of his/her area and protect it. This will not quite as easy to use as protector blocks but will be easier to use than areas and should offer extensibility beyond any current protection mods
How hard will it be to convert from current mods to crulz?
I will include methods to convert existing popular mods to crulz using the default built-in rule
The recommended process will be something akin to the following
- Backup world
- Use built-in command to copy <mod> settings to crulz
- Shutdown server, remove <mod> and reboot
minetest.is_protected will still be usable for backward compatibility and will use the default rule to mimic its behavior. Mods will also be able to use crulz.is_allowed(pos, playername, permission) where permission is something like "dig" or "place" or "pvp".
ETA?
Weeks from now? Months for a final release? I have some very basics built but not even a proof-of-concept ready yet. I'll keep this post updated as I continue my work