minetest_game/mods
Auke Kok e4b1c93512 Keys: Allow easy sharing of access without commands
This code adds the key concept to minetest_game, and integrates it
with lockable nodes. Currently supported lockable items are the Steel
Door, the Steel Trapdoor, and the Locked Chest.

The goal of this modification is to introduce a fine-grained multi-
player permission system that is intuitive and usable without any
console or chat commands, and doesn't require extra privileges to
be granted or setup. Keys can also physically be conveyed to other
players, adding to gameplay and adding some personality that is
preferable to console commands or editing formspecs.

A skeleton key can be crafted with 1 gold ingot. Skeleton keys can
then be matched to a lockable node by right-clicking the skeleton
key on a lockable node, which changes the skeleton key to a "key".

Gold was chosen as it's currently a not-so very useful item, and
therefore it's likely that players have some, but aren't really
using it for any purpose.

This key can subsequently used by any player to open or access that
lockable node, including retrieving items from Locked Chests, or
putting items in them.

They key is programmed to fit only the particular locked node it is
programmed to. This is achieved by storing a secret value in both
key and locked node. If this secret value doesn't match, the key
will not open the locked node. This allows many keys to be created
for one chest or door, but a key will only fit one node ever. The
secrets are stored in node, and item meta for the key.

If a locked node is removed, all keys that opened it are no longer
valid. Even if a new door/chest is placed in exactly the same spot,
the old keys will no longer fit that node.

Keys can be smelted back in gold ingots if they are no longer useful.

The method of storing a secret in nodemeta and itemstackmeta is secure
as there is no way for the client to create new items on the server
with a particular secret metadata value. Even if you could possible
create such an itemstack on the client, the server does not ever read
itemstackmeta from a client package.

The patch adds an API that allows other nodes and nodes added by
mods to use the same keys as well. The method how to implement this
is described in game_api.txt. The mod should add 2 callbacks to it's
node definition. Example code is given.

Textures are from PixelBOX, thanks to Gambit.
2016-11-25 03:01:14 +00:00
..
beds Update 'nodeupdate()' to 'check_for_falling()' API 2016-11-22 05:55:36 +00:00
boats Boats: Use player yaw on place, align player yaw with boat on enter 2016-11-19 23:44:27 +00:00
bones Bones: Search for nearby 'air' for fallback bones placement 2016-09-10 05:19:15 +01:00
bucket Bucket: Allow buckets to trigger the on_punch of entities and nodes 2016-11-02 12:39:56 +00:00
carts Carts: Merge boost_cart as "carts" mod 2016-11-21 03:15:04 +00:00
creative Creative: Fix missing item bug caused by 'start_i' value 2016-11-18 05:38:25 +00:00
default Keys: Allow easy sharing of access without commands 2016-11-25 03:01:14 +00:00
doors Keys: Allow easy sharing of access without commands 2016-11-25 03:01:14 +00:00
dye Change WTFPL to MIT (part 3) 2016-09-07 04:44:53 +01:00
farming Farming: Add forgotten colon 2016-11-21 03:19:47 +00:00
fire Update 'nodeupdate()' to 'check_for_falling()' API 2016-11-22 05:55:36 +00:00
flowers Textures: Revert many back to RGBA to fix visual bug 2016-11-19 23:45:08 +00:00
give_initial_stuff Change WTFPL to MIT (part 3) 2016-09-07 04:44:53 +01:00
nyancat Nyancat: Make nyancat and rainbow light sources 2016-11-10 08:10:41 +00:00
screwdriver Change WTFPL to MIT (part 3) 2016-09-07 04:44:53 +01:00
sethome Fix whitespace errors to silence luacheck. 2016-11-19 19:39:51 -08:00
stairs Add and edit fuel registrations 2016-11-02 13:04:25 +00:00
tnt Update 'nodeupdate()' to 'check_for_falling()' API 2016-11-22 05:55:36 +00:00
vessels Do not show item overlay if slot is occupied by item (bookshelf, vessels shelf) 2016-11-14 20:03:49 +01:00
walls Licenses: (Part 4) Remove overlooked WTFPL text. Cleanup 2016-09-08 06:17:05 +01:00
wool Change WTFPL to MIT (part 3) 2016-09-07 04:44:53 +01:00
xpanes Textures: Revert many back to RGBA to fix visual bug 2016-11-19 23:45:08 +00:00