Commit 7d31daa8e859a795bacd8236443a0831673e7184

Authored by zhouhaihai
1 parent 1be37174

调整压测

robot/robot.lua
... ... @@ -34,6 +34,9 @@ local ignoreListener = {
34 34 ["Role.changeUpdate"] = true,
35 35 ["Role.loadRunes"] = true,
36 36 ["Hero.loadInfos"] = true,
  37 + ["Store.updateproperty"] = true,
  38 + ["Sys.maintainNotice"] = true,
  39 + ["Hero.drawHeroExtraRewardNtf"] = true,
37 40 ["Sys.innerErrorMsg"] = function(data)
38 41 local msg = MsgPack.unpack(data)
39 42 log("innerErrorMsg: " .. msg.id)
... ... @@ -123,11 +126,6 @@ local function startUnit(unit)
123 126 unitTest.new(client):startTest()
124 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 131 function CMD.task()
... ... @@ -155,6 +153,9 @@ end
155 153  
156 154 -- 退出
157 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 159 skynet.exit()
159 160 end
160 161  
... ...
robot/start.lua
... ... @@ -19,9 +19,9 @@ function MSG.open( ... )
19 19 end
20 20  
21 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 25 log(string_format("logout %s", fd2serv[fd].id))
26 26  
27 27 id2fd[fd2serv[fd].id] = nil
... ... @@ -94,8 +94,8 @@ local function add_robot()
94 94  
95 95 -- 定时下线
96 96 skynet.timeout(math.randomInt(config.online_time[1], config.online_time[2]) * 100, function()
97   - socketdriver.close(fd)
98 97 MSG.close(fd)
  98 + socketdriver.close(fd)
99 99 end)
100 100 end
101 101  
... ...
robot/unitTest/hero.lua
... ... @@ -26,7 +26,7 @@ end
26 26  
27 27 function _M:drawHero()
28 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 30 end
31 31  
32 32 function _M:drawHero10()
... ...
src/actions/HangAction.lua
... ... @@ -278,7 +278,6 @@ function _M.endBattleRpc(agent, data)
278 278 local cfg = csvdb["idle_battleCsv"][nextCarbonId]
279 279 if cfg then
280 280 hangInfo.bossTime = skynet.timex() + cfg.idle_time
281   - print(hangInfo.bossTime)
282 281 end
283 282 end
284 283 role:updateProperty({field = "hangInfo", value = hangInfo})
... ...
src/actions/RoleAction.lua
... ... @@ -977,7 +977,7 @@ function _M.chatRpc(agent, data)
977 977 role:log("communication", {
978 978 publish_type = cmd, --发言类型,1,世界 2私聊
979 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 981 publish_text = content, --发言内容
982 982 })
983 983 SendPacket(actionCodes.Role_chatRpc, MsgPack.pack({result = result, waitTime = waitTime}))
... ...
src/models/RolePlugin.lua
... ... @@ -238,7 +238,7 @@ function RolePlugin.bind(Role)
238 238 end
239 239  
240 240 if params.log then
241   - local log = params.log
  241 + local log = clone(params.log)
242 242 if log["cint1"] or log["cint2"] then
243 243 print("addPlayExp error log have cint1 or cint2 or cint3", debug.traceback())
244 244 end
... ... @@ -275,7 +275,7 @@ function RolePlugin.bind(Role)
275 275  
276 276 self:logItems(params.itemId, origin, nums, params.log)
277 277 if params.log then
278   - local log = params.log
  278 + local log = clone(params.log)
279 279 if log["cint1"] or log["cint2"] then
280 280 print("addItem error log have cint1 or cint2 ", debug.traceback())
281 281 end
... ... @@ -299,7 +299,7 @@ function RolePlugin.bind(Role)
299 299 function Role:checkItemEnough(itemCountT)
300 300 local less = {}
301 301 if not next(itemCountT) then
302   - return false, less
  302 + return true, less
303 303 end
304 304 for itemId, count in pairs(itemCountT) do
305 305 if count <= 0 then
... ... @@ -360,7 +360,7 @@ function RolePlugin.bind(Role)
360 360  
361 361 self:logItems(ItemId.Diamond, origin, count, params.log)
362 362 if params.log then
363   - local log = params.log
  363 + local log = clone(params.log)
364 364 if log["cint1"] or log["cint2"] or log["cint3"] then
365 365 print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback())
366 366 end
... ... @@ -410,7 +410,7 @@ function RolePlugin.bind(Role)
410 410  
411 411 self:logItems(ItemId.Diamond, origin, count, params.log)
412 412 if params.log then
413   - local log = params.log
  413 + local log = clone(params.log)
414 414 if log["cint1"] or log["cint2"] or log["cint3"] then
415 415 print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback())
416 416 end
... ... @@ -459,7 +459,7 @@ function RolePlugin.bind(Role)
459 459 self:logItems(heroType + ItemStartId.Hero, 0, 1, params.log)
460 460  
461 461 if params.log then
462   - local log = params.log
  462 + local log = clone(params.log)
463 463 if log["cint1"] or log["cint2"] or log["cint3"] then
464 464 print("addHero error log have cint1 or cint2 or cint3 ", debug.traceback())
465 465 end
... ... @@ -580,7 +580,7 @@ function RolePlugin.bind(Role)
580 580  
581 581 self:logItems(equipCsv.id, oldCount, curCount, pms.log)
582 582 if pms.log then
583   - local log = pms.log
  583 + local log = clone(pms.log)
584 584 if log["cint1"] or log["cint2"] or log["cint3"] then
585 585 print("addEquip error log have cint1 or cint2 or cint3 ", debug.traceback())
586 586 end
... ... @@ -656,7 +656,7 @@ function RolePlugin.bind(Role)
656 656  
657 657 self:logItems(params.id, 0, 1, params.log)
658 658 if params.log then
659   - local log = params.log
  659 + local log = clone(params.log)
660 660 if log["cint1"] or log["cint2"] or log["cint3"] then
661 661 print("addRune error log have cint1 or cint2 or cint3 ", debug.traceback())
662 662 end
... ... @@ -686,7 +686,7 @@ function RolePlugin.bind(Role)
686 686  
687 687 self:logItems(rune:getProperty("id"), 1, 0, params.log)
688 688 if params.log then
689   - local log = params.log
  689 + local log = clone(params.log)
690 690 if log["cint1"] or log["cint2"] or log["cint3"] then
691 691 print("delRunes error log have cint1 or cint2 or cint3 ", debug.traceback())
692 692 end
... ... @@ -946,7 +946,7 @@ function RolePlugin.bind(Role)
946 946  
947 947 self:logItems(func, 0, count, params.log)
948 948 if params.log then
949   - local log = params.log
  949 + local log = clone(params.log)
950 950 if log["cint1"] or log["cint2"] or log["cint3"] then
951 951 print("funcOpen error log have cint1 or cint2 or cint3 ", debug.traceback())
952 952 end
... ...
src/services/redisd.lua
... ... @@ -24,5 +24,8 @@ skynet.start(function()
24 24 skynet.ret(skynet.pack(db[string.lower(cmd)](db, ...)))
25 25 end
26 26 end)
  27 + skynet.info_func(function()
  28 + skynet.ret(skynet.pack(skynet.call(skynet.self(), "debug", "STAT")))
  29 + end)
27 30 skynet.register ".redis"
28 31 end)
29 32 \ No newline at end of file
... ...