Closed ghost closed 6 years ago
I think it doesn't make sense really. Permissions are also stored independently from the NBT data. I think player login data are such critical things that should persist even if you delete the worlds folder.
You can store it in a separated dat file even outside of world folder which mission is to store passwords in minecraft style (nbt).
Yes, but in databases you can build indices and search using different columns. This is necessarry, because FlexibleLogin searches using the UUID for login data and for optionally for admin commands like reset password using the player name. If we use file-based storage we have to visit every file.
You are wrong about nbt readers, its pretty fast a lot. You can read only neccessary information per query. Dat files can be locked per session. Minecraft worlds works the same way, youre not reading entire world chunks, only that is nesessary. It will be enough to put one dat file like your db file same directory if u want.
Yes, but still have to search through all data if you want to make a lookup using the player name or you implement database indices and all other features like caches and concurrent reads yourself.
Databases are great for saving the data in the same structure with a fixed amount of columns. I don't see the actual benefit on using NBT in comparison to SQL databases in this scenario (not raw data or key-value with different length). NBT might be useful if it's the only database storage option, but implementing it as an alternative to SQL complicates it a lot.
Can you add an option to save hash-password data not in the database, but in nbt file located in the world folder.