mirror of
https://github.com/cave-story-randomizer/cave-story-randomizer
synced 2024-11-22 14:53:00 +00:00
Merge pull request #84 from periwinkle3125/platform-independent-sharecodes
Change sharecode format to be platform-independent
This commit is contained in:
commit
b4de34f4c8
|
@ -399,7 +399,7 @@ function C:_updateSharecode(seed)
|
|||
seed = seed .. (" "):rep(20-#seed)
|
||||
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)
|
||||
|
||||
logNotice(("Sharecode: %s"):format(self.sharecode))
|
||||
|
|
|
@ -269,7 +269,7 @@ end)
|
|||
settings.importshare:onPress(function()
|
||||
local success, seed, sharesettings, seq = pcall(function()
|
||||
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)
|
||||
return seed, settings, seq
|
||||
end)
|
||||
|
|
Loading…
Reference in a new issue