排行:排行rpc同进程获取函数修改

This commit is contained in:
luying
2021-09-10 19:56:33 +08:00
parent 375d0bdab0
commit 14f7b3dd9c
6 changed files with 36 additions and 20 deletions
+11 -3
View File
@@ -3,7 +3,7 @@ import { Channel, pinus } from 'pinus';
import { getRandValueByMinMax, getRandEelm, decodeIdCntArrayStr } from '../pubUtils/util';
import { DEFAULT_HEROES, TERAPH_RANDOM } from "../consts";
import { DicTeraph } from '../pubUtils/dictionary/DicTeraph';
import { Teraph, RoleModel, RoleType } from '../db/Role';
import { Teraph, RoleModel, RoleType, RoleUpdate } from '../db/Role';
import { ROLE_SELECT } from '../consts';
import { SCHOOL } from '../pubUtils/dicParam';
import { gameData } from '../pubUtils/data';
@@ -12,6 +12,7 @@ import { SclResultInter, SclPosInter } from '../pubUtils/interface';
import { CheckMeterial } from './rewardService';
import { HeroUpdate } from '../db/Hero';
import { SkinUpdate } from '../db/Skin';
import { Figure } from '../domain/dbGeneral';
export async function getTeraphStrengthenResult(role: RoleType, count: number, dicTeraph: DicTeraph, teraph: Teraph) {
let criAttr: number[] = [], times = 0;
@@ -129,7 +130,7 @@ export async function getSchoolList(roleId: string) {
}
function getDefaultHeroInfos(heroes: Map<number, HeroUpdate>, skins: Map<number, SkinUpdate>) {
const initInfos = [];
const initInfos: { heroInfo: HeroUpdate, skinInfo: SkinUpdate}[] = [];
for(let hid of DEFAULT_HEROES) {
initInfos.push({
heroInfo: heroes.get(hid),
@@ -139,7 +140,14 @@ function getDefaultHeroInfos(heroes: Map<number, HeroUpdate>, skins: Map<number,
return initInfos;
}
export function getDefaultRoleInfo(heroes: Map<number, HeroUpdate>, skins: Map<number, SkinUpdate>, role, figureInfo) {
export function getDefaultRoleInfo(heroes: Map<number, HeroUpdate>, skins: Map<number, SkinUpdate>, role:RoleUpdate, figureInfo: { heads: Figure[], frames: Figure[], spines: Figure[] }) {
const initInfos = getDefaultHeroInfos(heroes, skins);
return { initInfos, role, figureInfo };
}
export function getInitHeroById(hid: number) {
return {
heroInfo: pinus.app.get('initHeroes').get(hid),
skinInfo: pinus.app.get('initSkins').get(hid)
}
}