diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index a128d33..840ab66 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -445,9 +445,16 @@ function _M.createRpc(agent, data) end newRole:log("onCreateRole") newRole:mylog("create", {key1 = agent.ip:toArray(false, ":")[1]}) - if msg.newdevice then - newRole:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) + + -- 是否是新设备 + local deviced = cluster.query("center", "deviced") + if deviced then + local status, back = pcall(cluster.call, "center", deviced, "isNewDevice", {device = msg.device}) + if status and back then + newRole:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) + end end + -- 整体保存一次 newRole:update() -- libgit2 0.21.2