This isn't happening very often, but it's happening enough and to certain players continuously. I have things in my game called "pets" and they gain XP, health, etc. A player trains them and they get stronger. What is happening is a small amount of players are reporting that their "pets" are reverting to a past state. For example a players pet will reach level 40, they will play for maybe even a few hours, change rooms, etc, then the pets data will randomly revert to the data it had hours ago (for example level 32). I've even see if happen myself. The new data will show up in the admin panel for the table, and then seemingly at a random point, it will change back to an older state. It generally gets stuck reverting to the same certain state.
The main thing that's got me confused is that I put in some server code to prevent this from happening even in weird cases, but it's still not preventing it. Below is a small example:
- Code: Select all
PlayerIO.BigDB.Load("petData", _pet.Name, delegate(DatabaseObject _dbPet){
if (_dbPet != null && _pet.xp >= _dbPet.GetInt("xp")) {
_dbPet.Set("xp", _pet.xp);
_dbPet.Save();
}
});
You can see on the second line that I check to NEVER save a pet into the database if its XP is less than whats stored in the database. Nonetheless, it is still somehow reverting to that past version which contains less XP, so I don't see how I could be saving to an older version. The client does not have access to any other rights on the table other than loading. I do not save to this table anywhere else other than here. Any help or feedback would be much appreciated.