fixed wish lists not sharing
This commit is contained in:
@@ -971,14 +971,29 @@ function AtlasLoot_GetWishList(wlstrg,sendername)
|
|||||||
local success, wltab = ALModule:Deserialize(wlstrg);
|
local success, wltab = ALModule:Deserialize(wlstrg);
|
||||||
if success then
|
if success then
|
||||||
for i,v in ipairs(wltab) do
|
for i,v in ipairs(wltab) do
|
||||||
v[8] = v[8].."|"..v[9].."|"..v[10];
|
if v[8] then
|
||||||
table.remove(v,9)
|
v[8] = v[8].."|"..v[9].."|"..v[10];
|
||||||
table.remove(v,10)
|
table.remove(v,9)
|
||||||
|
table.remove(v,10)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
table.insert(AtlasLootWishList["Shared"],wltab)
|
table.insert(AtlasLootWishList["Shared"],wltab)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local EscapePatterns={
|
||||||
|
"|[cC]%x%x%x%x%x%x";
|
||||||
|
"|T[^|]+|t";
|
||||||
|
"|H[^|]+|h%[(.-)%]|h";
|
||||||
|
};
|
||||||
|
|
||||||
|
local function StripEscapes(str)
|
||||||
|
for _,pattern in ipairs(EscapePatterns) do
|
||||||
|
str=str:gsub(pattern,pattern:find("%(.-[^%%]%)") and "%1" or "");
|
||||||
|
end
|
||||||
|
return str:gsub("^%s*(.-)%s*$","%1"):gsub("%s+"," ");-- Strip extra spaces
|
||||||
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
ALModule:OnCommReceived(prefix, message, distribution, sender)
|
ALModule:OnCommReceived(prefix, message, distribution, sender)
|
||||||
Incomming messages from AceComm
|
Incomming messages from AceComm
|
||||||
@@ -993,11 +1008,13 @@ function ALModule:OnCommReceived(prefix, message, distribution, sender)
|
|||||||
elseif message == "AcceptWishlist" then
|
elseif message == "AcceptWishlist" then
|
||||||
local wsltable = AtlasLoot:CloneTable(_G[curtable[2]][curtable[1]][curtable[3]]);
|
local wsltable = AtlasLoot:CloneTable(_G[curtable[2]][curtable[1]][curtable[3]]);
|
||||||
for i,v in ipairs(wsltable) do
|
for i,v in ipairs(wsltable) do
|
||||||
v[4] = ""
|
v[4] = gsub(StripEscapes(v[4]),"FF","");
|
||||||
local dataID, dataSource, dataPage = strsplit("|", v[8])
|
if v[8] then
|
||||||
v[8] = dataID;
|
local dataID, dataSource, dataPage = strsplit("|", v[8])
|
||||||
v[9] = dataSource;
|
v[8] = dataID;
|
||||||
v[10] = dataPage;
|
v[9] = dataSource;
|
||||||
|
v[10] = dataPage;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
local sendData = ALModule:Serialize(wsltable);
|
local sendData = ALModule:Serialize(wsltable);
|
||||||
ALModule:SendCommMessage("AtlasLootWishlist", sendData, "WHISPER", sender);
|
ALModule:SendCommMessage("AtlasLootWishlist", sendData, "WHISPER", sender);
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ function AtlasLoot:DewdropExpansionMenuClick(expansion, name)
|
|||||||
else
|
else
|
||||||
local tablenum = AtlasLoot_Data[tablename].Loadfirst or 1;
|
local tablenum = AtlasLoot_Data[tablename].Loadfirst or 1;
|
||||||
AtlasLoot:ShowItemsFrame(tablename, "AtlasLoot_Data", tablenum);
|
AtlasLoot:ShowItemsFrame(tablename, "AtlasLoot_Data", tablenum);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user