--- 用于修复角色数据 --- Generated by EmmyLua(https://github.com/EmmyLua) --- Created by 無心道(15388152619). --- DateTime: 2024/12/11 14:20 --- RepairRoleData = {} --- 修复角色数据 ---@param actor any 角色 ---@param key string 数据key ---@param time number 时间戳 ---@param fun function 回调函数 function RepairRoleData.action(actor, key, time, fun, ...) gameDebug.assertTrue(type(time) == "number", "数据修复的标记必须是时间戳") local old = tonumber(getplaydef(actor, key) or 0) if old ~= time then fun(...) setplaydef(actor, key, time) info(actor, actor, "修复数据", key, time) end end local function test() -- 调用修复数据功能, 玩家 模块名字 调用时间戳, 回调函数 RepairRoleData.action(actor, "test", 202412111423, function() end) end