全局:加载json方法全部改为最新

This commit is contained in:
luying
2021-05-06 20:25:05 +08:00
parent 2ef00e8179
commit 0315269387
36 changed files with 401 additions and 920 deletions
+4 -4
View File
@@ -23,7 +23,7 @@ import Counter from '@db/Counter';
import { STATUS, HERO_SYSTEM_TYPE } from '@consts';
import { ITID, COUNTER } from '@consts';
import { ItemModel } from '@db/Item';
import { gameData, getHeroExpByLv } from '@pubUtils/data';
import { gameData, getHeroExpByLv, getExpByLv } from '@pubUtils/data';
import { calPlayerCeAndSave, calculatetopLineup, calEquipSeids } from '@pubUtils/playerCe';
import { SchoolModel } from '@db/School';
import { Attribute } from '@domain/roleField/attribute';
@@ -250,7 +250,7 @@ export default class GMUsers extends Service {
for(let hid of hids) {
let hero = await HeroModel.findByHidAndRole(hid, roleId);
if(hero) continue;
let dicHero = ctx.service.utils.getHeroById(hid);
let dicHero = gameData.hero.get(hid);
if(!dicHero) continue;
const heroInfo = {
roleId, roleName: role.roleName, hid, serverId: role.serverId,
@@ -389,7 +389,7 @@ export default class GMUsers extends Service {
let lv = parseInt(_lv);
if(isNaN(lv)) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
for(let roleId of uids) {
let exp = ctx.service.utils.getExpByLv(lv - 1);
let exp = getExpByLv(lv - 1);
await RoleModel.levelup(roleId, lv, exp?exp.sum:0);
}
@@ -438,7 +438,7 @@ export default class GMUsers extends Service {
let { attr: roleAttrs } = role;
let dicHero = ctx.service.utils.getHeroById(hid);
let dicHero = gameData.hero.get(hid);
let attribute = new Attribute();
attribute.setByDbData(roleAttrs, heroAttrs);