- bug fixes.

This commit is contained in:
Tercio
2018-08-16 22:05:10 -03:00
parent 00d306a7b3
commit e3e63dcd67
7 changed files with 93 additions and 37 deletions
+14 -5
View File
@@ -443,6 +443,19 @@
end
end
function _detalhes:ScheduleSyncPlayerActorData()
if ((IsInGroup() or IsInRaid()) and (_detalhes.zone_type == "party" or _detalhes.zone_type == "raid")) then
--> do not sync if in battleground or arena
_detalhes:SendCharacterData()
end
end
function _detalhes:EndCombat()
if (_detalhes.in_combat) then
_detalhes:SairDoCombate()
end
end
-- ~end ~leave
function _detalhes:SairDoCombate (bossKilled, from_encounter_end)
@@ -573,11 +586,7 @@
end
--> send item level after a combat if is in raid or party group
if (IsInGroup() or IsInRaid()) then
C_Timer.After (1, function()
_detalhes:SentMyItemLevel()
end)
end
C_Timer.After (1, _detalhes.ScheduleSyncPlayerActorData)
if (not _detalhes.tabela_vigente.is_boss) then
+6 -2
View File
@@ -1726,6 +1726,9 @@ function _detalhes:IlvlFromNetwork (player, realm, core, serialNumber, itemLevel
return
end
--> won't inspect this actor
_detalhes.trusted_characters [serialNumber] = true
if (type (serialNumber) ~= "string") then
return
end
@@ -2063,7 +2066,8 @@ function ilvl_core:Loop()
return
end
if (inspecting [guid]) then
--> if already inspecting or the actor is in the list of trusted actors
if (inspecting [guid] or _detalhes.trusted_characters [guid]) then
return
end
@@ -2107,7 +2111,7 @@ end
function ilvl_core:OnEnter()
if (IsInRaid()) then
_detalhes:SentMyItemLevel()
_detalhes:SendCharacterData()
end
if (can_start_loop()) then
+34 -4
View File
@@ -76,7 +76,7 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> item level
function _detalhes:SentMyItemLevel()
function _detalhes:SendCharacterData()
--> only send if in group
if (not IsInGroup() and not IsInRaid()) then
return
@@ -124,7 +124,18 @@
--> get the character serial number
local serial = UnitGUID ("player")
_detalhes:SendRaidData (CONST_ITEMLEVEL_DATA, serial, equipped, talents, currentSpec)
if (IsInRaid()) then
_detalhes:SendRaidData (CONST_ITEMLEVEL_DATA, serial, equipped, talents, currentSpec)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent ilevel data to Raid")
end
elseif (IsInGroup()) then
_detalhes:SendPartyData (CONST_ITEMLEVEL_DATA, serial, equipped, talents, currentSpec)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent ilevel data to Party")
end
end
_detalhes.LastPlayerInfoSync = GetTime()
end
@@ -624,19 +635,38 @@
end
function _detalhes:SendRaidData (type, ...)
if (IsInRaid (LE_PARTY_CATEGORY_INSTANCE) and IsInInstance()) then
local isInInstanceGroup = IsInRaid (LE_PARTY_CATEGORY_INSTANCE)
if (isInInstanceGroup) then
_detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "INSTANCE_CHAT")
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent comm to INSTANCE raid group")
end
else
_detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "RAID")
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent comm to LOCAL raid group")
end
end
end
function _detalhes:SendPartyData (type, ...)
if (IsInGroup (LE_PARTY_CATEGORY_INSTANCE) and IsInInstance()) then
local isInInstanceGroup = IsInGroup (LE_PARTY_CATEGORY_INSTANCE)
if (isInInstanceGroup) then
_detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "INSTANCE_CHAT")
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent comm to INSTANCE party group")
end
else
_detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "PARTY")
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent comm to LOCAL party group")
end
end
end
function _detalhes:SendRaidOrPartyData (type, ...)
+18 -15
View File
@@ -4051,19 +4051,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
return _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA (...)
end
function _detalhes.parser_functions:PLAYER_SPECIALIZATION_CHANGED()
local specIndex = GetSpecialization()
if (specIndex) then
local specID = GetSpecializationInfo (specIndex)
if (specID and specID ~= 0) then
local guid = UnitGUID ("player")
if (guid) then
_detalhes.cached_specs [guid] = specID
end
end
end
end
-- ~encounter
function _detalhes.parser_functions:ENCOUNTER_START (...)
if (_detalhes.debug) then
@@ -4361,18 +4348,29 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes.SendTalentTimer:Cancel()
end
_detalhes.SendTalentTimer = C_Timer.NewTimer (11, function()
_detalhes:SentMyItemLevel()
_detalhes:SendCharacterData()
end)
end
end
function _detalhes.parser_functions:PLAYER_SPECIALIZATION_CHANGED()
local specIndex = GetSpecialization()
if (specIndex) then
local specID = GetSpecializationInfo (specIndex)
if (specID and specID ~= 0) then
local guid = UnitGUID ("player")
if (guid) then
_detalhes.cached_specs [guid] = specID
end
end
end
if (IsInGroup() or IsInRaid()) then
if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer._cancelled) then
_detalhes.SendTalentTimer:Cancel()
end
_detalhes.SendTalentTimer = C_Timer.NewTimer (11, function()
_detalhes:SentMyItemLevel()
_detalhes:SendCharacterData()
end)
end
end
@@ -4459,6 +4457,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:SendEvent ("GROUP_ONENTER")
_detalhes:DispatchAutoRunCode ("on_groupchange")
wipe (_detalhes.trusted_characters)
C_Timer.After (5, _detalhes.ScheduleSyncPlayerActorData)
end
else
_detalhes.in_group = IsInGroup() or IsInRaid()
@@ -4473,6 +4474,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:SendEvent ("GROUP_ONLEAVE")
_detalhes:DispatchAutoRunCode ("on_groupchange")
wipe (_detalhes.trusted_characters)
else
_detalhes:SchedulePetUpdate (2)
end