Item count not updating when using reagents from Reagent Bank
chilisaucier opened this issue ยท 5 comments
Hey! Love the addon, but only problem I'm having the last couple of weeks is that the item count for my reagents are not updated when (for example) turning in a quest using reagents from the bank. Like the fishing quests for the Tuskarr faction. The total amount of fish I have in my Reagent Bank is not updated in the tooltip when I mouseover the item, after turning in the quest. So if i have 25 [Islefin Dorado], 10 in my bags and 15 in my Reagent Bank, and turn in 20 for the quest, it should now say that I have only 5 left in my Reagent Bank. But as it is at the moment, the tooltip says that I still have 15 in my Reagent Bank.
Hope you can look into this! :D
It's actually in issue with the Blizzard servers. They have been broken for some time with an event that is important for addons to function. BAG_UPDATE_DELAYED.
https://wowpedia.fandom.com/wiki/BAG_UPDATE_DELAYED
There has been patches and hotfixes but they keep breaking it. Hopefully the next major patch fixes it. In addition a few other events have been broken for some time now. In terms of the item stuff from the bank, that's all prediction based calculations. Believe it or not they don't exactly give us tools to know when or how many items are used from the bank/reagent when crafting outside of it. So I had to make algorithms to try to predict it. It's not 100% and sometimes it does get some stuff wrong. Considering a lot of events have been broken lately, I'll take a look at it anyways.
Ah I see! Thank you for the quick answer, and also for looking in to it! Not an expert myself when it comes to addon functions, didn't now this was an on-going issue on Blizzard's side, that's too bad... I guess it's not as easy as just "subtracting" the amount from the logged amount of reagent items that was just handed in for the quest? As stated, have no idea how the back-end works when it comes to addons for items/bags/banks... xD
Ah I see! Thank you for the quick answer, and also for looking in to it! Not an expert myself when it comes to addon functions, didn't now this was an on-going issue on Blizzard's side, that's too bad... I guess it's not as easy as just "subtracting" the amount from the logged amount of reagent items that was just handed in for the quest? As stated, have no idea how the back-end works when it comes to addons for items/bags/banks... xD
Lol yeah I wish it worked that way. It's a lot more complex then that as all the items are stored in a giant web based on storage. Meaning you have 20 in bags, 30 in bank, 20 in reagent bank, 10 in auction, and like 5 in your mailbox. If I just stored it in one giant lump sum, how would BagSync know where the items are located? So lets say you use up 50 in a quest or something. How would BagSync know where to subtract and by how many? Was 10 used in your bags and 10 from bank and 30 from your reagent? Or was 20 used from your Reagent bank and the remainder 30 from your bags? Blizzard doesn't allow addon authors to check the Reagent and Bank item counts when you're NOT at the bank. So I have to rely on guessing and prediction stuff. Meaning if I knew 50 was used and there was only 20 in your bags, then I can assume the remainder 30 was from your bank or reagent bank. But how many of which and in what location? See the problem? Until Blizzard gives us more tools for scenarios like these, it's very difficult for addon authors to keep accurate counts. Do you understand now?
I'll review the code and see if it can be enhanced a bit more, but considering many events have been broken for some time, it may be time wasted until they get it functional. Even then without the proper tools it still a guessing game.
Okay, yeah I get it now, ty for explaining! Was a bit more complex than I first thought heheh...
But thanks anyway for answering, and keep up the good work in the future! B)
The next update should have some fixes that will make the item counts more accurate. What I did was instead of using the cached information that BagSync stores for the currently logged in player, I'm using real time item count from the Blizzard server instead. Meaning that it will always return the exact item count the server is keeping track of on their end instead of using the BagSync cache. This will only work though for the currently logged in player obviously but that is what we want anyways. This should make it much more accurate for things like items in the bank or reagent bank that are used when crafting or turning in quests. I pretty much removed all the prediction stuff to use this instead. Keep an eye out for a BagSync update to address this.