local ipairs = ipairs local table = table local math = math local next = next local string = string local redisproxy = redisproxy local MsgPack = MsgPack local getRandomName = getRandomName local mcast_util = mcast_util local string_format = string.format local tonumber = tonumber local require = require local table_insert = table.insert local tconcat = table.concat local _M = {} function _M.levelUpRpc( agent, data ) local role = agent.role local msg = MsgPack.unpack(data) local hero = role.heros[msg.id] if not hero then return end if hero:getProperty("level") >= hero:getMaxLevel() then return end hero:updateProperty({field = "level", delta = 1}) SendPacket(actionCodes.Hero_levelUpRpc, '') return true end return _M