This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Version: AceSerializer-3.0, 5
Description: Currently, when serializing tables, the serializer follows traditional Lua code by using pairs. This typically doesn't cause any issues, except for when you are attempting to use LibDeflate's Adler32 hashing algorithm to compare two identical tables from two separate clients. Because table pairs are non-deterministic in the order that they process, this causes the resulting serialized strings to not be identical, and thus the hashes of those strings are not identical (even though the contents of the tables are).
This can be remedied by either including the behavior of pairingByKey by default or by allowing us to pass in a config option.
I have attached the necessary code below, to show how this behavior could be fixed by default:
local function PairByKeys(t, f) local a = {}; for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0; local iter = function() i = i + 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end return iter; end
Change Line 86 From: for k, v in pairs(v) do ...To: for k,v in PairByKeys(v) do...
Btw, If anyone is reading this and having the same issue. I fixed it by implementing the above code changes, and then editing the minor version number in the Serializer file from 5 to 6 (so that my version gets loaded by default, instead of another addons).
table.sort errors on mixed type keys, so if you have a table with string keys as well as number keys, or anything even fancier, you would likely encounter issues.
As a general solution, much more hardening would have to go in here.
To post a comment, please login or register a new account.