本地存档
This commit is contained in:
parent
f79124999a
commit
72199d8993
@ -9,7 +9,7 @@ function ServerBagData:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ServerBagData:loadLocalData()
|
function ServerBagData:loadLocalData()
|
||||||
self.ItemData:init(self.ItemData:loadLocalData())
|
self.ItemData:loadLocalData()
|
||||||
end
|
end
|
||||||
|
|
||||||
function ServerBagData:getCloneData()
|
function ServerBagData:getCloneData()
|
||||||
|
|||||||
@ -28,7 +28,7 @@ function ServerBaseData:loadLocalData()
|
|||||||
if data and data ~= "" then
|
if data and data ~= "" then
|
||||||
dataObj = json.decode(data)
|
dataObj = json.decode(data)
|
||||||
end
|
end
|
||||||
return dataObj
|
self:init(dataObj)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ServerBaseData:saveLocalData()
|
function ServerBaseData:saveLocalData()
|
||||||
|
|||||||
@ -77,7 +77,7 @@ function ServerGameData:initData()
|
|||||||
self:saveData()
|
self:saveData()
|
||||||
else
|
else
|
||||||
for k, v in pairs(self.dataMap) do
|
for k, v in pairs(self.dataMap) do
|
||||||
v:init(v:loadLocalData())
|
v:loadLocalData()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user