Skip to content

Commit

Permalink
fixed the MonDKPTeams comms for new team and rename team actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Taidtuskecyh authored and Taidtuskecyh committed Jun 4, 2020
1 parent 125cad5 commit 04ade33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Modules/ManageEntries.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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

-------
Expand Down
7 changes: 6 additions & 1 deletion Modules/comm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 04ade33

Please sign in to comment.