Skip to content

Commit

Permalink
Add info in RWF Tracking
Browse files Browse the repository at this point in the history
- itemLevel
- who droped what

Fixed timestamp generation, and fix codeeditor (codebase is with space right now)
  • Loading branch information
WFrancois committed Feb 19, 2022
1 parent 31d1262 commit 93f2f8f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[*.lua]
indent_style = tab
indent_style = space
indent_size = 4
21 changes: 17 additions & 4 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5241,7 +5241,7 @@ do
end

local function GetAnchorPoint(anchor, frame)
return
return
Eval(anchor.point, "TOPLEFT", anchor, frame),
Eval(anchor.rpoint, "TOPRIGHT", anchor, frame),
Eval(anchor.x, -16, anchor, frame),
Expand Down Expand Up @@ -7080,7 +7080,7 @@ do

---@class RWFLootEntry

local function LogItemLink(logType, linkType, id, link, count, sources, useTimestamp)
local function LogItemLink(logType, linkType, id, link, count, sources, useTimestamp, additionalInfo)
local isLogging, instanceName, instanceDifficulty, instanceID = rwf:GetLocation()
if logType == LOG_TYPE.News then
instanceName = _G.GUILD_NEWS or _G.GUILD_NEWS_TITLE
Expand All @@ -7101,6 +7101,7 @@ do
lootEntry.isNew = not lootEntry.timestamp
lootEntry.timestamp = lootEntry.timestamp or timestamp
lootEntry.isUpdated = timestamp - lootEntry.timestamp > 60
lootEntry.itemLevel = GetDetailedItemLevelInfo(link)
lootEntry.id, lootEntry.itemType, lootEntry.itemSubType, lootEntry.itemEquipLoc, lootEntry.itemIcon, lootEntry.itemClassID, lootEntry.itemSubClassID = GetItemInfoInstant(link)
lootEntry.link = link
lootEntry.index = lootEntry.index or CountItems(tables[3]) -- keep same index or count (our item is already included in the count)
Expand All @@ -7123,6 +7124,14 @@ do
end
end
lootEntry.addLoot = lootEntry.isNew or lootEntry.hasNewSources -- lootEntry.isUpdated

-- Additional info for dedup in backend
if additionalInfo then
for key, value in pairs(additionalInfo) do
lootEntry[key] = value
end
end

return lootEntry
end

Expand All @@ -7141,7 +7150,7 @@ do
if itemLinkFilter and itemLink:find(itemLinkFilter) then
return true
end
local _, _, _, itemEquipLoc = GetItemInfoInstant(itemLink)
local _, _, _, itemEquipLoc = GetItemInfoInstant(itemLink)
if itemEquipLoc and itemEquipLoc == "" then
return true
end
Expand Down Expand Up @@ -7206,8 +7215,12 @@ do
local itemType, itemID, itemLink, itemCount, itemQuality = GetItemFromText(newsInfo.whatText)
if itemType and CanLogItem(itemLink, itemType, itemQuality, LOG_FILTER.GUILD_NEWS) then
newsInfo.year = newsInfo.year + 2000
newsInfo.month = newsInfo.month + 1
newsInfo.day = newsInfo.day + 1
local timestamp = time(newsInfo)
HandleLootEntry(LogItemLink(LOG_TYPE.News, itemType, itemID, itemLink, itemCount or 1, nil, timestamp))
HandleLootEntry(LogItemLink(LOG_TYPE.News, itemType, itemID, itemLink, itemCount or 1, nil, timestamp, {
who = newsInfo.whoText
}))
end
end
end
Expand Down

0 comments on commit 93f2f8f

Please sign in to comment.