Backend improvements

This commit is contained in:
Tercio Jose
2021-02-05 14:21:23 -03:00
parent c72cdea178
commit 87728d0e68
9 changed files with 50 additions and 97 deletions
+4 -80
View File
@@ -4,8 +4,8 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
_detalhes.build_counter = 8192
_detalhes.alpha_build_counter = 8192 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 8203
_detalhes.alpha_build_counter = 8203 --if this is higher than the regular counter, use it instead
_detalhes.dont_open_news = true
_detalhes.game_version = "v9.0.2"
_detalhes.userversion = "v9.0.2." .. _detalhes.build_counter
@@ -152,87 +152,11 @@ do
{Name = "Report What is Shown In the Window", Desc = "Report the current data shown in the window, the number 1 is the window number, replace it to report another window.", MacroText = "/script Details:FastReportWindow(1)"},
}
--> quais raides devem ser guardadas no histrico
_detalhes.InstancesToStoreData = { --> mapIDs
[2070] = true, --Battle for Dazaralor (BFA) GetInstanceInfo
[1148] = true, --Uldir (BFA) uiMapID
[1861] = true, --Uldir (BFA) from GetInstanceInfo
[2164] = true, --Eternal Palace
[2217] = true, --8.3
--> current instances of the exp (need to maintain)
_detalhes.InstancesToStoreData = { --mapId
[2296] = true, --castle narnia
}
--must fail in map and encounter id to not store data
_detalhes.EncountersToStoreData = { --> encounterIDs
--CLEU
[2144] = 1, --Taloc - Taloc
[2141] = 2, --MOTHER - MOTHER
[2128] = 3, --Fetid Devourer - Fetid Devourer
[2136] = 4, --Zek'voz - Zek'voz, Herald of N'zoth
[2134] = 5, --Vectis - Vectis
[2145] = 6, --Zul - Zul, Reborn
[2135] = 7, --Mythrax the Unraveler - Mythrax the Unraveler
[2122] = 8, --G'huun - G'huun
[2265] = 1, --Champion of the Light
[2263] = 2, --Grong, the Jungle Lord
[2266] = 3, --Jadefire Masters
[2271] = 4, --Opulence
[2268] = 5, --Conclave of the Chosen
[2272] = 6, --King Rastakhan
[2276] = 7, --High Tinker Mekkatorque
[2280] = 8, --Stormwall Blockade
[2281] = 9, --Lady Jaina Proudmoore
[2269] = 1, --The Restless Cabal
[2273] = 2, --Uu'nat, Harbinger of the Void
[2298] = 1, --Abyssal Commander Sivara
[2289] = 2, --Blackwater Behemoth
[2305] = 3, --Radiance of Azshara
[2304] = 4, --Lady Ashvane
[2303] = 5, --Orgozoa
[2311] = 6, --The Queen's Court
[2293] = 7, --Za'qul, Harbinger of Ny'alotha
[2299] = 8, --Queen Azshara
--EJID
[2168] = 1, --Taloc
[2167] = 2, --MOTHER
[2146] = 3, --Fetid Devourer
[2169] = 4, --Zek'voz, Herald of N'zoth
[2166] = 5, --Vectis
[2195] = 6, --Zul, Reborn
[2194] = 7, --Mythrax the Unraveler
[2147] = 8, --G'huun
[2333] = 1, --Champion of the Light
[2325] = 2, --Grong, the Jungle Lord
[2341] = 3, --Jadefire Masters
[2342] = 4, --Opulence
[2330] = 5, --Conclave of the Chosen
[2335] = 6, --King Rastakhan
[2334] = 7, --High Tinker Mekkatorque
[2337] = 8, --Stormwall Blockade
[2343] = 9, --Lady Jaina Proudmoore
[2328] = 1, --The Restless Cabal
[2332] = 2, --Uu'nat, Harbinger of the Void
[2352] = 1, --Abyssal Commander Sivara
[2347] = 2, --Blackwater Behemoth
[2353] = 3, --Radiance of Azshara
[2354] = 4, --Lady Ashvane
[2351] = 5, --Orgozoa
[2359] = 6, --The Queen's Court
[2349] = 7, --Za'qul, Harbinger of Ny'alotha
[2361] = 8, --Queen Azshara
}
--> armazena os escudos - Shields information for absorbs
_detalhes.escudos = {}
--> armazena as funes dos frames - Frames functions
+14 -12
View File
@@ -19,7 +19,7 @@ if (DetailsFramework.IsClassicWow()) then
LibGroupInSpecT = false
end
local storageDebug = true --remember to turn this to false!
local storageDebug = false --remember to turn this to false!
local store_instances = _detalhes.InstancesToStoreData
function _detalhes:UpdateGears()
@@ -1034,7 +1034,8 @@ function _detalhes.storage:GetIDsToGuildSync()
end
local IDs = {}
local myGuildName = GetGuildInfo("player")
--build the encounter ID list
for diff, diffTable in pairs (db or {}) do
if (type (diffTable) == "table") then
@@ -1042,7 +1043,9 @@ function _detalhes.storage:GetIDsToGuildSync()
if (encounter_is_current_tier (encounterID)) then
for index, encounter in ipairs (encounterTable) do
if (encounter.servertime) then
tinsert (IDs, encounter.servertime)
if (myGuildName == encounter.guild) then
tinsert (IDs, encounter.servertime)
end
end
end
end
@@ -1514,7 +1517,7 @@ function Details.Database.StoreWipe(combat)
local bossCLEUID = combat.boss_info and combat.boss_info.id
if (not store_instances [mapID] and not _detalhes.EncountersToStoreData [bossCLEUID]) then
if (not store_instances [mapID]) then
if (_detalhes.debug) then
print ("|cFFFFFF00Details! Storage|r: instance not allowed.")
end
@@ -1585,7 +1588,7 @@ function Details.Database.StoreEncounter(combat)
local bossCLEUID = combat.boss_info and combat.boss_info.id
if (not store_instances [mapID] and not _detalhes.EncountersToStoreData [bossCLEUID]) then
if (not store_instances [mapID]) then
if (_detalhes.debug) then
print ("|cFFFFFF00Details! Storage|r: instance not allowed.")
end
@@ -1668,25 +1671,24 @@ function Details.Database.StoreEncounter(combat)
end
--> check for heroic and mythic
if (storageDebug or (diff == 15 or diff == 16 or diff == 17)) then --test on raid finder: ' or diff == 17' -- normal mode: diff == 14 or
if (storageDebug or (diff == 15 or diff == 16 or diff == 14)) then --test on raid finder: ' or diff == 17' -- normal mode: diff == 14 or
--> check the guild name
local match = 0
local guildName = select (1, GetGuildInfo ("player"))
local raid_size = GetNumGroupMembers() or 0
local guildName = GetGuildInfo ("player")
local raidSize = GetNumGroupMembers() or 0
if (not storageDebug) then
if (guildName) then
for i = 1, raid_size do
local gName = select (1, GetGuildInfo ("raid" .. i)) or ""
for i = 1, raidSize do
local gName = GetGuildInfo("raid" .. i) or ""
if (gName == guildName) then
match = match + 1
end
end
if (match < raid_size * 0.75 and not storageDebug) then
if (match < raidSize * 0.75 and not storageDebug) then
if (_detalhes.debug) then
print ("|cFFFFFF00Details! Storage|r: can't save the encounter, need at least 75% of players be from your guild.")
end
-2
View File
@@ -758,8 +758,6 @@
if not IsInGuild() then return end --> fix from Tim@WoWInterface
_detalhes:SendCommMessage (DETAILS_PREFIX_NETWORK, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "GUILD")
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> cloud
+5 -2
View File
@@ -4522,6 +4522,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
local encounterID, encounterName, difficultyID, raidSize = _select (1, ...)
local zoneName, _, _, _, _, _, _, zoneMapID = _GetInstanceInfo()
if (_detalhes.InstancesToStoreData[zoneMapID]) then
Details.current_exp_raid_encounters[encounterID] = true
end
if (not _detalhes.WhoAggroTimer and _detalhes.announce_firsthit.enabled) then
_detalhes.WhoAggroTimer = C_Timer.NewTimer (0.5, who_aggro)
@@ -4540,8 +4545,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
local dbm_mod, dbm_time = _detalhes.encounter_table.DBM_Mod, _detalhes.encounter_table.DBM_ModTime
_table_wipe (_detalhes.encounter_table)
local zoneName, _, _, _, _, _, _, zoneMapID = _GetInstanceInfo()
--print (encounterID, encounterName, difficultyID, raidSize)
_detalhes.encounter_table.phase = 1
+4
View File
@@ -238,6 +238,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
--received one encounter table
elseif (guildSyncID == "A") then
if (not f.RequestedAmount) then
--if the receiving player reloads, f.RequestedAmount is nil
return
end
f.DownloadedAmount = (f.DownloadedAmount or 0) + 1
--size = 1 byte per characters in the string
+11
View File
@@ -689,16 +689,27 @@ function DetailsMythicPlusFrame.OnChallengeModeStart()
if (difficulty == 8 and DetailsMythicPlusFrame.LastTimer and DetailsMythicPlusFrame.LastTimer+2 > GetTime()) then
--> start the dungeon on Details!
DetailsMythicPlusFrame.MythicDungeonStarted()
--print("D! mythic dungeon started!")
else
--print("D! mythic dungeon was already started!")
--> from zone changed
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
local zoneName, _, _, _, _, _, _, currentZoneID = GetInstanceInfo()
--print("Details.MythicPlus.Started", Details.MythicPlus.Started)
--print("Details.MythicPlus.DungeonID", Details.MythicPlus.DungeonID)
--print("currentZoneID", currentZoneID)
--print("Details.MythicPlus.Level", Details.MythicPlus.Level)
--print("mythicLevel", mythicLevel)
if (not Details.MythicPlus.Started and Details.MythicPlus.DungeonID == currentZoneID and Details.MythicPlus.Level == mythicLevel) then
Details.MythicPlus.Started = true
Details.MythicPlus.EndedAt = nil
_detalhes.mythic_dungeon_currentsaved.started = true
DetailsMythicPlusFrame.IsDoingMythicDungeon = true
--print("D! mythic dungeon was NOT already started! debug 2")
end
end
end
+10 -1
View File
@@ -1246,6 +1246,7 @@ local default_global_data = {
["13"] = false,
["14"] = false,
},
current_exp_raid_encounters = {},
--> death log
show_totalhitdamage_on_overkill = false,
@@ -1473,10 +1474,10 @@ function _detalhes:RestoreState_CurrentMythicDungeonRun()
local savedTable = _detalhes.mythic_dungeon_currentsaved
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
local zoneName, _, _, _, _, _, _, currentZoneID = GetInstanceInfo()
local mapID = C_Map.GetBestMapForUnit ("player")
if (not mapID) then
--print("D! no mapID to restored mythic dungeon state.")
return
end
@@ -1503,16 +1504,24 @@ function _detalhes:RestoreState_CurrentMythicDungeonRun()
_detalhes.MythicPlus.PreviousBossKilledAt = savedTable.previous_boss_killed_at
_detalhes.MythicPlus.IsRestoredState = true
DetailsMythicPlusFrame.IsDoingMythicDungeon = true
print("D! (debug) mythic dungeon state restored.")
C_Timer.After (2, function()
_detalhes:SendEvent ("COMBAT_MYTHICDUNGEON_START")
end)
return
else
print("D! (debug) mythic level isn't equal.", mythicLevel, savedTable.level)
end
else
print("D! (debug) zone name or zone Id isn't the same:", zoneName, savedTable.dungeon_name, currentZoneID, savedTable.dungeon_zone_id)
end
--> mythic run is over
savedTable.started = false
else
--print("D! savedTable.stated isn't true.")
end
end
+2
View File
@@ -112,6 +112,8 @@ do
[339538] = {name = GetSpellInfo (224266) .. " (Templar's Vindication)"}, --
[108271] = {name = GetSpellInfo (108271), icon = "Interface\\Addons\\Details\\images\\icon_astral_shift"}, --
--> shadowlands trinkets
[345020] = {name = GetSpellInfo (345020) .. " (Trinket)"},
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB