Commit abed32ed510f9f1fd64fb20beb1270ed9799b676
Merge branch 'develop' into qa
* develop: 充值返利邮件新增 调整压测 error
Showing
12 changed files
with
176 additions
and
27 deletions
Show diff stats
robot/robot.lua
| @@ -34,6 +34,9 @@ local ignoreListener = { | @@ -34,6 +34,9 @@ local ignoreListener = { | ||
| 34 | ["Role.changeUpdate"] = true, | 34 | ["Role.changeUpdate"] = true, |
| 35 | ["Role.loadRunes"] = true, | 35 | ["Role.loadRunes"] = true, |
| 36 | ["Hero.loadInfos"] = true, | 36 | ["Hero.loadInfos"] = true, |
| 37 | + ["Store.updateproperty"] = true, | ||
| 38 | + ["Sys.maintainNotice"] = true, | ||
| 39 | + ["Hero.drawHeroExtraRewardNtf"] = true, | ||
| 37 | ["Sys.innerErrorMsg"] = function(data) | 40 | ["Sys.innerErrorMsg"] = function(data) |
| 38 | local msg = MsgPack.unpack(data) | 41 | local msg = MsgPack.unpack(data) |
| 39 | log("innerErrorMsg: " .. msg.id) | 42 | log("innerErrorMsg: " .. msg.id) |
| @@ -123,11 +126,6 @@ local function startUnit(unit) | @@ -123,11 +126,6 @@ local function startUnit(unit) | ||
| 123 | unitTest.new(client):startTest() | 126 | unitTest.new(client):startTest() |
| 124 | end | 127 | end |
| 125 | 128 | ||
| 126 | -local function handle_timeout10000() | ||
| 127 | - rpcServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 1, pm2 = 500})) | ||
| 128 | - rpcServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 2, pm2 = 500})) | ||
| 129 | - skynet.timeout(10000, handle_timeout6000) | ||
| 130 | -end | ||
| 131 | 129 | ||
| 132 | -- 登录成功开始任务 | 130 | -- 登录成功开始任务 |
| 133 | function CMD.task() | 131 | function CMD.task() |
| @@ -155,6 +153,9 @@ end | @@ -155,6 +153,9 @@ end | ||
| 155 | 153 | ||
| 156 | -- 退出 | 154 | -- 退出 |
| 157 | function CMD.exit() | 155 | function CMD.exit() |
| 156 | + sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "gmmsg", pm1 = "123"})) | ||
| 157 | + skynet.sleep(50) | ||
| 158 | + skynet.ret(skynet.pack()) | ||
| 158 | skynet.exit() | 159 | skynet.exit() |
| 159 | end | 160 | end |
| 160 | 161 |
robot/start.lua
| @@ -19,9 +19,9 @@ function MSG.open( ... ) | @@ -19,9 +19,9 @@ function MSG.open( ... ) | ||
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | function MSG.close(fd) | 21 | function MSG.close(fd) |
| 22 | - if fd2serv[fd] then | ||
| 23 | - skynet.send(fd2serv[fd].agent, "lua", "exit") | ||
| 24 | - | 22 | + if fd2serv[fd] and not fd2serv[fd].closing then |
| 23 | + fd2serv[fd].closing = true | ||
| 24 | + skynet.call(fd2serv[fd].agent, "lua", "exit") | ||
| 25 | log(string_format("logout %s", fd2serv[fd].id)) | 25 | log(string_format("logout %s", fd2serv[fd].id)) |
| 26 | 26 | ||
| 27 | id2fd[fd2serv[fd].id] = nil | 27 | id2fd[fd2serv[fd].id] = nil |
| @@ -94,8 +94,8 @@ local function add_robot() | @@ -94,8 +94,8 @@ local function add_robot() | ||
| 94 | 94 | ||
| 95 | -- 定时下线 | 95 | -- 定时下线 |
| 96 | skynet.timeout(math.randomInt(config.online_time[1], config.online_time[2]) * 100, function() | 96 | skynet.timeout(math.randomInt(config.online_time[1], config.online_time[2]) * 100, function() |
| 97 | - socketdriver.close(fd) | ||
| 98 | MSG.close(fd) | 97 | MSG.close(fd) |
| 98 | + socketdriver.close(fd) | ||
| 99 | end) | 99 | end) |
| 100 | end | 100 | end |
| 101 | 101 |
robot/unitTest/hero.lua
| @@ -26,7 +26,7 @@ end | @@ -26,7 +26,7 @@ end | ||
| 26 | 26 | ||
| 27 | function _M:drawHero() | 27 | function _M:drawHero() |
| 28 | sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 3, pm2 = 400})) | 28 | sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 3, pm2 = 400})) |
| 29 | - requestServer(actionCodes.Hero_drawHeroRpc, MsgPack.pack({pool = 1, type = 1})) | 29 | + requestServer(actionCodes.Hero_drawHeroRpc, MsgPack.pack({pool = 2, type = 1})) |
| 30 | end | 30 | end |
| 31 | 31 | ||
| 32 | function _M:drawHero10() | 32 | function _M:drawHero10() |
src/GlobalVar.lua
| @@ -293,8 +293,6 @@ MailId = { | @@ -293,8 +293,6 @@ MailId = { | ||
| 293 | SuperMonthCardEx = 204, | 293 | SuperMonthCardEx = 204, |
| 294 | BattleCardAward = 210, | 294 | BattleCardAward = 210, |
| 295 | 295 | ||
| 296 | - PaySignAward = 222, | ||
| 297 | - | ||
| 298 | ActSellFood = 231, | 296 | ActSellFood = 231, |
| 299 | ActDrawCard = 232, | 297 | ActDrawCard = 232, |
| 300 | ActAdvDraw = 233, | 298 | ActAdvDraw = 233, |
| @@ -303,6 +301,9 @@ MailId = { | @@ -303,6 +301,9 @@ MailId = { | ||
| 303 | ActDrawCardReward = 222, | 301 | ActDrawCardReward = 222, |
| 304 | ActAdvDrawReward = 223, | 302 | ActAdvDrawReward = 223, |
| 305 | ActOpenBoxReward = 224, | 303 | ActOpenBoxReward = 224, |
| 304 | + | ||
| 305 | + PaySignAward = 241, | ||
| 306 | + PayBackAward = 242, | ||
| 306 | } | 307 | } |
| 307 | 308 | ||
| 308 | TriggerEventType = { | 309 | TriggerEventType = { |
src/actions/HangAction.lua
| @@ -278,7 +278,6 @@ function _M.endBattleRpc(agent, data) | @@ -278,7 +278,6 @@ function _M.endBattleRpc(agent, data) | ||
| 278 | local cfg = csvdb["idle_battleCsv"][nextCarbonId] | 278 | local cfg = csvdb["idle_battleCsv"][nextCarbonId] |
| 279 | if cfg then | 279 | if cfg then |
| 280 | hangInfo.bossTime = skynet.timex() + cfg.idle_time | 280 | hangInfo.bossTime = skynet.timex() + cfg.idle_time |
| 281 | - print(hangInfo.bossTime) | ||
| 282 | end | 281 | end |
| 283 | end | 282 | end |
| 284 | role:updateProperty({field = "hangInfo", value = hangInfo}) | 283 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
src/actions/RoleAction.lua
| @@ -977,7 +977,7 @@ function _M.chatRpc(agent, data) | @@ -977,7 +977,7 @@ function _M.chatRpc(agent, data) | ||
| 977 | role:log("communication", { | 977 | role:log("communication", { |
| 978 | publish_type = cmd, --发言类型,1,世界 2私聊 | 978 | publish_type = cmd, --发言类型,1,世界 2私聊 |
| 979 | publish_status = 0, --发送状态,发送成功:0,发送失败:1,被屏蔽:2,其他:3 | 979 | publish_status = 0, --发送状态,发送成功:0,发送失败:1,被屏蔽:2,其他:3 |
| 980 | - publish_receive_roleid = msg.roleId, --接收者角色ID | 980 | + publish_receive_roleid = msg.roleId or 0, --接收者角色ID |
| 981 | publish_text = content, --发言内容 | 981 | publish_text = content, --发言内容 |
| 982 | }) | 982 | }) |
| 983 | SendPacket(actionCodes.Role_chatRpc, MsgPack.pack({result = result, waitTime = waitTime})) | 983 | SendPacket(actionCodes.Role_chatRpc, MsgPack.pack({result = result, waitTime = waitTime})) |
src/models/Activity.lua
| @@ -334,7 +334,7 @@ activityFunc[Activity.ActivityType.PayBack] = { | @@ -334,7 +334,7 @@ activityFunc[Activity.ActivityType.PayBack] = { | ||
| 334 | local newVal = oldVal + twd | 334 | local newVal = oldVal + twd |
| 335 | local gift = self.owner:getPaybackReward(oldVal, newVal) | 335 | local gift = self.owner:getPaybackReward(oldVal, newVal) |
| 336 | if gift ~= "" then | 336 | if gift ~= "" then |
| 337 | - self.owner:sendMail(MailId.MonthCard, nil, gift) | 337 | + self.owner:sendMail(MailId.PayBackAward, nil, gift, {newVal}) |
| 338 | end | 338 | end |
| 339 | self:updateActData(actType, newVal, not notify) | 339 | self:updateActData(actType, newVal, not notify) |
| 340 | end, | 340 | end, |
src/models/Email.lua
| @@ -49,7 +49,7 @@ function Email:data() | @@ -49,7 +49,7 @@ function Email:data() | ||
| 49 | if emailData then | 49 | if emailData then |
| 50 | -- 如果内容是直接插入到数据库 | 50 | -- 如果内容是直接插入到数据库 |
| 51 | if content == "" and emailData.body ~= "" then | 51 | if content == "" and emailData.body ~= "" then |
| 52 | - content = io.readfile("src/" .. emailData.body) | 52 | + content = io.readfile("src/" .. emailData.body) or "" |
| 53 | content = content:format(table.unpack(contentPms)) | 53 | content = content:format(table.unpack(contentPms)) |
| 54 | end | 54 | end |
| 55 | 55 |
src/models/RolePlugin.lua
| @@ -238,7 +238,7 @@ function RolePlugin.bind(Role) | @@ -238,7 +238,7 @@ function RolePlugin.bind(Role) | ||
| 238 | end | 238 | end |
| 239 | 239 | ||
| 240 | if params.log then | 240 | if params.log then |
| 241 | - local log = params.log | 241 | + local log = clone(params.log) |
| 242 | if log["cint1"] or log["cint2"] then | 242 | if log["cint1"] or log["cint2"] then |
| 243 | print("addPlayExp error log have cint1 or cint2 or cint3", debug.traceback()) | 243 | print("addPlayExp error log have cint1 or cint2 or cint3", debug.traceback()) |
| 244 | end | 244 | end |
| @@ -275,7 +275,7 @@ function RolePlugin.bind(Role) | @@ -275,7 +275,7 @@ function RolePlugin.bind(Role) | ||
| 275 | 275 | ||
| 276 | self:logItems(params.itemId, origin, nums, params.log) | 276 | self:logItems(params.itemId, origin, nums, params.log) |
| 277 | if params.log then | 277 | if params.log then |
| 278 | - local log = params.log | 278 | + local log = clone(params.log) |
| 279 | if log["cint1"] or log["cint2"] then | 279 | if log["cint1"] or log["cint2"] then |
| 280 | print("addItem error log have cint1 or cint2 ", debug.traceback()) | 280 | print("addItem error log have cint1 or cint2 ", debug.traceback()) |
| 281 | end | 281 | end |
| @@ -299,7 +299,7 @@ function RolePlugin.bind(Role) | @@ -299,7 +299,7 @@ function RolePlugin.bind(Role) | ||
| 299 | function Role:checkItemEnough(itemCountT) | 299 | function Role:checkItemEnough(itemCountT) |
| 300 | local less = {} | 300 | local less = {} |
| 301 | if not next(itemCountT) then | 301 | if not next(itemCountT) then |
| 302 | - return false, less | 302 | + return true, less |
| 303 | end | 303 | end |
| 304 | for itemId, count in pairs(itemCountT) do | 304 | for itemId, count in pairs(itemCountT) do |
| 305 | if count <= 0 then | 305 | if count <= 0 then |
| @@ -360,7 +360,7 @@ function RolePlugin.bind(Role) | @@ -360,7 +360,7 @@ function RolePlugin.bind(Role) | ||
| 360 | 360 | ||
| 361 | self:logItems(ItemId.Diamond, origin, count, params.log) | 361 | self:logItems(ItemId.Diamond, origin, count, params.log) |
| 362 | if params.log then | 362 | if params.log then |
| 363 | - local log = params.log | 363 | + local log = clone(params.log) |
| 364 | if log["cint1"] or log["cint2"] or log["cint3"] then | 364 | if log["cint1"] or log["cint2"] or log["cint3"] then |
| 365 | print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | 365 | print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) |
| 366 | end | 366 | end |
| @@ -410,7 +410,7 @@ function RolePlugin.bind(Role) | @@ -410,7 +410,7 @@ function RolePlugin.bind(Role) | ||
| 410 | 410 | ||
| 411 | self:logItems(ItemId.Diamond, origin, count, params.log) | 411 | self:logItems(ItemId.Diamond, origin, count, params.log) |
| 412 | if params.log then | 412 | if params.log then |
| 413 | - local log = params.log | 413 | + local log = clone(params.log) |
| 414 | if log["cint1"] or log["cint2"] or log["cint3"] then | 414 | if log["cint1"] or log["cint2"] or log["cint3"] then |
| 415 | print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | 415 | print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) |
| 416 | end | 416 | end |
| @@ -459,7 +459,7 @@ function RolePlugin.bind(Role) | @@ -459,7 +459,7 @@ function RolePlugin.bind(Role) | ||
| 459 | self:logItems(heroType + ItemStartId.Hero, 0, 1, params.log) | 459 | self:logItems(heroType + ItemStartId.Hero, 0, 1, params.log) |
| 460 | 460 | ||
| 461 | if params.log then | 461 | if params.log then |
| 462 | - local log = params.log | 462 | + local log = clone(params.log) |
| 463 | if log["cint1"] or log["cint2"] or log["cint3"] then | 463 | if log["cint1"] or log["cint2"] or log["cint3"] then |
| 464 | print("addHero error log have cint1 or cint2 or cint3 ", debug.traceback()) | 464 | print("addHero error log have cint1 or cint2 or cint3 ", debug.traceback()) |
| 465 | end | 465 | end |
| @@ -580,7 +580,7 @@ function RolePlugin.bind(Role) | @@ -580,7 +580,7 @@ function RolePlugin.bind(Role) | ||
| 580 | 580 | ||
| 581 | self:logItems(equipCsv.id, oldCount, curCount, pms.log) | 581 | self:logItems(equipCsv.id, oldCount, curCount, pms.log) |
| 582 | if pms.log then | 582 | if pms.log then |
| 583 | - local log = pms.log | 583 | + local log = clone(pms.log) |
| 584 | if log["cint1"] or log["cint2"] or log["cint3"] then | 584 | if log["cint1"] or log["cint2"] or log["cint3"] then |
| 585 | print("addEquip error log have cint1 or cint2 or cint3 ", debug.traceback()) | 585 | print("addEquip error log have cint1 or cint2 or cint3 ", debug.traceback()) |
| 586 | end | 586 | end |
| @@ -656,7 +656,7 @@ function RolePlugin.bind(Role) | @@ -656,7 +656,7 @@ function RolePlugin.bind(Role) | ||
| 656 | 656 | ||
| 657 | self:logItems(params.id, 0, 1, params.log) | 657 | self:logItems(params.id, 0, 1, params.log) |
| 658 | if params.log then | 658 | if params.log then |
| 659 | - local log = params.log | 659 | + local log = clone(params.log) |
| 660 | if log["cint1"] or log["cint2"] or log["cint3"] then | 660 | if log["cint1"] or log["cint2"] or log["cint3"] then |
| 661 | print("addRune error log have cint1 or cint2 or cint3 ", debug.traceback()) | 661 | print("addRune error log have cint1 or cint2 or cint3 ", debug.traceback()) |
| 662 | end | 662 | end |
| @@ -686,7 +686,7 @@ function RolePlugin.bind(Role) | @@ -686,7 +686,7 @@ function RolePlugin.bind(Role) | ||
| 686 | 686 | ||
| 687 | self:logItems(rune:getProperty("id"), 1, 0, params.log) | 687 | self:logItems(rune:getProperty("id"), 1, 0, params.log) |
| 688 | if params.log then | 688 | if params.log then |
| 689 | - local log = params.log | 689 | + local log = clone(params.log) |
| 690 | if log["cint1"] or log["cint2"] or log["cint3"] then | 690 | if log["cint1"] or log["cint2"] or log["cint3"] then |
| 691 | print("delRunes error log have cint1 or cint2 or cint3 ", debug.traceback()) | 691 | print("delRunes error log have cint1 or cint2 or cint3 ", debug.traceback()) |
| 692 | end | 692 | end |
| @@ -946,7 +946,7 @@ function RolePlugin.bind(Role) | @@ -946,7 +946,7 @@ function RolePlugin.bind(Role) | ||
| 946 | 946 | ||
| 947 | self:logItems(func, 0, count, params.log) | 947 | self:logItems(func, 0, count, params.log) |
| 948 | if params.log then | 948 | if params.log then |
| 949 | - local log = params.log | 949 | + local log = clone(params.log) |
| 950 | if log["cint1"] or log["cint2"] or log["cint3"] then | 950 | if log["cint1"] or log["cint2"] or log["cint3"] then |
| 951 | print("funcOpen error log have cint1 or cint2 or cint3 ", debug.traceback()) | 951 | print("funcOpen error log have cint1 or cint2 or cint3 ", debug.traceback()) |
| 952 | end | 952 | end |
| @@ -0,0 +1,145 @@ | @@ -0,0 +1,145 @@ | ||
| 1 | + | ||
| 2 | +local skynet = require "skynet" | ||
| 3 | +local socketdriver = require "skynet.socketdriver" | ||
| 4 | +local serverId = tonumber(skynet.getenv("servId")) | ||
| 5 | + | ||
| 6 | +require "shared.init" | ||
| 7 | +require "skynet.manager" | ||
| 8 | + | ||
| 9 | +local table_insert = table.insert | ||
| 10 | +local pairs = pairs | ||
| 11 | +local ipairs = ipairs | ||
| 12 | +local string_format = string.format | ||
| 13 | + | ||
| 14 | +local logHandle = { | ||
| 15 | + log = { | ||
| 16 | + host = "127.0.0.1", | ||
| 17 | + port = 13003, | ||
| 18 | + handle = function(doc, address, msg) | ||
| 19 | + -- 注入字段 | ||
| 20 | + local now = skynet.timex() | ||
| 21 | + doc["time"] = now | ||
| 22 | + doc["timestamp"] = now | ||
| 23 | + doc["instance_id"] = serverId | ||
| 24 | + doc["game_name"] = "wasteland" | ||
| 25 | + doc["env"] = "cb" | ||
| 26 | + doc["app_name"] = "gs" | ||
| 27 | + doc["app_id"] = "game.wasteland.gs" | ||
| 28 | + --FATAL、ERROR、WARN、INFO、DEBUG | ||
| 29 | + doc["level"] = "ERROR" | ||
| 30 | + doc["log"] = msg | ||
| 31 | + doc["address"] = string_format(":%08x", address) | ||
| 32 | + end | ||
| 33 | + }, | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +local connect_relation = {} | ||
| 37 | +local function getConInfo(fd) | ||
| 38 | + return logHandle[connect_relation[fd] or ""] | ||
| 39 | +end | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + | ||
| 43 | +local socket_message = {} | ||
| 44 | +-- read skynet_socket.h for these macro | ||
| 45 | +-- SKYNET_SOCKET_TYPE_DATA = 1 | ||
| 46 | +socket_message[1] = function(id, size, data) | ||
| 47 | + skynet.error(string.format("LOG SOCKET: data: ", skynet.tostring(data, size))) | ||
| 48 | + socketdriver.drop(data, size) | ||
| 49 | +end | ||
| 50 | + | ||
| 51 | +-- SKYNET_SOCKET_TYPE_CONNECT = 2 | ||
| 52 | +socket_message[2] = function(id, _ , addr) | ||
| 53 | + local cur = getConInfo(id) | ||
| 54 | + skynet.error("LOG SOCKET: connect: ", addr) | ||
| 55 | + cur.connected = true | ||
| 56 | + cur.connecting = false | ||
| 57 | +end | ||
| 58 | + | ||
| 59 | +-- SKYNET_SOCKET_TYPE_CLOSE = 3 | ||
| 60 | +socket_message[3] = function(id) | ||
| 61 | + skynet.error("LOG SOCKET: closed") | ||
| 62 | + local cur = getConInfo(id) | ||
| 63 | + if not cur then return end | ||
| 64 | + cur.connected = false | ||
| 65 | + cur.connecting = false | ||
| 66 | + connect_relation[id] = nil | ||
| 67 | +end | ||
| 68 | + | ||
| 69 | +-- SKYNET_SOCKET_TYPE_ERROR = 5 | ||
| 70 | +socket_message[5] = function(id, _, err) | ||
| 71 | + skynet.error("LOG SOCKET: error: ", err) | ||
| 72 | + local cur = getConInfo(id) | ||
| 73 | + if not cur then return end | ||
| 74 | + cur.connected = false | ||
| 75 | + cur.connecting = false | ||
| 76 | + connect_relation[id] = nil | ||
| 77 | +end | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + | ||
| 81 | +local function open() | ||
| 82 | + for logTo, data in pairs(logHandle) do | ||
| 83 | + if not data.connecting and not data.connected then | ||
| 84 | + data.connecting = true | ||
| 85 | + data.fd = socketdriver.connect(data.host, data.port) | ||
| 86 | + connect_relation[data.fd] = logTo | ||
| 87 | + end | ||
| 88 | + end | ||
| 89 | +end | ||
| 90 | + | ||
| 91 | +local function log(address, msg, logTo) | ||
| 92 | + logTo = logTo or "log" | ||
| 93 | + -- print(string.format(":%08x(%.2f): %s", address, skynet.time(), msg)) | ||
| 94 | + local cur = logHandle[logTo] | ||
| 95 | + if not cur then | ||
| 96 | + print("error log to ", logTo) | ||
| 97 | + end | ||
| 98 | + local doc = {} | ||
| 99 | + if cur.handle then | ||
| 100 | + cur.handle(doc, address, msg) | ||
| 101 | + end | ||
| 102 | + if cur.connected and cur.fd then | ||
| 103 | + socketdriver.send(cur.fd, json.encode(doc) .. "\n") | ||
| 104 | + else | ||
| 105 | + -- 断线会丢失一部分日志 | ||
| 106 | + if not cur.connecting then | ||
| 107 | + open() -- 连一下 | ||
| 108 | + end | ||
| 109 | + end | ||
| 110 | +end | ||
| 111 | + | ||
| 112 | + | ||
| 113 | +skynet.register_protocol { | ||
| 114 | + name = "socket", | ||
| 115 | + id = skynet.PTYPE_SOCKET, -- PTYPE_SOCKET = 6 | ||
| 116 | + unpack = socketdriver.unpack, | ||
| 117 | + dispatch = function (_, _, t, ...) | ||
| 118 | + if socket_message[t] then | ||
| 119 | + socket_message[t](...) | ||
| 120 | + end | ||
| 121 | + end | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | +-- register protocol text before skynet.start would be better. | ||
| 125 | +skynet.register_protocol { | ||
| 126 | + name = "text", | ||
| 127 | + id = skynet.PTYPE_TEXT, | ||
| 128 | + unpack = skynet.tostring, | ||
| 129 | + dispatch = function(_, address, msg) | ||
| 130 | + log(address, msg) | ||
| 131 | + end | ||
| 132 | +} | ||
| 133 | + | ||
| 134 | +skynet.register_protocol { | ||
| 135 | + name = "SYSTEM", | ||
| 136 | + id = skynet.PTYPE_SYSTEM, | ||
| 137 | + unpack = function(...) return ... end, | ||
| 138 | + dispatch = function() | ||
| 139 | + -- reopen signal | ||
| 140 | + print("SIGHUP") | ||
| 141 | + end | ||
| 142 | +} | ||
| 143 | + | ||
| 144 | +open() | ||
| 145 | +skynet.start(function()end) |
src/services/redisd.lua
| @@ -24,5 +24,8 @@ skynet.start(function() | @@ -24,5 +24,8 @@ skynet.start(function() | ||
| 24 | skynet.ret(skynet.pack(db[string.lower(cmd)](db, ...))) | 24 | skynet.ret(skynet.pack(db[string.lower(cmd)](db, ...))) |
| 25 | end | 25 | end |
| 26 | end) | 26 | end) |
| 27 | + skynet.info_func(function() | ||
| 28 | + skynet.ret(skynet.pack(skynet.call(skynet.self(), "debug", "STAT"))) | ||
| 29 | + end) | ||
| 27 | skynet.register ".redis" | 30 | skynet.register ".redis" |
| 28 | end) | 31 | end) |
| 29 | \ No newline at end of file | 32 | \ No newline at end of file |