Jump to content

Best practice for storing character data in JSON


Geo

Recommended Posts

Hello guys, I've a concern I think you'd be able to clarify.

In the gamemode I'm scripting, I created an user register system. Within this system users can create characters, now, the thing is, because there's a ton of data I wanted character tables to store, I decided the best course of action would be saving all this character data locally instead of MySQL, here's where my problem comes in.

Is it a bad practice to store all the character data in a single JSON file? This certainly feels dangerous to me.
On the other hand, I could create a JSON file for each character created, but, wouldn't coding a script so it finds X file in a bunch of files and retrieves its data be slow?

Please help!

Edited by Geo
Link to comment
  • Scripting Moderators
7 hours ago, Geo said:

I decided the best course of action would be saving all this character data locally instead of MySQL, here's where my problem comes in.

What if user will delete cache? Or will manipulate it on other way?

Do not be afraid to use SQLite/MySQL. If you have lot of data, you can store it in one column as a JSON string aswell.

  • Thanks 1
Link to comment
3 hours ago, majqq said:

What if user will delete cache? Or will manipulate it on other way?

Do not be afraid to use SQLite/MySQL. If you have lot of data, you can store it in one column as a JSON string aswell.

Storing data in MySQL as a JSON string... I didn't thought of that, thank you so much!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...