Merge pull request #84 from periwinkle3125/platform-independent-sharecodes

Change sharecode format to be platform-independent
This commit is contained in:
duncathan salt 2020-03-08 14:12:25 -06:00 committed by GitHub
commit b4de34f4c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -399,7 +399,7 @@ function C:_updateSharecode(seed)
seed = seed .. (" "):rep(20-#seed) seed = seed .. (" "):rep(20-#seed)
end end
local packed = love.data.pack("data", "sBB", seed, settings, seq) local packed = love.data.pack("data", "<s1BB", seed, settings, seq)
self.sharecode = love.data.encode("string", "base64", packed) self.sharecode = love.data.encode("string", "base64", packed)
logNotice(("Sharecode: %s"):format(self.sharecode)) logNotice(("Sharecode: %s"):format(self.sharecode))

View file

@ -269,7 +269,7 @@ end)
settings.importshare:onPress(function() settings.importshare:onPress(function()
local success, seed, sharesettings, seq = pcall(function() local success, seed, sharesettings, seq = pcall(function()
local packed = love.data.decode("data", "base64", settings.sharecode.value) local packed = love.data.decode("data", "base64", settings.sharecode.value)
local seed, settings, seq = love.data.unpack("sBB", packed) local seed, settings, seq = love.data.unpack("<s1BB", packed)
assert(#seed == 20) assert(#seed == 20)
return seed, settings, seq return seed, settings, seq
end) end)