关闭sdk屏蔽
This commit is contained in:
@@ -10,6 +10,7 @@ import { errlogger } from "../../../util/logger";
|
|||||||
import { gameData } from "../../../pubUtils/data";
|
import { gameData } from "../../../pubUtils/data";
|
||||||
import { sendMessageToUser } from "../../../services/pushService";
|
import { sendMessageToUser } from "../../../services/pushService";
|
||||||
import { isCheckWord } from "../../../pubUtils/sdkUtil";
|
import { isCheckWord } from "../../../pubUtils/sdkUtil";
|
||||||
|
import { isDevelopEnv } from "../../../services/utilService";
|
||||||
export function globalFilter(app: Application) {
|
export function globalFilter(app: Application) {
|
||||||
return new Filter(app);
|
return new Filter(app);
|
||||||
}
|
}
|
||||||
@@ -105,7 +106,7 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
|
|||||||
}
|
}
|
||||||
|
|
||||||
let hasBlockWords = false;
|
let hasBlockWords = false;
|
||||||
if(isCheckWord()) {
|
if(isCheckWord(isDevelopEnv())) {
|
||||||
switch(routeRecord.route) {
|
switch(routeRecord.route) {
|
||||||
case 'chat.chatHandler.sendPrivateMessage':
|
case 'chat.chatHandler.sendPrivateMessage':
|
||||||
{
|
{
|
||||||
|
|||||||
6
game-server/app/services/utilService.ts
Normal file
6
game-server/app/services/utilService.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { pinus } from "pinus";
|
||||||
|
|
||||||
|
export function isDevelopEnv() {
|
||||||
|
const envs = ['development', 'monitor']
|
||||||
|
return envs.indexOf(pinus.app.get('env')) != -1;
|
||||||
|
}
|
||||||
@@ -155,6 +155,6 @@ export function isDebugPay() {
|
|||||||
return gameData.serverConst.DEBUG_PAY === 1;
|
return gameData.serverConst.DEBUG_PAY === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isCheckWord() {
|
export function isCheckWord(isDevelop = false) {
|
||||||
return gameData.serverConst.CHECK_WORD === 1;
|
return gameData.serverConst.CHECK_WORD === 1 && !isDevelop;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user