Commit 8f9a82f3 authored by Ivaria's avatar Ivaria
Browse files

Added Huffman compression for profile sharing and storage

parent c8e9756f
......@@ -15,6 +15,7 @@ externals:
Libs/LibSharedMedia-3.0: svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk/LibSharedMedia-3.0
Libs/LibDataBroker-1.1: git://git.wowace.com/wow/libdatabroker-1-1/mainline.git
Libs/UTF8: svn://svn.wowace.com/wow/utf8/mainline/trunk
Libs/LibCompress: svn://svn.wowace.com/wow/libcompress/mainline/trunk
VuhDoOptions/Libs/ChatThrottleLib: svn://svn.wowace.com/wow/chatthrottlelib/mainline/trunk
......
......@@ -7,6 +7,7 @@
<Script file="Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua" />
<Script file="Libs\LibSharedMedia-3.0\LibSharedMedia-3.0.lua" />
<Script file="Libs\UTF8\utf8.lua" />
<Script file="Libs\LibCompress\LibCompress.lua" />
<Script file="VuhDoLocalization_en.lua" />
<Script file="VuhDoLocalization_de.lua" />
......
......@@ -4,6 +4,8 @@ VUHDO_LibSharedMedia = LibStub("LibSharedMedia-3.0");
VUHDO_LibDataBroker = LibStub("LibDataBroker-1.1", true);
VUHDO_LibButtonFacade = nil;
VUHDO_LibCompress = LibStub:GetLibrary("LibCompress");
VUHDO_LibCompressEncode = VUHDO_LibCompress:GetAddonEncodeTable();
VUHDO_LibSharedMedia:Register("font", "Arial Black", "Interface\\AddOns\\VuhDo\\Fonts\\ariblk.ttf");
VUHDO_LibSharedMedia:Register("font", "Emblem", "Interface\\AddOns\\VuhDo\\Fonts\\Emblem.ttf");
......
......@@ -125,6 +125,33 @@ end
--
function VUHDO_getCommsData(aUnitName)
if (aUnitName ~= nil) then
VUHDO_xMsg("Dumping comms data for", aUnitName);
VUHDO_xMsg("sUserData", VUHDO_tableToString(sUserData[aUnitName]));
VUHDO_xMsg("sRequestsInProgress", VUHDO_tableToString(sRequestsInProgress[aUnitName]));
VUHDO_xMsg("sRepliesReceived", VUHDO_tableToString(sRepliesReceived[aUnitName]));
if (sBusyUnitName == aUnitName) then
VUHDO_xMsg("sBusyUnitName", sBusyUnitName);
VUHDO_xMsg("sNumChunks", sNumChunks);
end
else
VUHDO_xMsg("Dumping comms data");
VUHDO_xMsg("sUserData", (sUserData));
VUHDO_xMsg("sRequestsInProgress", VUHDO_tableToString(sRequestsInProgress));
VUHDO_xMsg("sRepliesReceived", VUHDO_tableToString(sRepliesReceived));
if (sBusyUnitName == aUnitName) then
VUHDO_xMsg("sBusyUnitName", sBusyUnitName);
VUHDO_xMsg("sNumChunks", sNumChunks);
end
end
end
--
local function VUHDO_getFieldsFromReply(aUnitName, aReplyType)
local tUnitReplies = sRepliesReceived[aUnitName];
......@@ -305,14 +332,22 @@ end
--
function VUHDO_compressForSending(aTable)
return VUHDO_compressTable(aTable);
local compressedString = VUHDO_compressAndPackTable(aTable);
local encodedString = VUHDO_LibCompressEncode:Encode(compressedString);
return encodedString;
-- return VUHDO_compressAndPackTable(aTable);
end
--
function VUHDO_decompressFromSending(aString)
return VUHDO_decompressIfCompressed(aString);
local decodedString = VUHDO_LibCompressEncode:Decode(aString);
local decompressedTable = VUHDO_decompressIfCompressed(decodedString);
return decompressedTable;
-- return VUHDO_decompressIfCompressed(aString);
end
......
......@@ -719,18 +719,32 @@ end
--
function VUHDO_decompressStringHuffman(aFile)
return "string" == type(aFile) and VUHDO_LibCompress:DecompressHuffman(aFile) or aFile;
end
--
function VUHDO_compressStringHuffman(aFile)
return "string" == type(aFile) and VUHDO_LibCompress:CompressHuffman(aFile) or aFile;
end
--
function VUHDO_decompressIfCompressed(aFile)
return "string" == type(aFile) and VUHDO_deserializeTable(aFile) or aFile;
--return "string" == type(aFile) and VUHDO_deserializeTable(VUHDO_decompressStringHuffman(aFile)) or aFile;
-- return "string" == type(aFile) and VUHDO_deserializeTable(aFile) or aFile;
return "string" == type(aFile) and VUHDO_deserializeTable(VUHDO_decompressStringHuffman(aFile)) or aFile;
end
--
function VUHDO_decompressOrCopy(aFile)
return "string" == type(aFile) and VUHDO_deserializeTable(aFile) or VUHDO_deepCopyTable(aFile);
--return "string" == type(aFile) and VUHDO_deserializeTable(VUHDO_decompressStringHuffman(aFile)) or VUHDO_deepCopyTable(aFile);
-- return "string" == type(aFile) and VUHDO_deserializeTable(aFile) or VUHDO_deepCopyTable(aFile);
return "string" == type(aFile) and VUHDO_deserializeTable(VUHDO_decompressStringHuffman(aFile)) or VUHDO_deepCopyTable(aFile);
end
......@@ -744,8 +758,8 @@ end
--
function VUHDO_compressAndPackTable(aTable)
return type(aTable) == "table" and VUHDO_serializeTable(aTable) or aTable;
--return type(aTable) == "table" and VUHDO_compressStringHuffman(VUHDO_serializeTable(aTable)) or aTable;
-- return type(aTable) == "table" and VUHDO_serializeTable(aTable) or aTable;
return type(aTable) == "table" and VUHDO_compressStringHuffman(VUHDO_serializeTable(aTable)) or aTable;
end
......
......@@ -27,6 +27,7 @@ Improvements:
-- return ("Ivaria" == anInfo["name"])
-- Added option to hide buff watch while out of combat
-- Under 'VuhDo Options > Buffs > General'
-- Added Huffman compression for profile sharing and storage
--------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment