local MsgPack = MsgPack local skynet = require "skynet" local TIME_WAIT = 10 local _M = class("hang", require("unitTest.unitTest")) function _M:start() sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "fb", pm1 = 10606})) self:task() end local taskMap = { towerBattle = {100}, towerRank = {3}, } function _M:task() local curTask = math.randWeight(taskMap, 1) self[curTask](self) skynet.timeout(TIME_WAIT * 100, handler(self, self.task)) end function _M:towerBattle() sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "tower", pm1 = 1})) requestServer(actionCodes.Tower_startBattleRpc, MsgPack.pack({id = 1}), function(data) requestServer(actionCodes.Tower_endBattleRpc, MsgPack.pack({key = self.client.role.towerInfo.k, id = 1, passTime = 100, starNum = 1})) end) end function _M:towerRank() requestServer(actionCodes.Tower_rankRpc, MsgPack.pack({id = 1})) end return _M