后台:json上传
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { readJsonFile } from '../util'
|
||||
import { readFileAndParse } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicGkPvp {
|
||||
@@ -8,12 +8,14 @@ export interface DicGkPvp {
|
||||
readonly warType: number;
|
||||
}
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_GK_PVP);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicGkPvp = new Map<number, DicGkPvp>();
|
||||
export const dicGkPvps = new Array<number>();
|
||||
arr.forEach(o => {
|
||||
dicGkPvp.set(o.war_id, o);
|
||||
dicGkPvps.push(o.war_id);
|
||||
});
|
||||
export function loadGkPvp() {
|
||||
let arr = readFileAndParse(FILENAME.DIC_GK_PVP);
|
||||
|
||||
arr.forEach(o => {
|
||||
dicGkPvp.set(o.war_id, o);
|
||||
dicGkPvps.push(o.war_id);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user