全局:加载json方法全部改为最新
This commit is contained in:
@@ -3,10 +3,8 @@ import { ExpeditionPointModel } from '../db/ExpeditionPoint';
|
||||
import Role, { RoleModel, RoleType } from '../db/Role';
|
||||
import { PvpDefenseModel } from '../db/PvpDefense';
|
||||
|
||||
import { getWarJsons, getGamedata } from '../pubUtils/gamedata';
|
||||
import { decodeStr, shouldRefresh } from '../pubUtils/util';
|
||||
import { EXPEDITION_CONST, HERO_CE_RATIO } from '../consts';
|
||||
import { getAtrrNameById} from '../consts';
|
||||
import { shouldRefresh } from '../pubUtils/util';
|
||||
import { EXPEDITION_CONST } from '../consts';
|
||||
import { ExpeditionWarRecordModel } from '../db/ExpeditionWarRecord';
|
||||
import { HeroType } from '../db/Hero';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
@@ -80,7 +78,7 @@ export async function findOrCreateEnemies(roleId: string, myCe: number, expediti
|
||||
* @param enemyObj 返回的敌军数据
|
||||
*/
|
||||
export async function matchPlayers(roleId: string, scale: number, range: number, myCe: number, warJsonIndex:any, enemyObj: {enemyFrom: number, enemyId: string, enemies: Array<any>, ce: number }) {
|
||||
let {json: dicWarJson } = getWarJsons(warJsonIndex);
|
||||
let dicWarJson = gameData.warJson.get(warJsonIndex);
|
||||
|
||||
let min = myCe * scale * (1 - range/100);
|
||||
let max = myCe * scale * (1 + range/100);
|
||||
@@ -183,12 +181,13 @@ export async function getPointRewardStatus(roleId: string, role?: Role) {
|
||||
role = await RoleModel.findByRoleId(roleId);
|
||||
}
|
||||
let {expeditionPoint = 0} = role;
|
||||
let dicExpeditionPoint = getGamedata('dic_expedition_point');
|
||||
let dicExpeditionPoint = gameData.expeditionPoint;
|
||||
let rewards: { point: number, received: boolean }[] = [];
|
||||
for(let [point] of dicExpeditionPoint) {
|
||||
rewards.push({ point, received: false })
|
||||
}
|
||||
let pointRewards = {
|
||||
expeditionPoint,
|
||||
rewards: dicExpeditionPoint.map(cur => {
|
||||
return { point: cur.point, received: false }
|
||||
})
|
||||
expeditionPoint, rewards
|
||||
};
|
||||
let pointStatusInDatabase = await ExpeditionPointModel.getExpeditionPoint(roleId);
|
||||
if(pointStatusInDatabase) {
|
||||
|
||||
Reference in New Issue
Block a user