Issue Details (XML | Word | Printable)

Key: BCNT-250
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: William (Kandoko)
Reporter: William (Kandoko)
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
BeanCounter

In certain situations the mail matcher name lookup can return the wrong name and itemID leading to mail not being recognized and recorded.

Created: 30/Apr/09 10:04 AM   Updated: 18/Aug/09 12:37 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
function private.matchDB(text)
local itemID
for itemKey, data in pairs(BeanCounterDB.ItemIDArray) do
local _, name = strsplit(";", data)
if text:find(name, 1, true) then
itemID = string.split(":", itemKey)
--debugPrint("Searching",key,"for",text,"Sucess: link is",itemLink)
local itemLink = lib.API.createItemLinkFromArray(itemKey)
return itemID, itemLink
end
end
debugPrint("Searching DB for ItemID..", key, text, "Failed Item does not exist in the name array")
return nil
end

We still used a find that was no longer needed since we dont store full itemlinks. This could return the wrong item if its name was a subsection of teh longer string we were looking for.
ie "Healing Potion" would be returned when we looked for "Greater Healing Potion"



 All   Comments   Change History   Transitions   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
William (Kandoko) added a comment - 30/Apr/09 10:07 AM
r4191
changed to a direct string comparison

function private.matchDB(text)
local itemID
for itemKey, data in pairs(BeanCounterDB.ItemIDArray) do
local _, name = strsplit(";", data)
if text == name then
itemID = string.split(":", itemKey)
--debugPrint("Searching",key,"for",text,"Sucess: link is",itemLink)
local itemLink = lib.API.createItemLinkFromArray(itemKey)
return itemID, itemLink
end
end
debugPrint("Searching DB for ItemID..", key, text, "Failed Item does not exist in the name array")
return nil
end


dinesh added a comment - 18/Aug/09 12:37 AM
code review only