diff --git a/robot/robot.lua b/robot/robot.lua index cf54b49..408b144 100644 --- a/robot/robot.lua +++ b/robot/robot.lua @@ -120,7 +120,7 @@ local function startUnit(unit) local ok, unitTest = pcall(require, "unitTest." .. unit) if not ok then - print("unitTest load error : " .. unitTest) + log("unitTest load error : " .. unitTest) end unitTest.new(client):startTest() @@ -142,7 +142,7 @@ function CMD.start(fd, id) client.uname = uname local status, body = httpc.get(config.http, "/login?" .. httpGetFormatData({token = uname, device = "test", channel = "develop"})) if tonumber(status) ~= 200 then - print("http get error", uname, body) + log("http get error", uname, body) return end local servInfo = json.decode(body) @@ -170,7 +170,7 @@ skynet.register_protocol { dispatch = function(session, address, cmd, data) local actionName = actionHandlers[cmd] if not actionName then - print("actionName not exist", actionName) + log("actionName not exist", actionName) return end diff --git a/robot/robot_config.lua b/robot/robot_config.lua index ea294cc..ff3b3d3 100644 --- a/robot/robot_config.lua +++ b/robot/robot_config.lua @@ -20,19 +20,19 @@ return { max = 200, -- 最大玩家数 必须大于 online 数 online_time = {10, 60}, -- 在线时间控制 秒 - uname_prefix = "robot", --机器名称前缀 + uname_prefix = "robothehe", --机器名称前缀 -- 机器上线后的行为 units = { - 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}, -- 冒险 + 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}, -- 冒险 } } diff --git a/robot/start.lua b/robot/start.lua index 79b0f9f..228b5d4 100644 --- a/robot/start.lua +++ b/robot/start.lua @@ -15,7 +15,7 @@ local id_max = 0 -- robot id function MSG.open( ... ) - print("open", ...) + log("open", ...) end function MSG.close(fd) @@ -30,7 +30,7 @@ function MSG.close(fd) end function MSG.error(fd, msg) - print("MSG.error", fd, msg) + log("MSG.error", fd, msg) MSG.close(fd) end diff --git a/robot/unitTest/adv.lua b/robot/unitTest/adv.lua index e5e53e2..654dd82 100644 --- a/robot/unitTest/adv.lua +++ b/robot/unitTest/adv.lua @@ -8,6 +8,8 @@ local _M = class("hang", require("unitTest.unitTest")) function _M:start() sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "fb", pm1 = 10606})) + requestServer(actionCodes.Adv_roleFormatRpc, MsgPack.pack({index = 1, title = "hehe", leader = 1, leader2 = 2, heros = {[1] = 1, [2] = 2}})) + requestServer(actionCodes.Adv_selectTeamRpc, MsgPack.pack({index = 1})) self:task() end @@ -24,8 +26,8 @@ function _M:task() end function _M:startAdv() - sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "advf", pm1 = 10606})) - requestServer(actionCodes.Adv_startAdvRpc, MsgPack.pack({chapterId = 101, format = {leader = 1, leader2 = 2, heros = {[1] = 1, [2] = 2}}})) + sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "advf"})) + requestServer(actionCodes.Adv_startAdvRpc, MsgPack.pack({chapterId = 101})) requestServer(actionCodes.Adv_exitAdvRpc, '') end diff --git a/robot/unitTest/hero.lua b/robot/unitTest/hero.lua index 747b3bc..dca373d 100644 --- a/robot/unitTest/hero.lua +++ b/robot/unitTest/hero.lua @@ -35,8 +35,8 @@ function _M:drawHero10() end function _M:createHeroRandom() - sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 703, pm2 = 20})) - requestServer(actionCodes.Hero_createHeroRandomRpc, MsgPack.pack({itemId = 703})) + sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 722, pm2 = 40})) + requestServer(actionCodes.Hero_createHeroRandomRpc, MsgPack.pack({itemId = 722})) end -- libgit2 0.21.2