Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
2.2.6 release
Browse files Browse the repository at this point in the history
See changelog for details.
  • Loading branch information
Metric committed Mar 30, 2021
1 parent 1c092bd commit 50a4251
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 117 deletions.
2 changes: 1 addition & 1 deletion AnS/AnS.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 90005
## Title: AnS
## Version: 2.2.5
## Version: 2.2.6
## Notes: Core library for Auction Snipe etc.
## License: MIT
## SavedVariables: ANS_FILTERS, ANS_CONFIG, ANS_CUSTOM_VARS, ANS_GLOBAL_SETTINGS, ANS_ANALYTICS_DATA
Expand Down
29 changes: 22 additions & 7 deletions AnS/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
## AnS Changes 2.2.6

- Added a new option for Auctioning operation for matching the lowest price for Max Value and Min Value
- Tried to fix an issue on retail, where items would not cancel if same price, but not latest auction for LiFo.
- It may work, but not always at the moment. Hoping, to get it working always next update.
- Fixed an issue for Auctioning operations where Max to Post was not calculated properly, due to not properly checking for exact item matching.
- Fixed an issue for Auctioning operations where it was not filtering items properly in some cases.
- Fixed an issue where item match was not working properly for Auctioning operations, when only iLevel was selected for Search Type.

- Fixed an issue in sniper for classic, where it became impossible to buy from a group when it was several stacks grouped together.
- Fixed an issue in classic, where New Chat Message alert could throw a nil exception.

- Increased parsing speed when using bonus() in formulas
- Improved memory rate usage when Skip Last Seen Group was active and was constantly rescanning same groups over and over on Retail.

## AnS Changes 2.2.5

- Fixed an issue in Sniper where results would disappear from the list on retail when it shouldn't or not be added at all on retail. This one was a tricky one to figure out how to fix. It was several problems combined causing this issue. First, known items / groups was being cleared too early. Second, the hashing method was not taking into account the retail itemKey.itemSuffix properly. Thus, things were being overwritten in the known lookup table, because it was only looking at the itemLevel and itemID for the general grouping. Hence, items disappearing from the list for no reason, or not being included at all. It now takes into account the proper itemSuffix for general grouping.
- Fixed an issue in Sniper where results would disappear from the list on retail when it shouldn't or not be added at all on retail. This one was a tricky one to figure out how to fix. It was several problems combined causing this issue. First, known items / groups was being cleared too early. Second, the hashing method was not taking into account the retail itemKey.itemSuffix properly. Thus, things were being overwritten in the known lookup table, because it was only looking at the itemLevel and itemID for the general grouping. Hence, items disappearing from the list for no reason, or not being included at all. It now takes into account the proper itemSuffix for general grouping.

- Fixed an issue where if Skip Lowest Seen Group was checked for Sniping settings, it would miss groups for items that share a common itemLevel and itemID but differing itemSuffix. It now takes into account the itemSuffix as well.
- Fixed an issue where if Skip Lowest Seen Group was checked for Sniping settings, it would miss groups for items that share a common itemLevel and itemID but differing itemSuffix. It now takes into account the itemSuffix as well.

- Fixed an issue in retail for Sniper, where scanning for battle pets could cause an nil exception to be thrown.
- Fixed an issue in retail for Sniper, where scanning for battle pets could cause an nil exception to be thrown.

- Fixed an issue where there was still a memory leak on both classic and retail in Sniper. Should see a pretty big decrease in memory gain rate on both. As well as the memory properly clearing after a bit of closing the AH.
- Fixed an issue where there was still a memory leak on both classic and retail in Sniper. Should see a pretty big decrease in memory gain rate on both. As well as the memory properly clearing after a bit of closing the AH.

- Fixed the issue where bonus() formula function would not ignore browse query groups on retail.
- Fixed the issue where bonus() formula function would not ignore browse query groups on retail.

- Fixed an issue from last build where bonus(), startswith(), and contains() formula functions would not return true or false if only the first argument was provided.
- Fixed an issue from last build where bonus(), startswith(), and contains() formula functions would not return true or false if only the first argument was provided.

- Added a new formula variable called: isgroup. isgroup = true if it is a browse group query calling the formula on retail. Otherwise it is false.
- Added a new formula variable called: isgroup. isgroup = true if it is a browse group query calling the formula on retail. Otherwise it is false.

## AnS Changes 2.2.4

Expand Down
3 changes: 3 additions & 0 deletions AnS/Core/Auction/Auction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ function Auction:Acquire(o)
a.vendorsell = 0;
a.isCommodity = false;
a.isEquipment = false;
a.isOwnerItem = false;

a.isPet = false;
a.auctionId = nil;
a.avg = 1;
Expand Down Expand Up @@ -51,6 +53,7 @@ function Auction:Clone()
iLevel = self.iLevel,
vendorsell = self.vendorsell,
isCommodity = self.isCommodity,
isOwnerItem = self.isOwnerItem,
isPet = self.isPet,
auctionId = self.auctionId,
itemIndex = self.itemIndex,
Expand Down
78 changes: 47 additions & 31 deletions AnS/Core/Auction/Query.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ local throttleTime = GetTime();

local EVENTS_TO_REGISTER = {};

local DEFAULT_ITEM_SORT = { sortOrder = 0, reverseSort = false };
local DEFAULT_ITEM_SORT = {
{ sortOrder = 0, reverseSort = false },
{ sortOrder = 4, reverseSort = false },
};

local ownedAuctions = {};

Expand Down Expand Up @@ -255,6 +258,14 @@ function Query:IsFiltered(auction)
return false;
end

function Query:GetGroupHash(group)
if (not group) then
return nil;
end

return group.itemKey.itemID.."."..group.itemKey.itemLevel.."."..group.itemKey.itemSuffix.."."..group.itemKey.battlePetSpeciesID;
end

-- used for retail auction group data
function Query:GetAuctionData(group)
local auction = Recycler:Get();
Expand Down Expand Up @@ -671,6 +682,7 @@ function Query:GetOwnedAuctionRetail(index)
auction.ppu = info.buyoutAmount;
auction.bidder = info.bidder;
auction.iLevel = info.itemKey.itemLevel;
auction.suffix = info.itemKey.itemSuffix;

if (info.itemKey.battlePetSpeciesID > 0
and keyInfo.battlePetLink
Expand Down Expand Up @@ -993,6 +1005,9 @@ local function BuildStateMachine()

fsm:Add(idle);

local tryBrowseFunc = function()
QueryFSM:Process("TRY_BROWSE");
end
local browse = FSMState:Acquire("BROWSE");
browse:SetOnEnter(function(self, filter)
Query.filter = filter;
Expand All @@ -1002,9 +1017,7 @@ local function BuildStateMachine()

Logger.Log("QUERY", "browse on enter");

Tasker.Delay(throttleTime + MAX_THROTTLE_WAIT, function()
QueryFSM:Process("TRY_BROWSE");
end, TASKER_TAG);
Tasker.Delay(throttleTime + MAX_THROTTLE_WAIT, tryBrowseFunc, TASKER_TAG);
return nil;
end);
browse:AddEvent("TRY_BROWSE");
Expand All @@ -1024,11 +1037,12 @@ local function BuildStateMachine()
C_AuctionHouse.SendBrowseQuery(filter);
return nil;
end);
local browseResultsFunc = function()
EventManager:Emit("QUERY_BROWSE_RESULTS");
end
tryBrowse:SetOnExit(function(self, next)
if (next == "IDLE") then
Tasker.Schedule(function()
EventManager:Emit("QUERY_BROWSE_RESULTS");
end, TASKER_TAG);
Tasker.Schedule(browseResultsFunc, TASKER_TAG);
end
end);
tryBrowse:AddEvent("IDLE");
Expand Down Expand Up @@ -1081,22 +1095,21 @@ local function BuildStateMachine()
fsmbrowseResults:SetOnExit(function(self, next)
Logger.Log("QUERY", "browse result complete");
if (next == "IDLE") then
Tasker.Schedule(function()
EventManager:Emit("QUERY_BROWSE_RESULTS");
end, TASKER_TAG);
Tasker.Schedule(browseResultsFunc, TASKER_TAG);
end
end);
fsmbrowseResults:AddEvent("IDLE");
fsmbrowseResults:AddEvent("SEARCH");

fsm:Add(fsmbrowseResults);

local tryBrowseMoreFunc = function()
QueryFSM:Process("TRY_BROWSE_MORE");
end
local browseMore = FSMState:Acquire("BROWSE_MORE");
browseMore:SetOnEnter(function(self)
Query.lastQueryType = "BROWSE";
Tasker.Delay(throttleTime + MAX_THROTTLE_WAIT, function()
QueryFSM:Process("TRY_BROWSE_MORE");
end, TASKER_TAG);
Tasker.Delay(throttleTime + MAX_THROTTLE_WAIT, tryBrowseMoreFunc, TASKER_TAG);
return nil;
end);
browseMore:AddEvent("TRY_BROWSE_MORE");
Expand All @@ -1121,6 +1134,9 @@ local function BuildStateMachine()

fsm:Add(tryBrowseMore);

local trySearchFunc = function()
QueryFSM:Process("TRY_SEARCH");
end
local search = FSMState:Acquire("SEARCH");
search:SetOnEnter(function(self, item, sell, first)
if (Query.filter) then
Expand All @@ -1135,9 +1151,7 @@ local function BuildStateMachine()
};
end

Tasker.Delay(throttleTime + MAX_THROTTLE_WAIT, function()
QueryFSM:Process("TRY_SEARCH");
end, TASKER_TAG);
Tasker.Delay(throttleTime + MAX_THROTTLE_WAIT, trySearchFunc, TASKER_TAG);
end);
search:AddEvent("TRY_SEARCH");
search:AddEvent("IDLE");
Expand Down Expand Up @@ -1181,11 +1195,12 @@ local function BuildStateMachine()

return "SEARCH", Query.filter.item, Query.filter.sell, Query.filter.first;
end);
local searchCompleteFunc = function()
EventManager:Emit("QUERY_SEARCH_COMPLETE");
end
trySearch:SetOnExit(function(self, next)
if (next == "IDLE") then
Tasker.Schedule(function()
EventManager:Emit("QUERY_SEARCH_COMPLETE");
end, TASKER_TAG);
Tasker.Schedule(searchCompleteFunc, TASKER_TAG);
end
end);
trySearch:AddEvent("IDLE");
Expand All @@ -1206,9 +1221,7 @@ local function BuildStateMachine()
itemResults:SetOnExit(function(self, next)
self.item = nil;
Logger.Log("QUERY", "item results complete");
Tasker.Schedule(function()
EventManager:Emit("QUERY_SEARCH_COMPLETE");
end, TASKER_TAG);
Tasker.Schedule(searchCompleteFunc, TASKER_TAG);
end);
itemResults:AddEvent("IDLE");
itemResults:AddEvent("MORE_ITEMS", function(self)
Expand Down Expand Up @@ -1242,6 +1255,9 @@ local function BuildStateMachine()
end
end, TASKER_TAG);
end);
local moreItemsFunc = function()
QueryFSM:Process("MORE_ITEMS");
end
itemResults:AddEvent("ITEM_RESULT", function(self, event, itemKey)
if (not self.item) then
return nil;
Expand All @@ -1263,9 +1279,7 @@ local function BuildStateMachine()
and Query.filter
and not Query.filter.first) then
Logger.Log("QUERY", "Querying more items");
Tasker.Schedule(function()
QueryFSM:Process("MORE_ITEMS");
end, TASKER_TAG);
Tasker.Schedule(moreItemsFunc, TASKER_TAG);
return nil;
end

Expand Down Expand Up @@ -1298,16 +1312,17 @@ local function BuildStateMachine()

return nil;
end);
local moreCommoditiesFunc = function()
QueryFSM:Process("MORE_COMMODITIES");
end
itemResults:AddEvent("COMMODITY_RESULT", function(self, event, itemID)
if (not self.item) then
return nil;
end

if (itemID == self.item.id and not C_AuctionHouse.HasFullCommoditySearchResults(itemID) and Query.filter and not Query.filter.first) then
Logger.Log("QUERY", "Querying more commodities");
Tasker.Schedule(function()
QueryFSM:Process("MORE_COMMODITIES");
end, TASKER_TAG);
Tasker.Schedule(moreCommoditiesFunc, TASKER_TAG);
return nil;
end

Expand All @@ -1334,11 +1349,12 @@ local function BuildStateMachine()
fsm:Add(FSMState:Acquire("MORE_COMMODITIES"));
fsm:Add(FSMState:Acquire("COMMODITY_RESULT"));

local tryOwnedFunc = function()
QueryFSM:Process("TRY_OWNED");
end
local owned = FSMState:Acquire("OWNED");
owned:SetOnEnter(function(self)
Tasker.Delay(throttleTime + MAX_THROTTLE_WAIT, function()
QueryFSM:Process("TRY_OWNED");
end, TASKER_TAG);
Tasker.Delay(throttleTime + MAX_THROTTLE_WAIT, tryOwnedFunc, TASKER_TAG);
return nil;
end);
owned:AddEvent("TRY_OWNED");
Expand Down
Loading

0 comments on commit 50a4251

Please sign in to comment.