- 打卡等级:热心大叔
- 打卡总天数:94
- 打卡月天数:17
- 打卡总奖励:94
- 最近打卡:2025-01-18 01:28:20
|
- function GetMissionData_Ex(sceneId,selfId,nIndex)
- local nGuid = LuaFnGetID(sceneId,selfId)
- local handle = openfile("./ServerBD/MissIonData/"..nGuid..".txt", "r")
- local nServerData = {}
- if handle and handle ~= nil then
- for i = 1,512 do
- local nData = read(handle, "*l")
- nServerData[i] = tonumber(nData)
- end
- closefile(handle)
- else
- for i = 1,512 do
- nServerData[i] = 0
- end
- end
- if nServerData[nIndex] == nil then
- nServerData[nIndex] = 0
- end
- return nServerData[nIndex]
- end
- function LuaFnGetMissData_ExData(sceneId,selfId)
- local nGuid = LuaFnGetID(sceneId,selfId)
- local handle = openfile("./ServerBD/MissIonData/"..nGuid..".txt", "r")
- local nServerData = {}
- if handle and handle ~= nil then
- for i = 1,512 do
- local nData = read(handle, "*l")
- nServerData[i] = tonumber(nData)
- end
- closefile(handle)
- else
- for i = 1,512 do
- nServerData[i] = 0
- end
- end
- return nServerData
- end
- function SetMissionData_Ex(sceneId,selfId,nIndex,insetData)
- local nServerData = LuaFnGetMissData_ExData(sceneId,selfId)
- local nTextData = ""
- local nGuid = LuaFnGetID(sceneId,selfId)
- local handle = openfile("./ServerBD/MissIonData/"..nGuid..".txt", "wb")
- nServerData[nIndex] = insetData
- for i = 1,512 do
- nTextData = nTextData..nServerData[i].."\n"
- end
- if nTextData ~= "" then
- write(handle, nTextData)
- closefile(handle);
- end
- end
复制代码
|
|