Commit 2fdb4d55fda89b906970956f4da07cdd372183f2
Merge branch 'cn/develop' of 120.26.43.151:wasteland/server into cn/develop
Showing
1 changed file
with
8 additions
and
5 deletions
Show diff stats
src/actions/RoleAction.lua
| ... | ... | @@ -83,9 +83,6 @@ function _M.loginRpc( agent, data ) |
| 83 | 83 | end |
| 84 | 84 | end |
| 85 | 85 | |
| 86 | - -- 设备记录 | |
| 87 | - redisproxy:sadd(string_format("device:%d", roleId), msg.device) | |
| 88 | - | |
| 89 | 86 | local now = skynet.timex() |
| 90 | 87 | local role = agent.role |
| 91 | 88 | -- 2 |
| ... | ... | @@ -338,8 +335,14 @@ function _M.loginRpc( agent, data ) |
| 338 | 335 | |
| 339 | 336 | local hangPass = role:getProperty("hangPass") |
| 340 | 337 | role:mylog("login", {key1 = agent.ip:toArray(false, ":")[1], int1 = hangPass[1] or 0}) |
| 341 | - if msg.newdevice then | |
| 342 | - role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) | |
| 338 | + | |
| 339 | + -- 是否是新设备 | |
| 340 | + local deviced = cluster.query("center", "deviced") | |
| 341 | + if deviced then | |
| 342 | + local status, back = pcall(cluster.call, "center", deviced, "isNewDevice", {device = msg.device}) | |
| 343 | + if status and back then | |
| 344 | + role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) | |
| 345 | + end | |
| 343 | 346 | end |
| 344 | 347 | |
| 345 | 348 | return true | ... | ... |