武将:抽象武将创建接口

This commit is contained in:
luying
2021-04-23 19:32:02 +08:00
parent 2b246c4bc9
commit 0cd6939f5e
18 changed files with 213 additions and 95 deletions

View File

@@ -252,11 +252,9 @@ export default class GMUsers extends Service {
if(hero) continue;
let dicHero = ctx.service.utils.getHeroById(hid);
if(!dicHero) continue;
let {quality, initialStars: star, jobid: job, name: hName, initialSkin} = dicHero;
const heroInfo = {
roleId, roleName: role.roleName, hid, hName, star, quality, job, serverId: role.serverId,
lv: hlv, exp: getHeroExpByLv(hlv - 1)||0,
skins:[{id: initialSkin, enable: true}],
roleId, roleName: role.roleName, hid, serverId: role.serverId,
lv: hlv, exp: getHeroExpByLv(hlv - 1)||0
}
heroInfos.push(heroInfo);
}
@@ -267,7 +265,7 @@ export default class GMUsers extends Service {
try {
for(let heroInfo of heroInfos) {
await pubCreateHero(heroInfo.roleId, heroInfo);
await pubCreateHero(heroInfo.roleId, heroInfo.roleName, heroInfo.serverId, heroInfo);
}
return ctx.service.utils.resResult(STATUS.SUCCESS, { uids });
} catch(e) {