Commit 875e507166259a02838907943e5dd383e4dd7d16
1 parent
df883a11
服务名称修改
Showing
9 changed files
with
24 additions
and
19 deletions
Show diff stats
src/services/agent_ctrl.lua
| ... | ... | @@ -128,7 +128,7 @@ function _M:check_agent_status() |
| 128 | 128 | next_log_time = now + 60 |
| 129 | 129 | local count = table_nums(self.u2f) |
| 130 | 130 | datacenter.set("onlineCount", count) |
| 131 | - pcall(skynet.send, logd, "lua", "log", "online", {count = count}) | |
| 131 | + pcall(skynet.send, logd, "lua", "log", "online", {count = count}, "online") | |
| 132 | 132 | end |
| 133 | 133 | end |
| 134 | 134 | ... | ... |
src/services/chated.lua
src/services/csvdatad.lua
src/services/dbseed.lua
| ... | ... | @@ -5,7 +5,6 @@ require "GlobalVar" |
| 5 | 5 | require "RedisKeys" |
| 6 | 6 | require "ProtocolCode" |
| 7 | 7 | require "skynet.manager" |
| 8 | -local harbor = require "skynet.harbor" | |
| 9 | 8 | |
| 10 | 9 | skynet = require "skynet" |
| 11 | 10 | |
| ... | ... | @@ -37,7 +36,7 @@ local steps = { |
| 37 | 36 | } |
| 38 | 37 | |
| 39 | 38 | skynet.start(function () |
| 40 | - redisd = harbor.queryname("REDIS") | |
| 39 | + redisd = skynet.localname(".REDIS") | |
| 41 | 40 | |
| 42 | 41 | redisproxy = require("shared.redisproxy") |
| 43 | 42 | ... | ... |
src/services/globald.lua
| ... | ... | @@ -8,15 +8,14 @@ require "utils.init" |
| 8 | 8 | require "RedisKeys" |
| 9 | 9 | require "skynet.manager" |
| 10 | 10 | |
| 11 | + | |
| 11 | 12 | local ipairs = ipairs |
| 12 | 13 | local table_insert = table.insert |
| 13 | 14 | local tarr2tab = table.array2Table |
| 14 | 15 | local string_format = string.format |
| 15 | 16 | |
| 16 | -local pointDataMark = {} | |
| 17 | -local utils = {} | |
| 18 | 17 | |
| 19 | -local CHECK_MAIL_STATUS_INTERVAL = 60 | |
| 18 | +local CHECK_MAIL_STATUS_INTERVAL = 100 * 60 | |
| 20 | 19 | local function mailQuene() |
| 21 | 20 | local delayEmail = tonum(redisproxy:hget("autoincrement_set", "delay_email")) |
| 22 | 21 | if delayEmail == 0 then |
| ... | ... | @@ -95,6 +94,8 @@ end |
| 95 | 94 | |
| 96 | 95 | local CMD = {} |
| 97 | 96 | |
| 97 | + | |
| 98 | +-- 服务器缓存50条消息 | |
| 98 | 99 | local cacheWorldMsg = {} |
| 99 | 100 | local CACHE_WORLD_MSG_COUNT = 50 |
| 100 | 101 | function CMD.sendWorldMsg(channel, msg) |
| ... | ... | @@ -105,12 +106,12 @@ function CMD.sendWorldMsg(channel, msg) |
| 105 | 106 | end |
| 106 | 107 | end |
| 107 | 108 | |
| 108 | - | |
| 109 | 109 | function CMD.getWorldMsg(channel) |
| 110 | 110 | local msgs = cacheWorldMsg[channel] or {} |
| 111 | 111 | return msgs |
| 112 | 112 | end |
| 113 | 113 | |
| 114 | + | |
| 114 | 115 | function CMD.start() |
| 115 | 116 | check_mail_queue() |
| 116 | 117 | end |
| ... | ... | @@ -127,8 +128,9 @@ local function __init__() |
| 127 | 128 | end |
| 128 | 129 | end |
| 129 | 130 | end) |
| 130 | - redisd = harbor.queryname("REDIS") | |
| 131 | - skynet.register("GLOBALD") | |
| 131 | + redisd = skynet.localname(".REDIS") | |
| 132 | + skynet.register(".GLOBALD") | |
| 133 | + | |
| 132 | 134 | end |
| 133 | 135 | |
| 134 | 136 | skynet.start(__init__) | ... | ... |
src/services/httpweb.lua
| ... | ... | @@ -13,7 +13,6 @@ mcast_util = require "services/mcast_util" |
| 13 | 13 | globalCsv = require "csvdata/GlobalDefine" |
| 14 | 14 | |
| 15 | 15 | local socket = require "skynet.socket" |
| 16 | -local harbor = require "skynet.harbor" | |
| 17 | 16 | |
| 18 | 17 | require "shared.init" |
| 19 | 18 | require "utils.init" |
| ... | ... | @@ -55,7 +54,7 @@ end |
| 55 | 54 | local CMD = require "actions.HttpAction" |
| 56 | 55 | |
| 57 | 56 | local function start() |
| 58 | - redisd = harbor.queryname("REDIS") | |
| 57 | + redisd = skynet.localname(".REDIS") | |
| 59 | 58 | csvdb = sharedata.query("csvdata") |
| 60 | 59 | |
| 61 | 60 | local listen_socket = socket.listen("0.0.0.0", port) | ... | ... |
src/services/named.lua
src/services/redisd.lua
src/services/watchdog.lua
| ... | ... | @@ -8,6 +8,7 @@ local snax = require "skynet.snax" |
| 8 | 8 | local agent_ctrl = require "services.agent_ctrl" |
| 9 | 9 | local xxtea = require "xxtea" |
| 10 | 10 | local mc = require "skynet.multicast" |
| 11 | +local cluster = require "skynet.cluster" | |
| 11 | 12 | |
| 12 | 13 | require "ProtocolCode" |
| 13 | 14 | require "GlobalVar" |
| ... | ... | @@ -15,7 +16,7 @@ require "shared.init" |
| 15 | 16 | require "utils.init" |
| 16 | 17 | |
| 17 | 18 | local CMD, SOCKET = {}, {} |
| 18 | -local globald | |
| 19 | +local globald, pvpd | |
| 19 | 20 | |
| 20 | 21 | local pool_size = tonumber(...) |
| 21 | 22 | |
| ... | ... | @@ -77,11 +78,15 @@ function CMD.start(conf) |
| 77 | 78 | -- roomServer = skynet.newservice("services/roomServer") |
| 78 | 79 | -- skynet.call(roomServer, "lua", "start") |
| 79 | 80 | |
| 81 | + skynet.newservice("services/dbseed") | |
| 82 | + | |
| 80 | 83 | globald = skynet.newservice("services/globald") |
| 81 | 84 | skynet.call(globald, "lua", "start") |
| 82 | 85 | |
| 83 | - skynet.newservice("services/dbseed") | |
| 84 | - | |
| 86 | + pvpd = skynet.newservice("services/pvpd") | |
| 87 | + cluster.register("pvpd", pvpd) | |
| 88 | + local servId = tonumber(skynet.getenv("servId")) | |
| 89 | + cluster.open("server" .. servId) | |
| 85 | 90 | end |
| 86 | 91 | |
| 87 | 92 | function CMD.forceClose(fd) |
| ... | ... | @@ -103,7 +108,7 @@ skynet.start(function() |
| 103 | 108 | skynet.ret(skynet.pack(f(subcmd, ...))) |
| 104 | 109 | end |
| 105 | 110 | end) |
| 106 | - skynet.register "WATCHDOG" | |
| 111 | + skynet.register ".WATCHDOG" | |
| 107 | 112 | -- 数据库服务 |
| 108 | 113 | redisd = skynet.newservice("services/redisd") |
| 109 | 114 | ... | ... |