Code changes, see commit description

Combat Objects which has been discarded due to any reason will have the boolean member:  __destroyed set to true. With this change, 3rd party code can see if the data cached is up to date or obsolete.

- Removed several deprecated code from March 2023 and earlier.
- Large amount of code cleanup and refactoring, some functions got renamed, they are listed below:
* TravarTempos renamed to LockActivityTime.
* ClearTempTables renamed to ClearCacheTables.
* SpellIsDot renamed to SetAsDotSpell.
* FlagCurrentCombat remamed to FlagNewCombat_PVPState.
* UpdateContainerCombatentes renamed to UpdatePetCache.
* segmentClass:AddCombat(combatObject) renamed to Details222.Combat.AddCombat(combatToBeAdded)

- CurrentCombat.verifica_combate timer is now obsolete.
- Details.last_closed_combat is now obsolete.
- Details.EstaEmCombate is now obsolete.
- Details.options is now obsolete.

- Added: Details:RemoveSegmentByCombatObject(combatObject)

- Spec Guess Timers are now stored within Details222.GuessSpecSchedules.Schedules, all timers are killed at the end of the combat or at a data reset.

- Initial time to send startup signal reduced from 5 to 4 seconds.

- Fixed some division by zero on ptr 10.1.5.
- Fixed DETAILS_STARTED event not triggering in some cases due to 'event not registered'.
This commit is contained in:
Tercio Jose
2023-06-27 19:01:44 -03:00
parent d3d5154c67
commit 6ccb64863e
23 changed files with 971 additions and 808 deletions
+7 -6
View File
@@ -198,7 +198,7 @@ end
if (actorObject) then
return actorObject.nome, playerGUID, actorObject.flag_original
end
local guidCache = Details:GetParserPlayerCache() --cache exists until the next combat starts
local ownerName = guidCache[playerGUID]
if (ownerName) then
@@ -227,7 +227,7 @@ end
if (actorObject) then
return actorObject.nome, playerGUID, actorObject.flag_original
end
local guidCache = Details:GetParserPlayerCache() --cache exists until the next combat starts
local ownerName = guidCache[playerGUID]
if (ownerName) then
@@ -277,7 +277,7 @@ end
--Details:Msg("(debug) pet found (2)", petName, "owner:", ownerName)
return ownerName, GUID, 0x514
end
if(Details.zone_type == 'arena') then --Attempt to find enemy pet owner
for enemyName, enemyToken in pairs(Details.arena_enemies) do
if(UnitGUID(enemyToken) == ownerGUID) then
@@ -305,7 +305,7 @@ end
ownerName = actorName
ownerFlags = 0x514
else
if (CONST_CLIENT_LANGUAGE == "ruRU") then --If russian client, then test for declensions in the string of text.
for playerName, _ in pairs(Details.tabela_vigente.raid_roster) do
local pName = playerName
@@ -455,7 +455,8 @@ end
end
if (not specId and Details.track_specs) then
Details:ScheduleTimer("GuessSpec", 3, {actorObject, nil, 1})
local newTimer = Details:ScheduleTimer("GuessSpec", 3, {actorObject, nil, 1})
Details222.GuessSpecSchedules.Schedules[#Details222.GuessSpecSchedules.Schedules+1] = newTimer
end
local _, engClass = UnitClass(actorName or "")
@@ -870,7 +871,7 @@ end
end
end
function Details:UpdateContainerCombatentes()
function Details:UpdatePetCache()
container_pets = Details.tabela_pets.pets
Details:UpdatePetsOnParser()
end