后台:修复部分遗漏
This commit is contained in:
@@ -112,6 +112,10 @@ export class GmHandler {
|
|||||||
for(let { id } of systimerServers) {
|
for(let { id } of systimerServers) {
|
||||||
await this.app.rpc.systimer.systimerRemote.reloadResources.toServer(id);
|
await this.app.rpc.systimer.systimerRemote.reloadResources.toServer(id);
|
||||||
}
|
}
|
||||||
|
let orderServers = this.app.getServersByType('order');
|
||||||
|
for(let { id } of orderServers) {
|
||||||
|
await this.app.rpc.order.orderRemote.reloadResources.toServer(id);
|
||||||
|
}
|
||||||
return resResult(STATUS.SUCCESS, {
|
return resResult(STATUS.SUCCESS, {
|
||||||
isOK: true
|
isOK: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { Application, ChannelService } from 'pinus';
|
||||||
|
import { reloadResources } from '../../../pubUtils/data';
|
||||||
|
|
||||||
|
export default function (app: Application) {
|
||||||
|
return new OrderRemote(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OrderRemote {
|
||||||
|
|
||||||
|
constructor(private app: Application) {
|
||||||
|
this.app = app;
|
||||||
|
this.channelService = app.get('channelService');
|
||||||
|
}
|
||||||
|
|
||||||
|
private channelService: ChannelService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重载json资源
|
||||||
|
*/
|
||||||
|
public async reloadResources() {
|
||||||
|
reloadResources();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ import { RoleRemote } from './role/remote/roleRemote';
|
|||||||
import { GuildActivityRemote } from './guild/remote/guildActivityRemote';
|
import { GuildActivityRemote } from './guild/remote/guildActivityRemote';
|
||||||
import { GuildRemote as GuildRemote2 } from './guild/remote/guildRemote';
|
import { GuildRemote as GuildRemote2 } from './guild/remote/guildRemote';
|
||||||
import { ActivityRemote } from './activity/remote/activityRemote';
|
import { ActivityRemote } from './activity/remote/activityRemote';
|
||||||
|
import { OrderRemote } from './order/remote/orderRemote';
|
||||||
declare global {
|
declare global {
|
||||||
interface UserRpc {
|
interface UserRpc {
|
||||||
activity: {
|
activity: {
|
||||||
@@ -42,6 +43,9 @@ declare global {
|
|||||||
},
|
},
|
||||||
role: {
|
role: {
|
||||||
roleRemote: RemoterClass<FrontendSession, RoleRemote>;
|
roleRemote: RemoterClass<FrontendSession, RoleRemote>;
|
||||||
|
},
|
||||||
|
order: {
|
||||||
|
orderRemote: RemoterClass<FrontendSession, OrderRemote>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { TASK_TYPE, ACTIVITY_RESOURCES_TYPE, ACTIVITY_TYPE } from '../../consts';
|
import { ACTIVITY_RESOURCES_TYPE, ACTIVITY_TYPE } from '../../consts';
|
||||||
import { ActivityModelType } from '../../db/Activity';
|
import { ActivityModelType } from '../../db/Activity';
|
||||||
import { ActivityBuyRecordsModelType } from '../../db/ActivityBuyRecords';
|
import { ActivityBuyRecordsModelType } from '../../db/ActivityBuyRecords';
|
||||||
import { ActivityGrowthFundModelType } from '../../db/ActivityGrowthFund';
|
import { ActivityGrowthFundModelType } from '../../db/ActivityGrowthFund';
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import moment = require('moment');
|
import moment = require('moment');
|
||||||
import { ACTIVITY_RESOURCES_TYPE } from '../../consts';
|
|
||||||
import { ActivityModelType } from '../../db/Activity';
|
import { ActivityModelType } from '../../db/Activity';
|
||||||
import { ActivityShopModelType } from '../../db/ActivityShop';
|
import { ActivityShopModelType } from '../../db/ActivityShop';
|
||||||
import { ActivityBase } from './activityField';
|
import { ActivityBase } from './activityField';
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { SELF_SERVICE_SHOP_CELL_TYPE, ACTIVITY_RESOURCES_TYPE, ACTIVITY_TYPE } from '../../consts';
|
|
||||||
import { ActivityModelType } from '../../db/Activity';
|
import { ActivityModelType } from '../../db/Activity';
|
||||||
import { ActivitySelfServiceShopModelType } from '../../db/ActivitySelfServiceShop';
|
import { ActivitySelfServiceShopModelType } from '../../db/ActivitySelfServiceShop';
|
||||||
import { deltaDays } from '../../pubUtils/util';
|
|
||||||
import { ActivityBase } from './activityField';
|
import { ActivityBase } from './activityField';
|
||||||
|
|
||||||
// 自助商店数据坑位数据
|
// 自助商店数据坑位数据
|
||||||
|
|||||||
+25
-21
@@ -81,6 +81,7 @@ import { dicGacha, loadGacha } from "./dictionary/DicGacha";
|
|||||||
import { dicGachaContent, dicGachaContentHero, loadGachaContent } from "./dictionary/DicGachaContent";
|
import { dicGachaContent, dicGachaContentHero, loadGachaContent } from "./dictionary/DicGachaContent";
|
||||||
import { dicGiftPackage, loadGiftPackage } from "./dictionary/DicGiftPackage";
|
import { dicGiftPackage, loadGiftPackage } from "./dictionary/DicGiftPackage";
|
||||||
import { dicRecruit, loadRecruit } from './dictionary/DicRecruit';
|
import { dicRecruit, loadRecruit } from './dictionary/DicRecruit';
|
||||||
|
import { loadRMB } from './dictionary/DicRMB';
|
||||||
|
|
||||||
export const gameData = {
|
export const gameData = {
|
||||||
blurprtCompose: dicBlueprtCompose,
|
blurprtCompose: dicBlueprtCompose,
|
||||||
@@ -756,34 +757,37 @@ function loadDatas() {
|
|||||||
loadGachaContent();
|
loadGachaContent();
|
||||||
loadGiftPackage();
|
loadGiftPackage();
|
||||||
loadRecruit();
|
loadRecruit();
|
||||||
|
loadRMB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重载dicParam
|
// 重载dicParam
|
||||||
export function reloadDicParam() {
|
export function reloadDicParam() {
|
||||||
let file = readTsFile('dicParam');
|
let file = readTsFile('dicParam');
|
||||||
|
if(file) {
|
||||||
let lines = file.split('\n');
|
let lines = file.split('\n');
|
||||||
let outer = '';
|
let outer = '';
|
||||||
lines.forEach(line => {
|
lines.forEach(line => {
|
||||||
if(line.replace(/ /g, '')) {
|
if(line.replace(/ /g, '')) {
|
||||||
if(line.indexOf('export') != -1) {
|
if(line.indexOf('export') != -1) {
|
||||||
outer = line.split(' ')[2];
|
outer = line.split(' ')[2];
|
||||||
// console.log(outer)
|
// console.log(outer)
|
||||||
}
|
}
|
||||||
if(line.indexOf('export') == -1 && line.indexOf('}') == -1) {
|
if(line.indexOf('export') == -1 && line.indexOf('}') == -1) {
|
||||||
let s = line.split(', //')[0].split(':');
|
let s = line.split(', //')[0].split(':');
|
||||||
let key = s[0].replace(/ /g, '');
|
let key = s[0].replace(/ /g, '');
|
||||||
let value = s[1].replace(/ /g, '');
|
let value = s[1].replace(/ /g, '');
|
||||||
let isString = value.match(/(?<=')[^']*/);
|
let isString = value.match(/(?<=')[^']*/);
|
||||||
if(isString) {
|
if(isString) {
|
||||||
param[outer][key] = isString[0];
|
param[outer][key] = isString[0];
|
||||||
} else {
|
} else {
|
||||||
param[outer][key] = parseFloat(value);
|
param[outer][key] = parseFloat(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
parseDicParam();
|
||||||
parseDicParam();
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 后台调用重载资源
|
// 后台调用重载资源
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
import { readJsonFile, parseGoodStr } from '../util'
|
|
||||||
import { FILENAME } from '../../consts'
|
|
||||||
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
|
||||||
import { RewardInter } from '../interface';
|
|
||||||
const _ = require('lodash');
|
|
||||||
|
|
||||||
export interface DicArmyBossRank {
|
|
||||||
readonly id: number;
|
|
||||||
readonly rankMin: number;
|
|
||||||
readonly rankMax: number;
|
|
||||||
readonly reward: Array<RewardInter>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const DicArmyBossRankKeys: KeysEnum<DicArmyBossRank> = {
|
|
||||||
id: true,
|
|
||||||
rankMin: true,
|
|
||||||
rankMax: true,
|
|
||||||
reward: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
const str = readJsonFile(FILENAME.DIC_ARMY_BOSS_RANK_REWARD);
|
|
||||||
let arr = JSON.parse(str);
|
|
||||||
|
|
||||||
export const dicArmyBossRank = new Array<DicArmyBossRank>();
|
|
||||||
arr.forEach(o => {
|
|
||||||
o.reward = parseGoodStr(o.reward);
|
|
||||||
dicArmyBossRank.push(_.pick(o, Object.keys(DicArmyBossRankKeys)));
|
|
||||||
});
|
|
||||||
arr = undefined;
|
|
||||||
@@ -405,8 +405,12 @@ export function readWarJsonFileList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function readTsFile(fileName: string) {
|
export function readTsFile(fileName: string) {
|
||||||
let file = fs.readFileSync(path.resolve(__dirname, `../pubUtils/${fileName}.ts`)).toString('utf8').replace(/^\uFEFF/, '');
|
try {
|
||||||
return file;
|
let file = fs.readFileSync(path.resolve(__dirname, `../pubUtils/${fileName}.ts`)).toString('utf8').replace(/^\uFEFF/, '');
|
||||||
|
return file;
|
||||||
|
} catch(e) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function readFileAndParse(fileName: string) {
|
export function readFileAndParse(fileName: string) {
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ function aesDecrypt(data, key, iv) {
|
|||||||
module.exports = options => {
|
module.exports = options => {
|
||||||
return async function parmsDecode(ctx: Context, next) {
|
return async function parmsDecode(ctx: Context, next) {
|
||||||
let m = ctx.request.url.indexOf("/dev");
|
let m = ctx.request.url.indexOf("/dev");
|
||||||
if(m == 0) {
|
let n = ctx.request.url.indexOf("/web");
|
||||||
|
if(m == 0 || n == 0) {
|
||||||
await next();
|
await next();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user