Solved SKRIPT-YAML BUG?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

TheCubPlays

Member
Jun 22, 2021
42
3
8
23
Hello, so the last month or so I've been remaking my skripts using skript-yaml because I find out that it's a very good way to store player data without having any serious lag issues with many variables. However I've been dealing with a very weird issue, the yaml files of each player just randomly have rollbacks and the only way that I managed to fix this was by making it so that it saves their yaml data every 3 seconds. As you can probably tell this is not very good for performance and I was wondering if there is an explaination to this issue and a solution?

Just to make this more clear I'll give you an example of the issue, say that someone joins the server for the first time. It'll create a file for their yaml data and then it will set their "tokens" value to 0. It'll save the data in that file of the player whenever they leave. So if they get their tokens to 100 and then it saves it after they leave, when they come back it'll still be 100. However sometimes all of the player's file values roll back to the last-saved values meaning that if the player gets their tokens value to 250 and then that happends, it'll set it back to 100. Now if I make it save their data every 3 seconds even when the rollback happends it can be a 3 second rollback max since the last saved value was from 3 seconds ago, I suppose that this is not very good for performance though. I think that I made the issue clear, if so does anyone know what the cause of this issue could be?

Skript version: 2.5.3 (Used to happen on 2.6 as well)
Server version: 1.16.5 (Used to happen on 1.17 as well)
Skript yaml version: 1.4
[doublepost=1636377836,1636218394][/doublepost]Nevermind, it was my fault. Just don't make it load their yaml data if they're already loaded, it'll forget the new data.
 
Status
Not open for further replies.