Equipment Manager Set Not Saving

This issue has been resolved now, and we put together a little more information for those of you who are interested.

We found that this bug where Equipment Sets are not saved was originally introduced when we updated our code to use a newer, simpler, and more secure system in the database. The new system was a wrapper around an older, battle tested, and reliable object for doing database operations, and it made some of the more complicated interactions with the system easier to use. The way it worked was by copying pending database changes into another object before they moved on to getting written.

The problem that caused the bug came from how we were keeping track of items. We were trying to determine if a value had changed before writing it, so we wouldn’t waste any time if there was no change. Makes sense, right? But in this specific case, where a character removed a piece of gear from an equipment set, we set the Item ID for that slot back to zero. So that meant the default value for the new database object we were copying into was… zero. The way it ended up flowing was that all the equipment set changes were properly being packed up and piped into the new system, but then when we went to copy them into a new object we saw a removed item, like a head piece, was now set to zero. Since our new object already had a zero for your head piece it incorrectly thought “We don’t need to save this, it’s already zero!” and threw the change away.

Again, this issue is now resolved. This thread and discussion definitely helped us track it all down, so thanks for the constructive thoughts!

1 Like