好友:修改查看武将
This commit is contained in:
@@ -627,28 +627,35 @@ export class FriendHandler {
|
||||
}
|
||||
|
||||
// 查看对象武将详细
|
||||
public async getHeroDetail(msg: { roleId: string, hid: number }, session: BackendSession) {
|
||||
public async getHeroDetail(msg: { roleId: string, hids: number[] }, session: BackendSession) {
|
||||
// let roleId: string = session.get('roleId');
|
||||
// let sid: string = session.get('sid');
|
||||
|
||||
let { roleId: hisRoleId, hid } = msg;
|
||||
let { roleId: hisRoleId, hids } = msg;
|
||||
|
||||
let role = await RoleModel.findByRoleId(hisRoleId, ROLE_SELECT.ATTR);
|
||||
if(!role) return resResult(STATUS.ROLE_NOT_FOUND);
|
||||
|
||||
let hero = await HeroModel.findByHidAndRole(hid, hisRoleId, HERO_SELECT.HERO_DETAIL, true);
|
||||
if(!hero) return resResult(STATUS.HERO_NOT_FIND);
|
||||
let heroList = await HeroModel.findByHidRange(hids, hisRoleId, HERO_SELECT.HERO_DETAIL, true);
|
||||
if(heroList.length <= 0) return resResult(STATUS.HERO_NOT_FIND);
|
||||
|
||||
let { roleId, roleName, hName, ce, lv, star, colorStar, quality, job, skins } = hero;
|
||||
let curSkin = skins.find(cur => cur.enable);
|
||||
let equips = await EquipModel.findListByHidAndRole(hisRoleId, hid, EQUIP_SELECT.HERO_DETAIL);
|
||||
let list = new Array();
|
||||
for(let {roleId, roleName, hid, hName, ce, lv, star, colorStar, quality, job, skins, ceAttr} of heroList) {
|
||||
|
||||
let attributes = getPlayerMainAttribute(hero.ceAttr, role.globalCeAttr);
|
||||
let curSkin = skins.find(cur => cur.enable);
|
||||
let equips = await EquipModel.findListByHidAndRole(hisRoleId, hid, EQUIP_SELECT.HERO_DETAIL);
|
||||
|
||||
let attributes = getPlayerMainAttribute(ceAttr, role.globalCeAttr);
|
||||
|
||||
list.push({
|
||||
roleId, roleName, hid, hName, ce, lv, star, colorStar, quality, job,
|
||||
skin: curSkin?curSkin.id: 0, equips, attributes
|
||||
});
|
||||
|
||||
return {
|
||||
roleId, roleName, hid, hName, ce, lv, star, colorStar, quality, job,
|
||||
skin: curSkin?curSkin.id: 0, equips, attributes
|
||||
}
|
||||
|
||||
|
||||
return resResult(STATUS.SUCCESS, { list });
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user