diff --git a/robot/robot.lua b/robot/robot.lua index bc5af91..63c8396 100644 --- a/robot/robot.lua +++ b/robot/robot.lua @@ -131,7 +131,8 @@ end -- 登录成功开始任务 function CMD.task() heartBeat() - skynet.sleep(math.randomInt(100, 1000)) + -- 20 秒后开始执行任务 错开登录 + skynet.sleep(math.randomInt(2000, 3000)) startUnit() end diff --git a/robot/robot_config.lua b/robot/robot_config.lua index ff3b3d3..d8d422f 100644 --- a/robot/robot_config.lua +++ b/robot/robot_config.lua @@ -18,21 +18,21 @@ return { online = 100, -- 稳定状态在线人数 inpre = 10, -- 稳定前每秒进入人数 -- 必须小于online数 max = 200, -- 最大玩家数 必须大于 online 数 - online_time = {10, 60}, -- 在线时间控制 秒 + online_time = {10 * 60, 20 * 60}, -- 在线时间控制 秒 uname_prefix = "robothehe", --机器名称前缀 -- 机器上线后的行为 units = { - chat = {weight = 1}, -- 聊天 - item = {weight = 1}, -- 物品操作 - hero = {weight = 1}, -- 英雄 - hang = {weight = 1}, -- 挂机战斗 - tower = {weight = 1}, -- 爬塔 - car = {weight = 1}, -- 爬塔 - pvp = {weight = 1}, -- pvp - email = {weight = 1}, -- 邮件 - adv = {weight = 1}, -- 冒险 + chat = {weight = 100}, -- 聊天 + item = {weight = 100}, -- 物品操作 + hero = {weight = 500}, -- 英雄 + hang = {weight = 1000}, -- 挂机战斗 + tower = {weight = 500}, -- 爬塔 + car = {weight = 100}, -- 爬塔 + pvp = {weight = 500}, -- pvp + email = {weight = 100}, -- 邮件 + adv = {weight = 200}, -- 冒险 } } diff --git a/robot/start.lua b/robot/start.lua index a23d7d4..e624e0e 100644 --- a/robot/start.lua +++ b/robot/start.lua @@ -25,7 +25,6 @@ end function MSG.close(fd) if fd2serv[fd] and not fd2serv[fd].closing then fd2serv[fd].closing = true - print(fd2serv[fd].agent) skynet.call(fd2serv[fd].agent, "lua", "exit") pcall(skynet.send, poold, "lua", "feed") @@ -131,6 +130,9 @@ local function start(pooldp, pooldObj, onlineCountp, startIdp, endIdp, inprep) for i = 1, onlineCount, inpre do for j = 1, inpre do + if i + j - 1 > onlineCount then + break + end add_robot() end skynet.sleep(100) -- libgit2 0.21.2