Commit c8da6b56b73418024076cbc43dbbe270cc5990c4
Merge branch 'develop' into tr/cb
* develop: 充值返利邮件新增 调整压测
Showing
11 changed files
with
31 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 |
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 |