player-specific key value store #3722
Labels
No Label
1. kind/balancing
1. kind/breaking
1. kind/bug
1. kind/construction
1. kind/documentation
1. kind/enhancement
1. kind/griefing
1. kind/invalid
1. kind/meme
1. kind/node limit
1. kind/other
1. kind/protocol
2. prio/controversial
2. prio/critical
2. prio/elevated
2. prio/good first issue
2. prio/interesting
2. prio/low
3. source/art
3. source/client
3. source/engine
3. source/ingame
3. source/integration
3. source/lag
3. source/license
3. source/mod upstream
3. source/unknown
3. source/website
4. step/approved
4. step/at work
4. step/blocked
4. step/discussion
4. step/help wanted
4. step/needs confirmation
4. step/partially fixed
4. step/question
4. step/ready to deploy
4. step/ready to QA test
4. step/want approval
5. result/cannot reproduce
5. result/duplicate
5. result/fixed
5. result/maybe
5. result/wontfix
ugh/petz
ugh/QA main
ugh/QA NOK
ugh/QA OK
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: your-land/bugtracker#3722
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We need one (or more than one) key-value stores per player to go around the shortcomings of Minetest.
What's the purpose?
Why can't we use player meta?
Because player meta cannot be accessed when the player is offline.
Why can't we use modstorage then?
Because the only efficient way to save modstorage is in a sqlite database, which is not accessible from the outside while the server is up. To read or write sqlite while the server is down, we need an sqlite reader, instead of a simple texteditor.
Storing playerspecific values in modstorage also creates a huge amount of dead entries, see the party mod (which stores each and everyone who ever created an account in a huge file, of which only very few entries are actually needed)
modstorage isone of my least favourite minetest-isms, I'd rather only use it for very simple mod-specific values, not values tied to blocks or players.
Is there an example that already does it?
Yes, the mail mod stores one file per player and yl_speak_up stores one file per NPC
This issue is meant to discuss our options.
So far, my preferred method is to have one JSON file per player per mod and only load that JSON file when necessary. I chose JSON because it can be easily migrated should we feel the need to leave MT behind and edited should something go wrong.
We could ask the core devs to pick up
https://github.com/minetest/minetest/pull/9177
or
https://github.com/minetest/minetest/pull/9164
again.
We could pull in a way to access postgresql from the mod sandbox. This would create a way to not only acces playermeta, but also privs and invs and everything, even blocksdata. That's at least a double edged sword IMO.
Not sure but I thought postgresql is now supported for all backends which should solve a couple things.
That is just bad design decision from the party mod just like personal_log creating one entry per saved location, but JSON wouldn´t solve that they would just create unnecessary files.
you can absolutely have read-only access to the sqlite database while the server is up, and that restriction applies to json files as well. if you edit them while the server is running, the changes will probably get clobbered.
that's a fair point. i suppose i shouldn't assume that everyone is fluent in SQL :)
i'm not sure how storing the values in json files would be any better?
the number of players we've currently got is over 69000. while file systems can handle that number of files in a directory, you better not try to use "ls" or such.
at the end of the day, though, if we write the API well, we can switch out the backend for something else if it creates performance problems.
i started work on an API for allowing access to a postgres database w/out having to explicitly request an insecure environment, but i did not mean for it to be a way to modify the values of engine-controlled data while the server is running. since the server caches most or all of those things and assumes nothing else is touching them, modifications are likely to be clobbered. (aside: i've successfully modified the inventories of players who were not logged in while blocky survival was running, via command-line scripts).
i'm not sure why postgres would be better than sqlite (still can't edit the data w/ vim/emacs/nano/whatever), but i could finish up that mod if we're interested.
postgres has the advantage that it isn´t restricted to read only while the server is running.
basic SQL isn´t that hard and minetest´s database scheme isn´t that complicated which doesn´t make it really harder than spreadsheet editing.
Also if you are that far down the rabbit hole that you have to edit those entries I think its fair to assume that you can install and start the necessary tools 😉
And for JSON I would still prefer a good editor than any simple texteditor, just to easy to introduce typos or somehow mess up syntax.