From 04ade337eff1668458a36bdb48ffe67dc5804f64 Mon Sep 17 00:00:00 2001 From: Taidtuskecyh Date: Thu, 4 Jun 2020 23:19:38 +0200 Subject: [PATCH 1/2] fixed the MonDKPTeams comms for new team and rename team actions --- Modules/ManageEntries.lua | 4 ++-- Modules/comm.lua | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Modules/ManageEntries.lua b/Modules/ManageEntries.lua index 9463d05e..61b28108 100644 --- a/Modules/ManageEntries.lua +++ b/Modules/ManageEntries.lua @@ -305,7 +305,7 @@ end function ChangeTeamName(index, _name) MonDKP:GetTable(MonDKP_DB, false)["teams"][tostring(index)].name = _name; - MonDKP.Sync:SendData("MonDKPTeams", MonDKP:GetTable(MonDKP_DB, false)["teams"], "GUILD") + MonDKP.Sync:SendData("MonDKPTeams", {Teams = MonDKP:GetTable(MonDKP_DB, false)["teams"]} , nil) end local function AddNewTeamToGuild() @@ -336,7 +336,7 @@ local function AddNewTeamToGuild() MonDKP:GetTable(MonDKP_Standby, false)[tostring(_index)] = {} MonDKP:GetTable(MonDKP_Archive, false)[tostring(_index)] = {} - MonDKP.Sync:SendData("MonDKPTeams", MonDKP:GetTable(MonDKP_DB, false)["teams"], "GUILD") + MonDKP.Sync:SendData("MonDKPTeams", {Teams = MonDKP:GetTable(MonDKP_DB, false)["teams"]} , nil) end ------- diff --git a/Modules/comm.lua b/Modules/comm.lua index 7796ffeb..70d98e0e 100644 --- a/Modules/comm.lua +++ b/Modules/comm.lua @@ -128,7 +128,12 @@ function MonDKP.Sync:OnCommReceived(prefix, message, distribution, sender) return end elseif prefix == "MonDKPTeams" then - MonDKP:GetTable(MonDKP_DB, false)["teams"] = message; + decoded = LibDeflate:DecompressDeflate(LibDeflate:DecodeForWoWAddonChannel(message)) + local success, deserialized = LibAceSerializer:Deserialize(decoded); + if success then + MonDKP:GetTable(MonDKP_DB, false)["teams"] = deserialized.Teams + end + return; elseif prefix == "MonDKPCurTeam" then core.DB.defaults.CurrentTeam = message; return From eae6ca27e8c6cb781bf8bf2b3bd517931a42403a Mon Sep 17 00:00:00 2001 From: Taidtuskecyh Date: Fri, 5 Jun 2020 11:49:41 +0200 Subject: [PATCH 2/2] better handling of MonDKPCurTeam comm on msg received --- Modules/comm.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/comm.lua b/Modules/comm.lua index 70d98e0e..ae8475e4 100644 --- a/Modules/comm.lua +++ b/Modules/comm.lua @@ -135,7 +135,7 @@ function MonDKP.Sync:OnCommReceived(prefix, message, distribution, sender) end return; elseif prefix == "MonDKPCurTeam" then - core.DB.defaults.CurrentTeam = message; + MonDKP:SetCurrentTeam(message) -- this also refreshes all the tables/views/graphs return elseif prefix == "MonDKPTalents" then local search = MonDKP:Table_Search(MonDKP:GetTable(MonDKP_DKPTable, true), sender, "player")