[Mod] Cuboid Rules (crulz) Yet another protection mod - but wait, there's more

Post Reply
0siribix
Member
Posts: 123
Joined: Tue Nov 17, 2020 20:54
GitHub: 0siribix
In-game: 0siribix

[Mod] Cuboid Rules (crulz) Yet another protection mod - but wait, there's more

by 0siribix » Post

Cuboid Rules (crulz)
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
  1. Backup world
  2. Use built-in command to copy <mod> settings to crulz
  3. Shutdown server, remove <mod> and reboot
How will mods convert to this vs using the built-in minetest.is_protected?
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
Last edited by 0siribix on Tue Aug 24, 2021 11:21, edited 1 time in total.

Mineminer
Member
Posts: 325
Joined: Mon Mar 05, 2018 04:05

Re: [MOD] Cuboid Rules (crulz) Yet another protection mod - but wait, there's more

by Mineminer » Post

0siribix wrote:
Mon Aug 23, 2021 00:22
Cuboid Rules (crulz)
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
  1. Backup world
  2. Use built-in command to copy <mod> settings to crulz
  3. Shutdown server, remove <mod> and reboot
How will mods convert to this vs using the built-in minetest.is_protected?
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
This seems like a wonderful "on paper" concepts and glad there's rough milestones set in place demotrasting this isn't a "random" forum post about a mod that ceases to exists.

But while I am very happy for being able to spawn protect PROPERLY for instance would this also be featuring PROGRESSIVE limiting?

For example can I dynamically allocate protection resources to players who may spend x amount of time on my server? And/or if they do so much on it or what not with configurable values and such?

Or I am gonna be left with two privs to allocate?

0siribix
Member
Posts: 123
Joined: Tue Nov 17, 2020 20:54
GitHub: 0siribix
In-game: 0siribix

Re: [MOD] Cuboid Rules (crulz) Yet another protection mod - but wait, there's more

by 0siribix » Post

Mineminer wrote:
Mon Aug 23, 2021 01:13
This seems like a wonderful "on paper" concepts and glad there's rough milestones set in place demotrasting this isn't a "random" forum post about a mod that ceases to exists.

But while I am very happy for being able to spawn protect PROPERLY for instance would this also be featuring PROGRESSIVE limiting?

For example can I dynamically allocate protection resources to players who may spend x amount of time on my server? And/or if they do so much on it or what not with configurable values and such?

Or I am gonna be left with two privs to allocate?
Cuboid Rules by itself will only be responsible for tracking which players or groups have any given permissions in a certain area. It would be up to a secondary mod to track things like online time etc and grant/revoke those permissions.
I'll add your idea to the list of possible ideas but I'm not sure at this moment if this would fit into the scope of what I want to do with this. Your idea is based on time where Cuboid Rules is based on location.

Mineminer
Member
Posts: 325
Joined: Mon Mar 05, 2018 04:05

Re: [MOD] Cuboid Rules (crulz) Yet another protection mod - but wait, there's more

by Mineminer » Post

0siribix wrote:
Mon Aug 23, 2021 02:36
Mineminer wrote:
Mon Aug 23, 2021 01:13
This seems like a wonderful "on paper" concepts and glad there's rough milestones set in place demotrasting this isn't a "random" forum post about a mod that ceases to exists.

But while I am very happy for being able to spawn protect PROPERLY for instance would this also be featuring PROGRESSIVE limiting?

For example can I dynamically allocate protection resources to players who may spend x amount of time on my server? And/or if they do so much on it or what not with configurable values and such?

Or I am gonna be left with two privs to allocate?
Cuboid Rules by itself will only be responsible for tracking which players or groups have any given permissions in a certain area. It would be up to a secondary mod to track things like online time etc and grant/revoke those permissions.
I'll add your idea to the list of possible ideas but I'm not sure at this moment if this would fit into the scope of what I want to do with this. Your idea is based on time where Cuboid Rules is based on location.
I mean even the Minecraft GriefPrevention Plugin and Mod have the baseline of allocating by time played and/or by working with any economy mod.

Thus I do not think it's "far fetch" to at least includes in the built in a basic mean of allocations. Other than hoping that players' will put in a request when they needs more.

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Cuboid Rules (crulz) Yet another protection mod - but wait, there's more

by orwell » Post

Nice work. Especially, the groups concept is a nice idea that I had wished to be done one day. Can group membership be queried via API?

This sounds similar to the approach of "tyrant" viewtopic.php?f=11&t=14776, except that I abandoned that one and it's not really flexible.

Please don't take tyrant as an example of good code - it is not. But maybe you can draw some inspiration from it.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests