Quantcast

v.6.7.1

Xruptor [12-10-11 - 19:48]
v.6.7.1
-Removed secondary auction house check as it was no longer required.
-Auction house items will be triggered by expired checks only after a user places an item for auction.
-Auctions will now be updated on each visit to the Auction House.  This is done to keep consistency throughout the data.

v6.7
-Added ability to track Auction House items. System to remove expired items was also implemented.
Note: It's still best to check the auction house often while this feature is enabled. This way the data is up to date.
-Added ability to save professions throughout all your characters. You can now view and link professions from all your characters!
-Completely restructured the addon and converted some functions to local ones.
-Changed color coding for Professions. Green = linkable, Blue = not-linkable
-Reworked how the void storage is checked.
-Added an option to display the modified tooltips only in the BagSync Search winow.
-Added another check for expired items. Two is better then One!
-Added new Blacklist Window. You can now blacklist items by itemID.
Note: these items will still be added to the database. They just will never be displayed in the toolips.
-Revamped the Profiles Window.
-Removed tekKonfigDropdown library as it was no longer needed.
-Updated the localization to reflect the new changes. Also added some more localization where it was required.
Filename
BagSync.lua
diff --git a/BagSync.lua b/BagSync.lua
index 4a24f52..c161a5e 100644
--- a/BagSync.lua
+++ b/BagSync.lua
@@ -524,8 +524,6 @@ local function ScanAuctionHouse()
 	local ahCount = 0
 	local numActiveAuctions = GetNumAuctionItems("owner")

-	if not BS_DB.AH_LastScan then BS_DB.AH_LastScan = time() end --this is only really used once, at first activation of v6.7
-
 	--scan the auction house
 	if (numActiveAuctions > 0) then
 		for ahIndex = 1, numActiveAuctions do
@@ -540,7 +538,7 @@ local function ScanAuctionHouse()
 					local linkItem = ToShortLink(link)
 					if linkItem then
 						count = (count or 1)
-						BS_DB[index] = format('%s,%s,%s,%s', linkItem, count, timeLeft, time())
+						BS_DB[index] = format('%s,%s,%s', linkItem, count, timeLeft)
 					else
 						BS_DB[index] = linkItem
 					end
@@ -567,7 +565,7 @@ local function ScanAuctionHouse()
 	BS_DB[bChk] = ahCount
 end

---this method is global for all toons
+--this method is global for all toons, removes expired auctions on login
 local function RemoveExpiredAuctions()
 	local bChk = GetTag('bd', 'auction_count', 0)
 	local timestampChk = { 30*60, 2*60*60, 12*60*60, 48*60*60 }
@@ -588,15 +586,14 @@ local function RemoveExpiredAuctions()
 							--check for expired and remove if necessary
 							--it's okay if the auction count is showing more then actually stored, it's just used as a means
 							--to scan through all our items.  Even if we have only 3 and the count is 6 it will just skip the last 3.
-							local dblink, dbcount, dbtimeleft, dbstoretime = strsplit(',', BagSyncDB[realm][k][getIndex])
+							local dblink, dbcount, dbtimeleft = strsplit(',', BagSyncDB[realm][k][getIndex])

 							--only proceed if we have everything to work with, otherwise this auction data is corrupt
-							if dblink and dbcount and dbtimeleft and dbstoretime then
+							if dblink and dbcount and dbtimeleft then
 								if tonumber(dbtimeleft) < 1 or tonumber(dbtimeleft) > 4 then dbtimeleft = 4 end --just in case
 								--now do the time checks
 								local diff = time() - BagSyncDB[realm][k].AH_LastScan
-								local diff_item = time() - tonumber(dbstoretime)
-								if diff > timestampChk[tonumber(dbtimeleft)] or diff_item > timestampChk[tonumber(dbtimeleft)] then
+								if diff > timestampChk[tonumber(dbtimeleft)] then
 									--technically this isn't very realiable.  but I suppose it's better the  nothing
 									BagSyncDB[realm][k][getIndex] = nil
 								end
@@ -613,47 +610,6 @@ local function RemoveExpiredAuctions()

 end

---this method is retricted to the current toon
-local function CharRemoveExpired()
-	if not BS_DB.AH_LastScan then return end
-
-	local bChk = GetTag('bd', 'auction_count', 0)
-	local timestampChk = { 30*60, 2*60*60, 12*60*60, 48*60*60 }
-
-	--check to see if we even have a count
-	if BS_DB[bChk] then
-		--we do so lets do a loop
-		local bVal = BS_DB[bChk]
-
-		--do a loop through all of them and check to see if any expired
-		for x = 1, bVal do
-			local getIndex = GetTag('auction', 0, x)
-
-			if BS_DB[getIndex] then
-				--check for expired and remove if necessary
-				--it's okay if the auction count is showing more then actually stored, it's just used as a means
-				--to scan through all our items.  Even if we have only 3 and the count is 6 it will just skip the last 3.
-				local dblink, dbcount, dbtimeleft, dbstoretime = strsplit(',', BS_DB[getIndex])
-
-				--only proceed if we have everything to work with, otherwise this auction data is corrupt
-				if dblink and dbcount and dbtimeleft and dbstoretime then
-					if tonumber(dbtimeleft) < 1 or tonumber(dbtimeleft) > 4 then dbtimeleft = 4 end --just in case
-					--now do the time checks
-					local diff = time() - BS_DB.AH_LastScan
-					local diff_item = time() - tonumber(dbstoretime)
-					if diff > timestampChk[tonumber(dbtimeleft)] or diff_item > timestampChk[tonumber(dbtimeleft)] then
-						--technically this isn't very realiable.  but I suppose it's better the  nothing
-						BS_DB[getIndex] = nil
-					end
-				else
-					--it's corrupt delete it
-					BS_DB[getIndex] = nil
-				end
-			end
-		end
-	end
-end
-
 ------------------------
 --   Money Tooltip    --
 ------------------------
@@ -1456,7 +1412,6 @@ end

 function BagSync:AUCTION_HOUSE_SHOW()
 	if not BagSyncOpt.enableAuction then return end
-	CharRemoveExpired()
 	ScanAuctionHouse()
 end