So, players in my game are losing data due to them server hopping back and forth between servers.
I have a while loop for each player that saves their data every 120 seconds.
The data also saves when the player leaves the game, and saves when they purchase something.
But, when they go to an older server they were in before, their Data is outdated and the new data gets overwritten.
How can I fix this?
Keep in mind that to save data I am using UpdateAsync, I rarely use SetAsync to save Data
Is the new data saved and then overridden after hopping onto another server? if so then
You could try storing a age value that keeps the age of the data, the age goes up by 1 everytime you save and you never save any data with a lower age value then the current age
Edit: re-read what you wrote, is the data not being nullified when the player leaves? you dont want to save the data on the old server over the new data
It saves the data when they leave, so on the new server it loads it perfectly and saves fine, but when they return to the original server, the old data somehow appears instead of the new data. What could cause this?