Thread Tools Display Modes
Prev Previous Post   Next Post Next
11/23/14, 06:29 AM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,009
[Need help pls] Find slowdown bug at Advanced Filters & FCOItemSaver addons

Hey all,

I'm the developer of FCOItemSaver and need some help please.

About my addon:
FCOItemSaver is an addon which allows you to mark items in your inventories/banks.
These marked items will show in the inventories at the left to the item's name (e.g. a red lock or a yellow coin, or both at the same icon):


You are able to filter these marked items by buttons at the bottom of the inventories. These buttons look like the icon itself and change their state and color if you click them (filter enabled: hide all marked items=green, Filter enabled and only show marked: show only marked items=yellow, Filter disabled: show all items including marked ones=red):


So you are able to hide items you have marked to prevent them from beeing deconstructed or selling them (if filter is enabled, set to green):


Used library:
ESO is able to use additional filters for the list dialogs (inventories e.g.) to hide/show items.
This is how your inventory tab "Junk" only shows items marked as junk e.g.!

The addon AdvancedFilters and FCOItemSaver both use this library: "libFilters"
libFilters registers custom made filters to the additional filters.

This library will queue all filters, coming from different addons (e.g. AdvancedFilters + AF Plugins, ItemSaver, FCOItemSaver, and maybe others), and enable/disable them at the different panels (inventory, banks, stores, mail, trading to players, crafting stations, enchanting station, guild store).
AdvancedFilters even uses some subfilters (like the different weapon, armor, material types, etc.).


Problem:
After the last update to the game (v1.5), and some following changes to the addon Advanced Filters, my addon FCOItemSaver will crash the game, or at least slow it really down!

If you have opened the bank/guild bank, at least one item is marked with an icon, and at least one of the filters is enabled (green), and you change the AdvancedFilters tabs then (from "All" to "Weapons", or from "Weapons" to "Armor", or from "Armor" to "Materials", etc.)

the game will slow down or crash.

The more often you change the tabs the slower the client becomes.
-> If you use Wykkyd's information bar you can watch the FPS drop to below 10 and the ping increase up to several seconds o0.

I tried to recode the registering and unregistering of the filters but all my changes do not solve the slow down problem

So I'm searching for some experienced LUA developer who can review the code of FCOItemSaver, AdvancedFilters & libFilters to see why the game slows down all of sudden!
Thank you very much in advance for your help!


How to rebuild the problem:
1. Download and install AdvancedFilters addon: http://www.esoui.com/downloads/info2...edFilters.html
2. Download my current version of addon FCOItemSaver from dropbox (unreleased beta with recode of registering/unregistering filters): https://dl.dropboxusercontent.com/u/..._3_1b_beta.zip
3.Delete/rename "FcoItemSaver.lua" file from "SavedVariables" if you have used my addon before!
3. Play the game with standard settings of FCOItemSaver
4. Go to the bank or guild bank and open the bank panel
5. Mark at least one item with any icon (e.g. the "lock" icon) by right clicking the item in your bank/inventory and choosing the context (e.g. "Lock", "Add to gear 1", or "Mark for research")
6. Enable the appropriate filter (lock icon = lock filter, helmet icon = helmet filter, research icon=reserach filter, coin icon=coin filter) at the bottom of the bank inventory, by clicking on the button.
The filter button at the bottom of the inventory must be "green"!
The chat will give you feedback about the filter state too.
7. Change AdvancedFilters tabs a bit (from "AlL" to "Weapons" to "Armor" back to "AlL" and then to "Materials" etc.

The game client should slow down very fast and each change of AdvancedFilters tabs should slow it down even more.
This will only happen if FCOItemSaver is enabled. If you disable the addon and do a /reloadui changing the tabs at AdvancedFilters will work very quick and stable.

Information on error finding:
If you click on the filter buttons at the bottom of the inventories the function "doFilter()" will be called to change the filter state and unregister (function unregisterAllFilters()) the previous filter (if it was set) + registering (function registerAllFilters()) the new filter.
It depends on the panel (p_FilterPanelId) where you are (deconstruction, bank, inventory, mail, etc.) and the button you've clicked (filterId).

The unique filter's name, used to register the filter with library "libFilters" will be depending on the panel where you currently are:

Possible filterIds:
1: Left button at the bottom (Standard: lock icon)
2: 2nd button from left at the bottom (Standard: helmet icon)
3: 3rd button from left at the bottom (Standard: research icon)
4: 4th button from left at the bottom (Standard: coins icon)

Possible p_FilterPanelIds:
INV_BAGS = 1
INV_BANK = 2
INV_GUILDBANK = 3
INV_STORE = 4
INV_DECONSTRUCTION = 5
INV_GUILDSTORE = 6
INV_MAIL = 7
INV_TRADE = 8
INV_ENCHANTING = 9

Unique filter names:
Player bank filter: "FCOItemSaver_PlayerBankFilterNew<p_FilterPanelId>_<filterId>"
Guild bank filter: "FCOItemSaver_GuildBankFilterNew<p_FilterPanelId>_<filterId>"
Deconstruction filter: "FCOItemSaver_DeconstructionFilterNew<p_FilterPanelId>_<filterId>"
Guild store filter: "FCOItemSaver_GuildStoreFilterNew<p_FilterPanelId>_<filterId>"
Vendor filter: "FCOItemSaver_FilterNew<p_FilterPanelId>_<filterId>"
...

Error searching:
I tracked it down to the "libfilters:RegisterFilter()" function somehow.
Unregistering the filters works quick and without problems.
But (re)registering the filters will slow everything down.
I wasn't able to see where exactly the slowdown happens.

It seems to happen if you have at least one of the FCOItemSaver filters registered and then change the AdvancedFilters tab -> The given filters stay registered and all the new AdvancedFilters filters (e.g. "Weapons") + subfilters (e.g. "Axe", "Sword", etc.) get registered.

See function libFilters:RegisterFilter -> arrays idToFilter and thisFilter ->
if filterType == LAF_BANK -> SetInventoryFilter(LAF_BANK) -> filtertype = LAF_BANK -> inventorytype = INVENTORY_BANK -> currentFilter holds the registered filters (including FCOItemSaver filter) -> new filters will be added in callback function for PLAYER_INVENTORY.inventories[inventoryType].additionalFilter afterwards, respecting the currentFilters too:
Lua Code:
  1. --handle already existing filters
  2.             if(currentFilter) then
  3.                 result = result and currentFilter(slot)
  4.             end

I hope someone of you can help me fix this bug so ppl can use my addon again without any problems.
Thank you very much!
  Reply With Quote
 

ESOUI » AddOns » AddOn Help/Support » [Need help pls] Find slowdown bug at Advanced Filters & FCOItemSaver addons


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off