Something like secret metadata?

User avatar
Hume2
Member
 
Posts: 437
Joined: Tue Jun 19, 2018 08:24
Location: Czech Republic
GitHub: Hume2
In-game: Hume2

Something like secret metadata?

by Hume2 » Sat Feb 01, 2020 18:56

There is one bug with mailboxes: The content can be read by any player who gets close, not only the owner. The problem is that the content of mailboxes is stored in its metadata which is sent to all players. It can't be usually read by the client but some kind of hacked clients can provide this functionality. Or you can turn on local map saving and then read the metadata by other means.

Of course, this can be solved easily. The content of mailbox can be saved to a separate file which would be read only when there is a serious attempt to open the mailbox. However, I think, it would be nice if such functionality was provided by Minetest engine. There could be something like secret metadata. The server would know the value but the clients would always receive a nil value instead. What do you think?
If you lack the reality, go on a trip or find a job.
 

User avatar
Krock
Developer
 
Posts: 4469
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Something like secret metadata?

by Krock » Sat Feb 01, 2020 19:17

Code: Select all
meta:mark_as_private({"key1", "key2", ...})


https://github.com/minetest/minetest/bl ... .txt#L5607
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

micheal65536
Member
 
Posts: 158
Joined: Mon May 22, 2017 20:27

Re: Something like secret metadata?

by micheal65536 » Sat Feb 01, 2020 22:22

Krock wrote:
Code: Select all
meta:mark_as_private({"key1", "key2", ...})


https://github.com/minetest/minetest/bl ... .txt#L5607

Never link to a specific line from the master branch (or any branch) of a repository. Always link to a specific version (commit or release tag) of a file, otherwise the link might break (link to the wrong line) when the file is modified (in your case a whole 14 minutes after your post, which might be a world record).

The correct link is https://github.com/minetest/minetest/blob/ea5e231959365622607c8bfd953f6d96ec54a394/doc/lua_api.txt#L5607

Also I think the OP wants to have private node inventories rather than private metadata fields which does not appear to be possible according to the documentation.
 

User avatar
Krock
Developer
 
Posts: 4469
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Something like secret metadata?

by Krock » Sun Feb 02, 2020 13:15

micheal65536 wrote:Also I think the OP wants to have private node inventories rather than private metadata fields which does not appear to be possible according to the documentation.


Workaround:
Code: Select all
local tmp_inv = minetest.create_detached_inventory("mymod:node_" .. minetest.pos_to_string(pos), {
   callbacks ...
}, "") -- Empty player name cannot exist (sent to no player)

-- Save: Save each stack to the node metadata (1 stack as an example)
nodemeta:set_string("inv", stack:to_string())

-- Load: Load each stack from the node metadata
local stack = ItemStack(nodemeta:get_string("inv"))


https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L4735-L4736

EDIT: https://github.com/minetest/minetest/blob/4eb3baa51ed95/doc/lua_api.txt#L4735-L4736
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
Hume2
Member
 
Posts: 437
Joined: Tue Jun 19, 2018 08:24
Location: Czech Republic
GitHub: Hume2
In-game: Hume2

Re: Something like secret metadata?

by Hume2 » Sun Feb 02, 2020 21:13

So it already exists, great!
If you lack the reality, go on a trip or find a job.
 

User avatar
sorcerykid
Member
 
Posts: 1168
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: Something like secret metadata?

by sorcerykid » Mon Feb 10, 2020 04:23

This issue was actually brought to my attention last year by one of my more vigilant players. He forewarned me that it was possible to read confidential books that other players had stored in their locked chests.

So I ended up developing a mod that offers block-chain encryption of metadata for itemstacks (in particular books), in addition to encrypted node inventories with pass-code access via a new "Digital Safe" node. The safe is particularly suited for players that want the extra peace of mind that nobody -- not even moderators with protection_bypass privilege -- can snoop through their personal belongings.

I put together a quick demonstration video that shows how the safe works.

https://vimeo.com/390402640
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 1 guest