delflein / MobInfo2-Classic

Migration of old Addon MobInfo2 to Classic WoW
Other
6 stars 3 forks source link

Increasing numbers after reloading #10

Closed Michigras closed 5 years ago

Michigras commented 5 years ago

I don't know if you're planning to actively support this addon, but there is an issue with some mobs after reloading. I don't know what ultimately causes it, maybe it's the addon initialisation. Doing a /reload causes the loot numbers of some mobs to increase greatly after each reload. By now it says that I've looted 112,686 lesser rock elementals. Their quest is decorated with a horrible drop rate but I doubt I've invested that much time into it.

krishnacenter commented 5 years ago

I confirm. I have the same problem. Please fix

ghost commented 5 years ago

Hey, I've not noticed this behaviour so far.

Do you maybe have a "M2_Import.lua" in your addon folder, and there is a Auto Import option active ? I don't even know if there is such option. But with such an Import file, you could overwrite and import data from other databases. Might happened here.

Michigras commented 5 years ago

There was an _M2Import.lua in my addon folder, but I don't know where it came from. I had my own fixed version of MI2 but then switched to yours, maybe it was a leftover. I'll check the mobs again later. Do the tooltip checkboxes (Kills, Loots, etc.) work on your side? Selecting them has no effect most of the time.

ghost commented 5 years ago

I just noticed that the MI2_Import.lua File is at least needed to load the Addon correctly :D ... But I'll put in an empty one.

EDIT: Also just checked for myself. Every time I reload it adds +5 to the Loot count of the mob I checked. I really have no Idea why it is +5... and where this comes from.

Michigras commented 5 years ago

For me the number increasing starts slow and then adds up like exponentially. I'll look into it as well later.

ghost commented 5 years ago

The Tooltip Checkboxes, some of them I deactivated because the EventHandlers behind them are missing from the Current API. I didn't look into how to remove them from the Options panel. E.g. I don't think there is a reliable way to count kills, unless you are always solo leveling

ghost commented 5 years ago

Also just noticed. Deactivating "Combine same Mobs" instantly fixes the counter.

ghost commented 5 years ago

So further Investigating later... The MI2_AddTwoMobs(mobdata1, mobdata2) function seems to add up to an object that gets handed through, until it gets saved on Logout or Reload.

So the increase in Value is always exactly the number of Loots of all mobs with same name combined, except the one targetting.

e.g I tested it with Greater Duskbat lvl 6 and 7.

Loots of Lvl6: 5 Loots of Lvl7: 9

Hovering over the Lvl 7 showed the correct: 14 After reload it showed: 19 After logout it showed: 24 But If I killed one and then reloaded or relogged it showed: 25

So I found out that killing an enemy and looting it triggers an event that directly saves to database, at least I think that's how it is currently. I don't know why exactly reloading saves the combined value to the database. But it seems like not killing an enemy, just hovering over him, creates a wrong Value, that somehow makes it into the database.

ghost commented 5 years ago

Okay found the Trace...

Sooo... The Tooltip gets build, there it fetches the mobData for the combined mobs, after that this object gets further manipulated and at some points also Recorded and saved. Which should not happen if it is combined data.

ghost commented 5 years ago

Fixed the Issue on Branch 11302.04

krishnacenter commented 5 years ago

@TheRealHypo Thank you!!!

krishnacenter commented 5 years ago

@TheRealHypo I downloaded the new version, but unfortunately also does not work. It works only if you uncheck it. I also want to report that the addon does not count some gray loot, as well as coins (copper, silver, gold). Please correct

ghost commented 5 years ago

Where did you download the new version from ? Did you checkout the branch yourself ? @kagarmanov

And yes, Gray loot will only be looged if you activate it in the menu. I never logged it myself, I can have a look into that, but please open another issue for that.