✨ feat(线上维护): json线上更新方案
This commit is contained in:
@@ -9,7 +9,8 @@ import { setApiIsClose } from '../../../services/chatService';
|
||||
import { setHiddenData } from '../../../services/memoryCache/hiddenData';
|
||||
import { setKvToMemory } from '../../../services/pushService';
|
||||
import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService';
|
||||
import { reloadResources } from '../../../pubUtils/data';
|
||||
import { gameData, reloadResources } from '../../../pubUtils/data';
|
||||
import * as dicParam from '../../../pubUtils/dicParam';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -109,11 +110,36 @@ export class ComBattleRemote {
|
||||
/**
|
||||
* 重载json资源
|
||||
*/
|
||||
public async reloadResources() {
|
||||
public async reloadResources(type?: string) {
|
||||
try {
|
||||
reloadResources();
|
||||
reloadResources(type);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async setDicParam(field1: string, field2: string, value: string|number) {
|
||||
try {
|
||||
if(dicParam[field1] && dicParam[field1][field2]) dicParam[field1][field2] = value;
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async setGameDataToApp() {
|
||||
try {
|
||||
this.app.set('gameData', gameData);
|
||||
this.app.set('dicParam', dicParam);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async fun() {
|
||||
try {
|
||||
console.log('预留一个函数,用于之后线上维护时需要使用');
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user