More debug for the new storage system
This commit is contained in:
@@ -19,8 +19,8 @@
|
||||
local addonName, Details222 = ...
|
||||
local version = GetBuildInfo()
|
||||
|
||||
Details.build_counter = 12810
|
||||
Details.alpha_build_counter = 12810 --if this is higher than the regular counter, use it instead
|
||||
Details.build_counter = 12811
|
||||
Details.alpha_build_counter = 12811 --if this is higher than the regular counter, use it instead
|
||||
Details.dont_open_news = true
|
||||
Details.game_version = version
|
||||
Details.userversion = version .. " " .. Details.build_counter
|
||||
|
||||
+29
-15
@@ -2,6 +2,8 @@
|
||||
local Details = _G.Details
|
||||
local addonName, Details222 = ...
|
||||
local Loc = LibStub("AceLocale-3.0"):GetLocale( "Details" )
|
||||
---@framework
|
||||
local detailsFramework = DetailsFramework
|
||||
local _
|
||||
|
||||
local UnitGUID = UnitGUID
|
||||
@@ -1834,8 +1836,13 @@ end
|
||||
|
||||
---@param combat combat
|
||||
function Details.Database.StoreEncounter(combat)
|
||||
--stop execution if the expansion isn't retail
|
||||
if (not detailsFramework:IsDragonflightAndBeyond()) then
|
||||
return
|
||||
end
|
||||
|
||||
combat = combat or Details:GetCurrentCombat()
|
||||
print(1)
|
||||
|
||||
if (not combat) then
|
||||
if (Details.debug) then
|
||||
print("|cFFFFFF00Details! Storage|r: combat not found.")
|
||||
@@ -1853,7 +1860,7 @@ print(1)
|
||||
end
|
||||
return
|
||||
end
|
||||
print(2)
|
||||
|
||||
local encounterInfo = combat:GetBossInfo()
|
||||
local encounterId = encounterInfo and encounterInfo.id
|
||||
|
||||
@@ -1865,15 +1872,21 @@ print(1)
|
||||
end
|
||||
|
||||
--get the difficulty
|
||||
local diffId, diff = combat:GetDifficulty()
|
||||
local diffId, diffName = combat:GetDifficulty()
|
||||
if (Details.debug) then
|
||||
print("|cFFFFFF00Details! Storage|r: difficulty identified:", diffId, diffName)
|
||||
end
|
||||
|
||||
--database
|
||||
---@type details_storage?
|
||||
local savedData = Details.Database.LoadDB()
|
||||
if (not savedData) then
|
||||
if (Details.debug) then
|
||||
print("|cFFFFFF00Details! Storage|r: Details.Database.LoadDB() FAILED!")
|
||||
end
|
||||
return
|
||||
end
|
||||
print(3)
|
||||
|
||||
--[=[
|
||||
savedData[mythic] = {
|
||||
[encounterId] = { --indexed table
|
||||
@@ -1898,10 +1911,11 @@ print(1)
|
||||
local elapsedCombatTime = combat:GetCombatTime()
|
||||
|
||||
---@type table<encounterid, details_encounterkillinfo[]>
|
||||
local encountersTable = savedData[diff]
|
||||
local encountersTable = savedData[diffName]
|
||||
if (not encountersTable) then
|
||||
savedData[diff] = {}
|
||||
encountersTable = savedData[diff]
|
||||
Details:Msg("encountersTable not found, diffName:", diffName)
|
||||
savedData[diffName] = {}
|
||||
encountersTable = savedData[diffName]
|
||||
end
|
||||
|
||||
---@type details_encounterkillinfo[]
|
||||
@@ -1918,7 +1932,7 @@ print(1)
|
||||
--if the player is facing a raid boss
|
||||
if (IsInRaid()) then
|
||||
totalkillsTable[encounterId] = totalkillsTable[encounterId] or {}
|
||||
totalkillsTable[encounterId][diff] = totalkillsTable[encounterId][diff] or {
|
||||
totalkillsTable[encounterId][diffName] = totalkillsTable[encounterId][diffName] or {
|
||||
kills = 0,
|
||||
wipes = 0,
|
||||
time_fasterkill = 1000000,
|
||||
@@ -1931,7 +1945,7 @@ print(1)
|
||||
}
|
||||
print(4)
|
||||
---@type details_bosskillinfo
|
||||
local bossData = totalkillsTable[encounterId][diff]
|
||||
local bossData = totalkillsTable[encounterId][diffName]
|
||||
---@type combattime
|
||||
local encounterElapsedTime = elapsedCombatTime
|
||||
|
||||
@@ -1966,9 +1980,9 @@ print(1)
|
||||
bossData.dps_best_raid_when = time()
|
||||
end
|
||||
end
|
||||
print(5, diff)
|
||||
print(5, diffName)
|
||||
--check for heroic and mythic
|
||||
if (Details222.storage.IsDebug or Details222.storage.DiffNamesHash[diff]) then
|
||||
if (Details222.storage.IsDebug or Details222.storage.DiffNamesHash[diffName]) then
|
||||
--check the guild name
|
||||
local match = 0
|
||||
local guildName = GetGuildInfo("player")
|
||||
@@ -2015,7 +2029,7 @@ print(1)
|
||||
local damageContainer = combat:GetContainer(DETAILS_ATTRIBUTE_DAMAGE)
|
||||
local healingContainer = combat:GetContainer(DETAILS_ATTRIBUTE_HEAL)
|
||||
|
||||
print(6, diff)
|
||||
print(6, diffName)
|
||||
|
||||
for i = 1, GetNumGroupMembers() do
|
||||
local role = UnitGroupRolesAssigned(cachedRaidUnitIds[i])
|
||||
@@ -2058,7 +2072,7 @@ print(1)
|
||||
end
|
||||
end
|
||||
|
||||
print(7, diff)
|
||||
print(7, diffName)
|
||||
|
||||
--add the encounter data
|
||||
tinsert(allEncountersStored, combatResultData)
|
||||
@@ -2068,7 +2082,7 @@ print(1)
|
||||
|
||||
local playerRole = UnitGroupRolesAssigned("player")
|
||||
---@type details_storage_unitresult, details_encounterkillinfo
|
||||
local bestRank, encounterKillInfo = Details222.storage.GetBestFromPlayer(diff, encounterId, playerRole, Details.playername, true) --get dps or hps
|
||||
local bestRank, encounterKillInfo = Details222.storage.GetBestFromPlayer(diffName, encounterId, playerRole, Details.playername, true) --get dps or hps
|
||||
|
||||
if (bestRank and encounterKillInfo) then
|
||||
local registeredBestTotal = bestRank and bestRank.total or 0
|
||||
@@ -2109,7 +2123,7 @@ print(1)
|
||||
end
|
||||
|
||||
local raidName = GetInstanceInfo()
|
||||
local func = {Details.OpenRaidHistoryWindow, Details, raidName, encounterId, diff, playerRole, guildName}
|
||||
local func = {Details.OpenRaidHistoryWindow, Details, raidName, encounterId, diffName, playerRole, guildName}
|
||||
local icon = {[[Interface\PvPRankBadges\PvPRank08]], 16, 16, false, 0, 1, 0, 1}
|
||||
if (not Details.deny_score_messages) then
|
||||
instanceObject:InstanceAlert(Loc ["STRING_GUILDDAMAGERANK_WINDOWALERT"], icon, Details.update_warning_timeout, func, true)
|
||||
|
||||
Reference in New Issue
Block a user