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
+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