Commit 06c7246e21c7291a5ab816f7910308e0310a80fd
1 parent
652ef8f7
按500人分线
Showing
3 changed files
with
6 additions
and
3 deletions
Show diff stats
src/actions/RoleAction.lua
| ... | ... | @@ -288,7 +288,9 @@ function _M.loginRpc( agent, data ) |
| 288 | 288 | |
| 289 | 289 | -- 注册全服广播 |
| 290 | 290 | if not role._channelIdx then |
| 291 | - local channel = math.randomInt(1, 1) | |
| 291 | + local online = datacenter.get("onlineCount") or 0 | |
| 292 | + local channel = math.floor(online / 500) + 1 | |
| 293 | + --local channel = math.randomInt(1, 1) | |
| 292 | 294 | role._channelIdx = channel |
| 293 | 295 | end |
| 294 | 296 | if not mcast_util.channel_world() then | ... | ... |
src/services/agent_ctrl.lua
| ... | ... | @@ -141,10 +141,11 @@ function _M:check_agent_status() |
| 141 | 141 | end |
| 142 | 142 | end |
| 143 | 143 | |
| 144 | + datacenter.set("onlineCount", count) | |
| 144 | 145 | if now >= next_log_time and now % 60 == 0 then |
| 145 | 146 | next_log_time = now + 60 |
| 146 | 147 | local count = table_nums(self.u2f) |
| 147 | - datacenter.set("onlineCount", count) | |
| 148 | + --datacenter.set("onlineCount", count) | |
| 148 | 149 | logproxy:log({["@type"] = "online", count = count}, "log") |
| 149 | 150 | end |
| 150 | 151 | end | ... | ... |
src/services/watchdog.lua