Skip to content

Commit

Permalink
Merge pull request #9 from Taidtuskecyh/master
Browse files Browse the repository at this point in the history
fixed the MonDKPTeams comms for new team and rename team actions
  • Loading branch information
Vapok authored Jun 5, 2020
2 parents 8f80adb + eae6ca2 commit e14c2e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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
9 changes: 7 additions & 2 deletions Modules/comm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,14 @@ 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;
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")
Expand Down

0 comments on commit e14c2e6

Please sign in to comment.