role:同进程数据共享不再用 rpc
This commit is contained in:
@@ -8,6 +8,7 @@ import { RankFirstModel, RankFirstType } from '../../../db/RankFirst';
|
||||
import { getInitRoleInfo } from '../../../pubUtils/roleUtil';
|
||||
import { DEFAULT_HEROES } from '../../../consts';
|
||||
import { Figure } from '../../../domain/dbGeneral';
|
||||
import { getDefaultRoleInfo } from '../../../services/roleService';
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
return new RoleRemote(app);
|
||||
@@ -60,21 +61,18 @@ export class RoleRemote {
|
||||
}
|
||||
this.initRole = role;
|
||||
this.figureInfo = figureInfo;
|
||||
const initRoleInfos = getDefaultRoleInfo(this.initHeroes, this.initSkins, this.initRole, this.figureInfo);
|
||||
this.app.set('initRoleInfos', initRoleInfos);
|
||||
|
||||
}
|
||||
|
||||
public getInitRoleInfos() {
|
||||
let initInfos = [];
|
||||
for(let hid of DEFAULT_HEROES) {
|
||||
initInfos.push({
|
||||
heroInfo: this.initHeroes.get(hid),
|
||||
skinInfo: this.initSkins.get(hid)
|
||||
});
|
||||
let initRoleInfos = this.app.get('initRoleInfos');
|
||||
if (!initRoleInfos) {
|
||||
initRoleInfos = getDefaultRoleInfo(this.initHeroes, this.initSkins, this.initRole, this.figureInfo);
|
||||
this.app.set('initRoleInfos', initRoleInfos);
|
||||
}
|
||||
return {
|
||||
initInfos,
|
||||
role: this.initRole,
|
||||
figureInfo: this.figureInfo
|
||||
};
|
||||
return initRoleInfos;
|
||||
}
|
||||
|
||||
public getInitHeroes() {
|
||||
|
||||
Reference in New Issue
Block a user