Closed Bozcx closed 2 months ago
@anthonysharpy I have noticed your sqlite-like storage layer previously before your issue.
We would be interested in your contribution to implementing your solution for dxura/darkrp which is based of HC1/Nicked.
While the previous version had a pseudo json system, this version has no persistence yet.
There's a few requirements
Additionally it would be nice if it was somewhat encrypted, at least so it's more effort than it's worth to manipulate. This is not required.
The basic data we want persisted at the moment would be the player balance, then maybe roles/playtime later on.
Let me know if you're interested in working on this, should be straight forward I believe.
@dimmerly Thanks for the reply!
For now, we want each user to store their own data, but in future we want a dedicated server holding this information - there must be a clear way to switch in future.
Sounds doable. My library supports saving on the client and server. Saving on the client is disabled by default but this can be enabled with a boolean in the config file.
Additionally it would be nice if it was somewhat encrypted, at least so it's more effort than it's worth to manipulate. This is not required.
Yeah, there's no way to make it 100% uneditable if it's being stored on the client. But I can obfuscate it as you suggest such that 99% people won't bother trying. I probably wouldn't do this for the initial implementation, but would probably add it as a new feature to the library soon after, and then you can enable it when it suits you.
The persistence has to be implemented in a way that it depends on an interface rather than directly on your package. Darkrp code -> Interface -> Your persistence package
I see where you are coming from with this. However some things to bear in mind:
Save()
method on the entity (e.g. the player), and this handles all the saving. This is not an interface, but it functions like one since if you ever wanted to use a different method of saving, you can just replace the code here. So by doing this it's sort of the same thing.But let me go and make an example implementation and then you can decide if it's too tightly coupled or not.
The basic data we want persisted at the moment would be the player balance, then maybe roles/playtime later on.
Easy peasy.
Just implemented the obfuscation thing :-)
Will try and get a PR ready
Seems this is merged so feel free to close
If you have any questions feel free to let me know, or you can raise an issue on my repo 😄
The Following is a Issue from the Original DarkRP Github Repo. https://github.com/sousou63/DarkRP/issues/186
Using this would be much more beneficial in the long run then simply relying on a homemade solution or simply using .json files.