diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 814945e..9c1ca80 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -83,9 +83,6 @@ function _M.loginRpc( agent, data ) end end - -- 设备记录 - redisproxy:sadd(string_format("device:%d", roleId), msg.device) - local now = skynet.timex() local role = agent.role -- 2 @@ -338,8 +335,14 @@ function _M.loginRpc( agent, data ) local hangPass = role:getProperty("hangPass") role:mylog("login", {key1 = agent.ip:toArray(false, ":")[1], int1 = hangPass[1] or 0}) - if msg.newdevice then - role: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 + role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) + end end return true -- libgit2 0.21.2