You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

670 lines
23 KiB

4 years ago
local Details = _G.Details
3 years ago
local Loc = LibStub("AceLocale-3.0"):GetLocale( "Details" )
4 years ago
local _
3 years ago
---@type detailsframework
local detailsFramework = DetailsFramework
3 years ago
--register namespace
Details.network = {}
4 years ago
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--local pointers
4 years ago
3 years ago
local UnitName = UnitName
local GetRealmName = GetRealmName
local select = select
4 years ago
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--constants
4 years ago
3 years ago
_G.DETAILS_PREFIX_NETWORK = "DTLS"
4 years ago
local CONST_HIGHFIVE_REQUEST = "HI"
local CONST_HIGHFIVE_DATA = "HF"
3 years ago
4 years ago
local CONST_VERSION_CHECK = "CV"
3 years ago
4 years ago
local CONST_ITEMLEVEL_DATA = "IL"
3 years ago
4 years ago
local CONST_WIPE_CALL = "WI"
3 years ago
4 years ago
local CONST_GUILD_SYNC = "GS"
3 years ago
4 years ago
local CONST_CLOUD_REQUEST = "CR"
local CONST_CLOUD_FOUND = "CF"
local CONST_CLOUD_DATARQ = "CD"
local CONST_CLOUD_DATARC = "CE"
local CONST_CLOUD_EQUALIZE = "EQ"
3 years ago
4 years ago
local CONST_CLOUD_SHAREDATA = "SD"
3 years ago
4 years ago
local CONST_PVP_ENEMY = "PP"
3 years ago
4 years ago
local CONST_ROGUE_SR = "SR" --soul rip from akaari's soul (LEGION ONLY)
3 years ago
_G.DETAILS_PREFIX_COACH = "CO" --coach feature
_G.DETAILS_PREFIX_TBC_DATA = "BC" --tbc data
Details.network.ids = {
4 years ago
["HIGHFIVE_REQUEST"] = CONST_HIGHFIVE_REQUEST,
["HIGHFIVE_DATA"] = CONST_HIGHFIVE_DATA,
["VERSION_CHECK"] = CONST_VERSION_CHECK,
["ITEMLEVEL_DATA"] = CONST_ITEMLEVEL_DATA,
["CLOUD_REQUEST"] = CONST_CLOUD_REQUEST,
["CLOUD_FOUND"] = CONST_CLOUD_FOUND,
["CLOUD_DATARQ"] = CONST_CLOUD_DATARQ,
["CLOUD_DATARC"] = CONST_CLOUD_DATARC,
["CLOUD_EQUALIZE"] = CONST_CLOUD_EQUALIZE,
3 years ago
4 years ago
["WIPE_CALL"] = CONST_WIPE_CALL,
3 years ago
4 years ago
["GUILD_SYNC"] = CONST_GUILD_SYNC,
3 years ago
4 years ago
["PVP_ENEMY"] = CONST_PVP_ENEMY,
3 years ago
4 years ago
["MISSDATA_ROGUE_SOULRIP"] = CONST_ROGUE_SR, --soul rip from akaari's soul (LEGION ONLY)
3 years ago
4 years ago
["CLOUD_SHAREDATA"] = CONST_CLOUD_SHAREDATA,
["COACH_FEATURE"] = DETAILS_PREFIX_COACH, --ask the raid leader is the coach is enbaled
["TBC_DATA"] = DETAILS_PREFIX_TBC_DATA, --get basic information about the player
}
3 years ago
local registredPlugins = {}
4 years ago
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--comm functions
4 years ago
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--item level
local getHorizontalTalentsAsString = function()
local talents = ""
for i = 1, 7 do
for o = 1, 3 do
local talentID, name, texture, selected, available = GetTalentInfo(i, o, 1)
if (selected) then
talents = "" .. talentID .. ","
break
end
end
end
--remove the comma after the last talent id
if (talents:sub(-1) == ",") then
talents = talents:sub(1, -2)
end
return talents
end
---send item level data to the group the player is in
---@param self details
---@return nil
3 years ago
function Details:SendCharacterData()
--only send if in group
4 years ago
if (not IsInGroup() and not IsInRaid()) then
return
end
3 years ago
4 years ago
if (DetailsFramework.IsTimewalkWoW()) then
return
end
3 years ago
--check the player level to be at least 60
---@type number
3 years ago
local playerLevel = UnitLevel("player")
4 years ago
if (not playerLevel) then
return
elseif (playerLevel < 60) then
return
end
3 years ago
--delay to sent information again
if (Details.LastPlayerInfoSync and Details.LastPlayerInfoSync + 10 > GetTime()) then
--do not send info if it was recently sent
4 years ago
return
end
3 years ago
--get the equipped player item level
4 years ago
local overall, equipped = GetAverageItemLevel()
3 years ago
local talentsAsString = ""
3 years ago
--get player talents
--depending on the game version, the talent API is different
--vertical tree
if (DetailsFramework.IsClassicWow()) then --vanilla
talentsAsString = ""
elseif (DetailsFramework.IsTBCWow()) then --burning crusade
talentsAsString = ""
elseif (DetailsFramework.IsWotLKWow()) then --wrath of the lich king
talentsAsString = ""
elseif (DetailsFramework.IsCataWow()) then --cataclysm
talentsAsString = ""
end
--horizontal pick one
if (DetailsFramework.IsPandaWow()) then
talentsAsString = getHorizontalTalentsAsString()
elseif (DetailsFramework.IsWarlordsWow()) then
talentsAsString = getHorizontalTalentsAsString()
elseif (DetailsFramework.IsLegionWow()) then
talentsAsString = getHorizontalTalentsAsString()
elseif (DetailsFramework.IsBFAWow()) then
talentsAsString = getHorizontalTalentsAsString()
elseif (DetailsFramework.IsShadowlandsWow()) then
talentsAsString = getHorizontalTalentsAsString()
end
--vertical, horizonal tree
if (DetailsFramework.IsDragonflight()) then
talentsAsString = detailsFramework:GetDragonlightTalentString()
4 years ago
end
3 years ago
--get the spec ID
4 years ago
local spec = DetailsFramework.GetSpecialization()
local currentSpec
if (spec) then
3 years ago
local specID = DetailsFramework.GetSpecializationInfo(spec)
4 years ago
if (specID and specID ~= 0) then
currentSpec = specID
end
end
3 years ago
--get the character serial number
local serial = UnitGUID("player")
4 years ago
if (IsInRaid()) then
Details:SendRaidData(CONST_ITEMLEVEL_DATA, serial, equipped, talentsAsString, currentSpec)
3 years ago
if (Details.debugnet) then
Details:Msg("(debug) sent ilevel data to Raid")
4 years ago
end
3 years ago
4 years ago
elseif (IsInGroup()) then
Details:SendPartyData(CONST_ITEMLEVEL_DATA, serial, equipped, talentsAsString, currentSpec)
3 years ago
if (Details.debugnet) then
Details:Msg("(debug) sent ilevel data to Party")
4 years ago
end
end
3 years ago
Details.LastPlayerInfoSync = GetTime()
4 years ago
end
3 years ago
function Details.network.ItemLevel_Received(player, realm, coreVersion, serial, itemlevel, talents, spec)
Details:IlvlFromNetwork(player, realm, coreVersion, serial, itemlevel, talents, spec)
4 years ago
end
3 years ago
--high five
function Details.network.HighFive_Request()
return Details:SendRaidData(CONST_HIGHFIVE_DATA, Details.userversion)
4 years ago
end
3 years ago
function Details.network.HighFive_DataReceived(player, realm, coreVersion, userVersion)
if (Details.sent_highfive and Details.sent_highfive + 30 > GetTime()) then
Details.users[#Details.users+1] = {player, realm, (userVersion or "") .. " (" .. coreVersion .. ")"}
4 years ago
end
end
3 years ago
function Details.network.Update_VersionReceived(player, realm, coreVersion, buildNumber)
if (Details.debugnet) then
Details:Msg("(debug) received version alert ", buildNumber)
4 years ago
end
3 years ago
if (Details.streamer_config.no_alerts) then
4 years ago
return
end
3 years ago
buildNumber = tonumber(buildNumber)
if (not Details.build_counter or not Details.lastUpdateWarning or not buildNumber) then
4 years ago
return
end
3 years ago
if (buildNumber > Details.build_counter) then
if (time() > Details.lastUpdateWarning + 72000) then
local lowerInstanceId = Details:GetLowerInstanceNumber()
if (lowerInstanceId) then
local instance = Details:GetInstance(lowerInstanceId)
if (instance) then
instance:InstanceAlert("Update Available!", {[[Interface\GossipFrame\AvailableQuestIcon]], 16, 16, false}, Details.update_warning_timeout, {Details.OpenUpdateWindow})
4 years ago
end
end
3 years ago
Details:Msg(Loc["STRING_VERSION_AVAILABLE"])
Details.lastUpdateWarning = time()
4 years ago
end
end
end
3 years ago
function Details.network.Cloud_Request(player, realm, coreVersion, ...)
--deprecated
4 years ago
end
3 years ago
function Details.network.Cloud_Found(player, realm, coreVersion, ...)
--deprecated
end
4 years ago
3 years ago
function Details.network.Cloud_DataRequest(player, realm, coreVersion, ...)
--deprecated
end
4 years ago
3 years ago
function Details.network.Cloud_DataReceived(player, realm, coreVersion, ...)
--deprecated
4 years ago
end
3 years ago
function Details.network.Cloud_Equalize(player, realm, coreVersion, data)
--deprecated
4 years ago
end
3 years ago
function Details.network.Wipe_Call(player, realm, coreVersion, ...)
4 years ago
local chr_name = Ambiguate(player, "none")
if (UnitIsGroupLeader (chr_name)) then
if (UnitIsInMyGuild (chr_name)) then
3 years ago
Details:CallWipe()
4 years ago
end
end
end
3 years ago
function Details.network.Cloud_SharedData(player, realm, coreVersion, data)
--deprecated
4 years ago
end
3 years ago
function Details.network.TBCData(player, realm, coreVersion, data)
4 years ago
if (not IsInRaid() and not IsInGroup()) then
return
end
local LibDeflate = _G.LibStub:GetLibrary("LibDeflate")
local dataCompressed = LibDeflate:DecodeForWoWAddonChannel(data)
local dataSerialized = LibDeflate:DecompressDeflate(dataCompressed)
local dataTable = {Details:Deserialize(dataSerialized)}
tremove(dataTable, 1)
local dataTable = dataTable[1]
local playerRole = dataTable[1]
local spec = dataTable[2]
local itemLevel = dataTable[3]
local talents = dataTable[4]
local guid = dataTable[5]
--[=[
print("Details! Received TBC Comm Data:")
print("From:", player)
print("spec:", spec)
print("role:", playerRole)
print("item level:", itemLevel)
print("guid:", guid)
--]=]
if (guid) then
3 years ago
Details.cached_talents[guid] = talents
if (spec and spec ~= 0) then
3 years ago
Details.cached_specs[guid] = spec
end
3 years ago
Details.cached_roles[guid] = playerRole
Details.item_level_pool[guid] = {
name = player,
ilvl = itemLevel,
time = time()
}
4 years ago
end
end
--"CIEA" Coach Is Enabled Ask (client > server)
--"CIER" Coach Is Enabled Response (server > client)
--"CCS" Coach Combat Start (client > server)
3 years ago
function Details.network.Coach(player, realm, coreVersion, msgType, data)
4 years ago
if (not IsInRaid()) then
return
end
3 years ago
if (Details.debugnet) then
print("Details Coach Received Comm", player, realm, coreVersion, msgType, data)
4 years ago
end
local sourcePlayer = Ambiguate(player, "none")
3 years ago
4 years ago
local playerName = UnitName("player")
if (playerName == sourcePlayer) then
3 years ago
if (Details.debugnet) then
4 years ago
print("Details Coach Received Comm | RETURN | playerName == sourcePlayer", playerName , sourcePlayer)
end
return
end
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
Details.Coach.Client.CoachIsEnabled_Response(isEnabled, sourcePlayer)
elseif (msgType == "CCS") then --Coach Combat Start (raid assistant told the raid leader a combat started)
Details.Coach.Server.CombatStarted()
elseif (msgType == "CCE") then --Coach Combat End (raid assistant told the raid leader a combat ended)
Details.Coach.Server.CombatEnded()
elseif (msgType == "CS") then --Coach Start (raid leader notifying other members of the group)
3 years ago
if (Details.debugnet) then
4 years ago
print("Details Coach received 'CE' a new coach is active, coach name:", sourcePlayer)
end
Details.Coach.Client.EnableCoach(sourcePlayer)
elseif (msgType == "CE") then --Coach End (raid leader notifying other members of the group)
Details.Coach.Client.CoachEnd()
elseif (msgType == "CDT") then --Coach Data (a player in the raid sent to raid leader combat data)
if (Details.Coach.Server.IsEnabled()) then
--update the current combat with new information
Details.packFunctions.DeployPackedCombatData(data)
end
elseif (msgType == "CDD") then --Coach Death (a player in the raid sent to raid leader his death log)
if (Details.Coach.Server.IsEnabled()) then
Details.Coach.Server.AddPlayerDeath(sourcePlayer, data)
end
end
end
--guild sync R = someone pressed the sync button
--guild sync L = list of fights IDs
--guild sync G = requested a list of encounters
--guild sync A = received missing encounters, add them
3 years ago
function Details.network.GuildSync(sourceName, realm, coreVersion, type, data)
local characterName = Ambiguate(sourceName, "none")
3 years ago
if (UnitName("player") == sourceName) then
--return
4 years ago
end
3 years ago
if (coreVersion ~= Details.realversion) then
--return false
4 years ago
end
3 years ago
4 years ago
if (type == "R") then --RoS - somebody requested IDs of stored encounters
3 years ago
Details.LastGuildSyncDataTime1 = Details.LastGuildSyncDataTime1 or 0
4 years ago
--build our table and send to the player
3 years ago
if (Details.LastGuildSyncDataTime1 > GetTime()) then
4 years ago
--return false
end
3 years ago
local IDs = Details222.storage.GetIDsToGuildSync()
4 years ago
if (IDs and IDs [1]) then
local from = UnitName("player")
4 years ago
local realm = GetRealmName()
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(CONST_GUILD_SYNC, from, realm, Details.realversion, "L", IDs), "WHISPER", sourceName)
4 years ago
end
3 years ago
Details.LastGuildSyncDataTime1 = GetTime() + 60
4 years ago
return true
3 years ago
4 years ago
elseif (type == "L") then --RoC - the player received the IDs list and send back which IDs he doesn't have
local missingIds = Details222.storage.CheckMissingIDsToGuildSync(data)
3 years ago
if (missingIds and missingIds[1]) then
4 years ago
local from = UnitName ("player")
local realm = GetRealmName()
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(CONST_GUILD_SYNC, from, realm, Details.realversion, "G", missingIds), "WHISPER", sourceName)
4 years ago
end
return true
3 years ago
4 years ago
elseif (type == "G") then --RoS - the 'server' send the encounter dps table to the player which requested
local encounterData = Details222.storage.BuildEncounterDataToGuildSync(data)
3 years ago
if (encounterData and encounterData[1]) then
local task = C_Timer.NewTicker(4, function(task)
4 years ago
task.TickID = task.TickID + 1
3 years ago
local data = task.EncounterData[task.TickID]
4 years ago
if (not data) then
task:Cancel()
return
end
3 years ago
local from = UnitName("player")
4 years ago
local realm = GetRealmName()
--todo: need to check if the target is still online
3 years ago
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(CONST_GUILD_SYNC, from, realm, Details.realversion, "A", data), "WHISPER", task.Target)
if (Details.debugnet) then
Details:Msg("(debug) [RoS-EncounterSync] send-task sending data #" .. task.TickID .. ".")
4 years ago
end
end)
3 years ago
4 years ago
task.TickID = 0
3 years ago
task.EncounterData = encounterData
task.Target = characterName
end
4 years ago
return true
3 years ago
4 years ago
elseif (type == "A") then --RoC - the player received the dps table and should now add it to the db
Details222.storage.AddGuildSyncData(data, player)
4 years ago
return true
end
3 years ago
end
function Details.network.ReceivedEnemyPlayer(player, realm, coreVersion, data)
--deprecated
end
Details.network.functions = {
[CONST_HIGHFIVE_REQUEST] = Details.network.HighFive_Request,
[CONST_HIGHFIVE_DATA] = Details.network.HighFive_DataReceived,
[CONST_VERSION_CHECK] = Details.network.Update_VersionReceived,
[CONST_ITEMLEVEL_DATA] = Details.network.ItemLevel_Received,
[CONST_CLOUD_REQUEST] = Details.network.Cloud_Request,
[CONST_CLOUD_FOUND] = Details.network.Cloud_Found,
[CONST_CLOUD_DATARQ] = Details.network.Cloud_DataRequest,
[CONST_CLOUD_DATARC] = Details.network.Cloud_DataReceived,
[CONST_CLOUD_EQUALIZE] = Details.network.Cloud_Equalize,
[CONST_WIPE_CALL] = Details.network.Wipe_Call,
[CONST_GUILD_SYNC] = Details.network.GuildSync,
[CONST_PVP_ENEMY] = Details.network.ReceivedEnemyPlayer,
[DETAILS_PREFIX_COACH] = Details.network.Coach, --coach feature
[DETAILS_PREFIX_TBC_DATA] = Details.network.TBCData
4 years ago
}
3 years ago
4 years ago
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--register comm
function Details:CommReceived(commPrefix, data, channel, source)
local deserializedTable = {Details:Deserialize(data)}
if (not deserializedTable[1]) then
if (Details.debugnet) then
Details:Msg("(debug) network deserialize |cFFFF0000failed|r, from:", source, Details:Deserialize(data))
end
return
end
tremove(deserializedTable, 1)
local prefix, player, realm, coreVersion, arg6, arg7, arg8, arg9 = unpack(deserializedTable)
4 years ago
player = source
3 years ago
if (Details.debugnet) then
Details:Msg("(debug) network received prefix:", prefix, "length:", string.len(data), source)
4 years ago
end
3 years ago
if (type(prefix) ~= "string") then
if (Details.debugnet) then
Details:Msg("(debug) network |cFFFF0000failed|r: prefix isn't a string", prefix, "length:", string.len(data))
end
return
elseif (type(coreVersion) ~= "number") then
if (Details.debugnet) then
Details:Msg("(debug) network |cFFFF0000failed|r: coreVersion isn't a number", prefix, "length:", string.len(data))
end
return
end
4 years ago
--event
3 years ago
Details:SendEvent("COMM_EVENT_RECEIVED", nil, string.len(data), prefix, player, realm, coreVersion, arg6, arg7, arg8, arg9)
local func = Details.network.functions[prefix]
4 years ago
if (func) then
3 years ago
local callName = "CommReceived|" .. prefix .. "|" .. coreVersion .. "|" .. Details:GetCoreVersion()
Details.SafeRun(func, callName, player, realm, coreVersion, arg6, arg7, arg8, arg9)
4 years ago
else
3 years ago
func = registredPlugins[prefix]
4 years ago
if (func) then
3 years ago
local callName = "CommReceived|Plugin|" .. prefix .. "|" .. coreVersion .. "|" .. Details:GetCoreVersion()
Details.SafeRun(func, callName, player, realm, coreVersion, arg6, arg7, arg8, arg9)
4 years ago
else
3 years ago
if (Details.debugnet) then
Details:Msg("comm prefix not found:", prefix)
4 years ago
end
end
end
end
3 years ago
Details:RegisterComm("DTLS", "CommReceived")
--hook the send comm message so we can trigger events when sending data
--this adds overhead, but easily catches all outgoing comm messages
hooksecurefunc(Details, "SendCommMessage", function(context, addonPrefix, serializedData, channel)
4 years ago
--unpack data
3 years ago
local prefix, player, realm, coreVersion, arg6, arg7, arg8, arg9 = select(2, Details:Deserialize(serializedData))
4 years ago
--send the event
3 years ago
Details:SendEvent("COMM_EVENT_SENT", nil, string.len(serializedData), prefix, player, realm, coreVersion, arg6, arg7, arg8, arg9)
4 years ago
end)
3 years ago
function Details:RegisterPluginComm(prefix, func)
assert(type(prefix) == "string" and string.len(prefix) >= 2 and string.len(prefix) <= 4, "RegisterPluginComm expects a string with 2-4 characters on #1 argument.")
assert(type(func) == "function" or (type(func) == "string" and type(self[func]) == "function"), "RegisterPluginComm expects a function or function name on #2 argument.")
assert(registredPlugins[prefix] == nil, "Prefix " .. prefix .. " already in use 1.")
assert(Details.network.functions[prefix] == nil, "Prefix " .. prefix .. " already in use 2.")
if (type(func) == "string") then
registredPlugins[prefix] = self[func]
4 years ago
else
3 years ago
registredPlugins[prefix] = func
4 years ago
end
return true
end
3 years ago
function Details:UnregisterPluginComm(prefix)
registredPlugins[prefix] = nil
4 years ago
return true
end
3 years ago
4 years ago
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--send functions
4 years ago
3 years ago
function Details:GetChannelId(channel)
--deprecated
4 years ago
end
3 years ago
function Details.parser_functions:CHAT_MSG_CHANNEL(...)
--deprecated
4 years ago
end
3 years ago
function Details:SendPluginCommMessage(prefix, channel, ...)
4 years ago
if (channel == "RAID") then
if (IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and IsInInstance()) then
3 years ago
Details:SendCommMessage(prefix, Details:Serialize(self.__version, ...), "INSTANCE_CHAT")
4 years ago
else
3 years ago
Details:SendCommMessage(prefix, Details:Serialize(self.__version, ...), "RAID")
4 years ago
end
3 years ago
4 years ago
elseif (channel == "PARTY") then
if (IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and IsInInstance()) then
3 years ago
Details:SendCommMessage(prefix, Details:Serialize(self.__version, ...), "INSTANCE_CHAT")
4 years ago
else
3 years ago
Details:SendCommMessage(prefix, Details:Serialize(self.__version, ...), "PARTY")
4 years ago
end
else
3 years ago
Details:SendCommMessage(prefix, Details:Serialize(self.__version, ...), channel)
4 years ago
end
3 years ago
4 years ago
return true
end
3 years ago
--send as
function Details:SendRaidDataAs(type, player, realm, ...)
--deprecated
4 years ago
end
3 years ago
function Details:SendHomeRaidData(type, ...)
4 years ago
if (IsInRaid(LE_PARTY_CATEGORY_HOME) and IsInInstance()) then
3 years ago
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "RAID")
4 years ago
end
end
3 years ago
function Details:SendRaidData(type, ...)
local isInInstanceGroup = IsInRaid(LE_PARTY_CATEGORY_INSTANCE)
4 years ago
if (isInInstanceGroup) then
3 years ago
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "INSTANCE_CHAT")
4 years ago
else
3 years ago
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "RAID")
4 years ago
end
end
3 years ago
function Details:SendPartyData(type, ...)
local prefix = DETAILS_PREFIX_NETWORK
local data = Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...)
local channel = IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and "INSTANCE_CHAT" or "PARTY"
Details:SendCommMessage(prefix, data, channel)
4 years ago
end
3 years ago
function Details:SendRaidOrPartyData(type, ...)
4 years ago
if (IsInRaid()) then
3 years ago
Details:SendRaidData(type, ...)
4 years ago
elseif (IsInGroup()) then
3 years ago
Details:SendPartyData(type, ...)
4 years ago
end
end
3 years ago
function Details:SendGuildData(type, ...)
if not IsInGuild() then return end --fix from Tim@WoWInterface
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "GUILD")
4 years ago
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--cloud
4 years ago
3 years ago
function Details:SendCloudRequest()
--deprecated
4 years ago
end
3 years ago
function Details:ScheduleSendCloudRequest()
--deprecated
end
4 years ago
3 years ago
function Details:RequestCloudData()
--deprecated
4 years ago
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--update
4 years ago
3 years ago
function Details:CheckVersion(sendToGuild)
4 years ago
if (IsInRaid()) then
3 years ago
Details:SendRaidData(Details.network.ids.VERSION_CHECK, Details.build_counter)
4 years ago
elseif (IsInGroup()) then
3 years ago
Details:SendPartyData(Details.network.ids.VERSION_CHECK, Details.build_counter)
4 years ago
end
3 years ago
if (sendToGuild) then
Details:SendGuildData(Details.network.ids.VERSION_CHECK, Details.build_counter)
4 years ago
end
end