Finished the first 'Alpha Version' of the Coach feature

This commit is contained in:
Tercio Jose
2020-12-19 19:25:11 -03:00
parent 4d1747f8a8
commit ec5fad443a
9 changed files with 318 additions and 308 deletions
+4 -18
View File
@@ -412,14 +412,8 @@
return false
end
if (msgType == "CIEA") then --Coach Is Enabled Ask (regular player asked to raid leader)
--check if the player that received the msg is the raid leader
if (UnitIsGroupLeader("player")) then
return
end
--send the answer
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(DETAILS_PREFIX_COACH, playerName, GetRealmName(), Details.realversion, "CIER", Details.Coach.Server.IsEnabled()), "WHISPER", sourcePlayer)
if (msgType == "CIEA") then --Is Coach Enabled Ask (regular player asked to raid leader)
Details.Coach.Server.CoachIsEnabled_Answer(sourcePlayer)
elseif (msgType == "CIER") then --Coach Is Enabled Response (regular player received a raid leader response)
local isEnabled = data
@@ -444,22 +438,14 @@
if (UnitIsGroupLeader("player")) then
if (Details.Coach.Server.IsEnabled()) then
--update the current combat with new information
--this is disabled due to lack of testing
if (_detalhes.debug) then
Details.packFunctions.DeployPackedCombatData(data)
end
Details.packFunctions.DeployPackedCombatData(data)
end
end
elseif (msgType == "CDD") then --Coach Death (a player in the raid sent to raid leader his death log)
if (UnitIsGroupLeader("player")) then
if (Details.Coach.Server.IsEnabled()) then
local currentCombat = Details:GetCurrentCombat()
tinsert(currentCombat.last_events_tables, data)
--tag the misc container as need refresh
currentCombat[DETAILS_ATTRIBUTE_MISC].need_refresh = true
Details.Coach.Server.AddPlayerDeath(sourcePlayer, data)
end
end
end