Browse Source

update auctiondb sync and accounting graph

dev
Jørgen Lien Sellæg 4 months ago
parent
commit
472f8d2be6
  1. 2
      AGENTS.md
  2. 2
      TradeSkillMaster/TradeSkillMaster.toc
  3. 4
      TradeSkillMaster_Accounting/Locale/enUS.lua
  4. 9
      TradeSkillMaster_Accounting/Modules/gui.lua
  5. 4
      TradeSkillMaster_Accounting/TradeSkillMaster_Accounting.lua
  6. 1
      TradeSkillMaster_AuctionDB/Locale/enUS.lua
  7. 36
      TradeSkillMaster_AuctionDB/Modules/ChannelSync.lua
  8. 4
      TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc
  9. 8
      TradeSkillMaster_Auctioning/modules/PostScan.lua

2
AGENTS.md

@ -16,7 +16,7 @@ No automated test framework is present. Validate changes by enabling the addon i
Recent commit messages are short and action-focused (for example “add group scan”, “skip wipe of data when searching”). Keep messages concise and imperative when possible. For pull requests, follow the template in `.github/PULL_REQUEST_TEPMLATE.md`: include a clear description, reference issues with `Fixes #<id>`, select a change type, describe test steps, and complete the self-review checklist.
## Agent Notes
When adding or renaming modules, update the `.toc` and matching `.lua` filenames together, and ensure any new files are listed in the `.toc` manifest. Keep changes scoped to the relevant module folder to avoid cross-module regressions.
When adding or renaming modules, update the `.toc` and matching `.lua` filenames together, and ensure any new files are listed in the `.toc` manifest. Keep changes scoped to the relevant module folder to avoid cross-module regressions. Increment numeric `Version`/`X-Curse-Packaged-Version` in `TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc` and `Version` in `TradeSkillMaster/TradeSkillMaster.toc` on each commit.
Local Ascension client paths used in this workspace:
- AddOns: `/home/zalox/Games/ascension-wow/drive_c/Program Files/Ascension Launcher/resources/client/Interface/AddOns`
- SavedVariables: `/home/zalox/Games/ascension-wow/drive_c/Program Files/Ascension Launcher/resources/client/WTF/Account/omanfred/SavedVariables`

2
TradeSkillMaster/TradeSkillMaster.toc

@ -2,7 +2,7 @@
## Title: |cff00fe00TradeSkillMaster: Revived|r
## Notes: Core addon for the TradeSkillMaster suite, revived for Wrath of the Lich King. Does nothing without modules installed.
## Author: Sapu94, Bart39, Gnomezilla [Warmane-Icecrown(A)], BlueAo [Warmane], andrew6180, Yoshiyuka, DimaSheiko, and other contributors...
## Version: Rev668
## Version: 2.3.13
## SavedVariables: TradeSkillMasterAppDB, AscensionTSMDB
## OptionalDeps: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0, SharedMedia, TheUndermineJournal, TheUndermineJournalGE
## X-Embeds: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0

4
TradeSkillMaster_Accounting/Locale/enUS.lua

@ -15,7 +15,7 @@ if not L then return end
L["|cffff0000IMPORTANT:|r When TSM_Accounting last saved data for this realm, it was too big for WoW to handle, so old data was automatically trimmed in order to avoid corruption of the saved variables. The last %s of %s data has been preserved."] = true
L["%s ago"] = true
L["Accounting has not yet collected enough information for this tab. This is likely due to not having recorded enough data points or not seeing any significant fluctuations (over 1k gold) in your gold on hand."] = true
L["Accounting has not yet collected enough information for this tab. This is likely due to not having recorded enough data points or not seeing any significant fluctuations in your gold on hand."] = true
L["Activity Type"] = true
L["All"] = true
L["Amount"] = true
@ -26,7 +26,7 @@ L["Avg Resale Profit"] = true
L["Avg Sell Price"] = true
L["Back to Previous Page"] = true
L["Balance"] = true
L["Below is a graph of the your character's gold on hand over time.\n\nThe x-axis is time and goes from %s to %s\nThe y-axis is thousands of gold."] = true
L["Below is a graph of the your character's gold on hand over time.\n\nThe x-axis is time and goes from %s to %s\nThe y-axis is gold."] = true
L["Bought"] = true
L["Buyer/Seller"] = true
L["Cancelled Since Last Sale:"] = true

9
TradeSkillMaster_Accounting/Modules/gui.lua

@ -809,7 +809,7 @@ function private:GetGoldGraphPoints(goldLog)
local data = {}
for _, info in ipairs(goldLog) do
local x1, x2 = info.startMinute, info.endMinute
local y = info.copper / COPPER_PER_GOLD / 1000
local y = info.copper / COPPER_PER_GOLD
minX = min(minX, x1)
maxX = max(maxX, x2)
minY = min(minY, floor(y))
@ -831,7 +831,7 @@ function private:GetGoldGraphSumData()
if i > 1 then
data[i].startMinute = data[i-1].endMinute+1
end
data[i].copper = TSM:Round(data[i].copper, COPPER_PER_GOLD*1000)
data[i].copper = TSM:Round(data[i].copper, COPPER_PER_GOLD)
end
tinsert(players, data)
tinsert(starts, data[1].startMinute)
@ -907,7 +907,7 @@ function GUI:DrawGoldGraph(container)
children = {
{
type = "Label",
text = L["Accounting has not yet collected enough information for this tab. This is likely due to not having recorded enough data points or not seeing any significant fluctuations (over 1k gold) in your gold on hand."],
text = L["Accounting has not yet collected enough information for this tab. This is likely due to not having recorded enough data points or not seeing any significant fluctuations in your gold on hand."],
relativeWidth = 1,
},
{
@ -948,8 +948,7 @@ function GUI:DrawGoldGraph(container)
children = {
{
type = "Label",
--text = format(L["Below is a graph of the your character's gold on hand over time.\n\nThe x-axis is time and goes from %s to %s\nThe y-axis is thousands of gold."], startDate, endDate),
text = format("Below is a graph of the your character's gold on hand over time.\nThe x-axis is time and goes from %s to %s. The y-axis is thousands of gold.", startDate, endDate),
text = format(L["Below is a graph of the your character's gold on hand over time.\n\nThe x-axis is time and goes from %s to %s\nThe y-axis is gold."], startDate, endDate),
relativeWidth = 1,
},
-- {

4
TradeSkillMaster_Accounting/TradeSkillMaster_Accounting.lua

@ -90,8 +90,8 @@ function TSM:OnInitialize()
if data.startMinute == data.endMinute and data.copper == 0 then
tremove(playerData, i)
else
-- round to nearest 1k gold
data.copper = TSM:Round(data.copper, COPPER_PER_GOLD*1000)
-- round to nearest gold
data.copper = TSM:Round(data.copper, COPPER_PER_GOLD)
end
end
if #playerData >= 2 then

1
TradeSkillMaster_AuctionDB/Locale/enUS.lua

@ -16,6 +16,7 @@ if not L then return end
L["%s ago"] = true
L["A full auction house scan will scan every item on the auction house. Expect this scan to take several minutes or longer."] = true
L["Any items in the AuctionDB database that contain the search phrase in their names will be displayed."] = true
L["A newer version of AuctionDB (%s) was received from %s. You are running %s."] = true
L["Are you sure you want to clear your AuctionDB data?"] = true
L["Ascending"] = true
L["AuctionDB - Market Value"] = true

36
TradeSkillMaster_AuctionDB/Modules/ChannelSync.lua

@ -10,6 +10,7 @@
local TSM = select(2, ...)
local ChannelSync = TSM:NewModule("ChannelSync", "AceEvent-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_AuctionDB")
local CHANNEL_NAME = "TSM_AuctionDB"
local COMM_PREFIX = "TSMADB1"
@ -26,6 +27,7 @@ local private = {
incoming = {},
sendQueue = {},
isSending = false,
notifiedNewer = {},
}
local strbyte = string.byte
@ -35,6 +37,26 @@ local libD = LibStub("LibDeflate", true)
local warnedNoDeflate
local debugEnabled = true
local function GetAddonVersion()
local version = GetAddOnMetadata("TradeSkillMaster_AuctionDB", "X-Curse-Packaged-Version")
or GetAddOnMetadata("TradeSkillMaster_AuctionDB", "Version")
if not version or version == "" then
return "unknown"
end
return version
end
local function VersionKey(version)
local key = 0
for part in tostring(version or ""):gmatch("%d+") do
key = key * 1000 + tonumber(part)
end
return key
end
private.addonVersion = GetAddonVersion()
private.addonVersionKey = VersionKey(private.addonVersion)
local function DebugPrint(msg)
if debugEnabled then
TSM:Print("ChannelSync: " .. msg)
@ -148,6 +170,16 @@ local function DecodePayload(encoded)
return payload
end
local function MaybeNotifyNewerVersion(remoteVersion, sender)
local remoteKey = VersionKey(remoteVersion)
local localKey = private.addonVersionKey
if remoteKey == 0 or localKey == 0 or remoteKey <= localKey then return end
local noticeKey = tostring(sender or "unknown") .. ":" .. tostring(remoteVersion)
if private.notifiedNewer[noticeKey] then return end
private.notifiedNewer[noticeKey] = true
TSM:Printf(L["A newer version of AuctionDB (%s) was received from %s. You are running %s."], remoteVersion, sender or "unknown", private.addonVersion)
end
function ChannelSync:BroadcastScanData(scanType, items)
if scanType ~= "Full" and scanType ~= "Group" and scanType ~= "Search" then
return
@ -255,6 +287,7 @@ function ChannelSync:BuildPayloadFromItemIDs(scanType, itemIDList)
v = 1,
scanType = scanType,
scanTime = TSM.db.realm.lastCompleteScan,
version = private.addonVersion,
items = payloadItems,
}
end
@ -381,6 +414,9 @@ function ChannelSync:OnChannelMessage(_, msg, source, _, channelString, _, chann
DebugPrint("Payload decode failed for bundle " .. format("%08x", hash))
return
end
if payload.version then
MaybeNotifyNewerVersion(payload.version, source)
end
MergeIncomingData(payload, source)
end

4
TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc

@ -2,10 +2,10 @@
## Title: |cff00ff00TradeSkillMaster_AuctionDB|r
## Notes: Stores auction house data and calculates market prices.
## Author: Sapu94, Bart39
## Version: v2.3.10
## Version: 2.3.13
## SavedVariables: AscensionTSM_AuctionDB
## Dependency: TradeSkillMaster
## X-Curse-Packaged-Version: v2.3.10
## X-Curse-Packaged-Version: 2.3.13
## X-Curse-Project-Name: TradeSkillMaster_AuctionDB
## X-Curse-Project-ID: tradeskillmaster_auctiondb
## X-Curse-Repository-ID: wow/tradeskillmaster_auctiondb/mainline

8
TradeSkillMaster_Auctioning/modules/PostScan.lua

@ -13,6 +13,7 @@ local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_Auctioning") -- l
local bagInfo, bagState = {}, {}
local bagInfoUpdate = 0
local postQueue, currentItem, itemLocations = {}, {}, {}
local scanItems
local totalToPost, totalPosted, count = 0, 0, 0
local isScanning, GUI
@ -129,6 +130,10 @@ function Post:GetScanListAndSetup(GUIRef, options)
tinsert(scanList, itemString)
end
end
scanItems = {}
for _, itemString in ipairs(scanList) do
tinsert(scanItems, itemString)
end
TSMAPI:FireEvent("AUCTIONING:POST:START", {numItems=#scanList, isGroup=true})
return scanList
@ -523,5 +528,8 @@ end
function Post:DoneScanning()
isScanning = false
if scanItems and next(TSM.Scan.auctionData) then
TSMAPI:ModuleAPI("AuctionDB", "processScanData", TSM.Scan.auctionData, scanItems, time())
end
return totalToPost
end
Loading…
Cancel
Save