修改debug模式开关读取地点

This commit is contained in:
luying
2022-05-16 11:43:44 +08:00
parent 51f859f120
commit 7e768a4065
12 changed files with 57 additions and 37 deletions

View File

@@ -27,8 +27,12 @@ export interface DicServerConst {
readonly CLOSE_LOGIN_WHEN_ONLINE_MAX: number;
// 最大在线人数
readonly MAX_ONLINE_USER_COUNT: number;
// debug模式
// 是否开启支付0.01元
readonly DEBUG_PAY: number;
// 是否开启时间修改
readonly DEBUG_TIME: number;
// 是否检查屏蔽词
readonly CHECK_WORD: number;
}
export const dicServerConst: DicServerConst = {} as DicServerConst;

View File

@@ -1,8 +1,9 @@
import { REDIS_KEY, SDK_37_ADDR, SDK_37_CONST, WJX_KEY } from '../consts';
import { DEBUG_PRICE, REDIS_KEY, SDK_37_ADDR, SDK_37_CONST, WJX_KEY } from '../consts';
import { request37 } from './httpUtil';
import { nowSeconds } from './timeUtil';
import { LoginValidataReturn37, Chat37Params, GetServerListParam } from '../domain/sdk';
import * as crypto from 'crypto'
import { isDebugPay } from './util';
// 通用加密方法
@@ -138,4 +139,10 @@ export function checkWjxSign(activity: string, index: string, sign: string) {
console.log('##### checkWjxSign', str, signResult, sign);
if(signResult != sign) return false;
return true;
}
export function checkParamPrice(orderPrice: number, paramPrice: string) {
if(!isDebugPay() && orderPrice != parseFloat(paramPrice)) return false;
if(isDebugPay() && parseFloat(paramPrice) != DEBUG_PRICE) return false;
return true
}

View File

@@ -12,6 +12,7 @@ import { getTimeFunM } from './timeUtil';
import { Floor } from '../domain/activityField/gachaField';
import { WhiteListModel } from '../db/RegionWhiteList';
import { RewardInter } from './interface';
import { gameData } from './data';
const randomName = require("chinese-random-name");
const moment = require('moment');
const crypto = require('crypto');
@@ -821,3 +822,14 @@ export function addToMap<T>(map: Map<T, number>, id: T, value: number) {
// return { topLineup, topLineupCe };
// }
export function isDebugTime() {
return gameData.serverConst.DEBUG_TIME === 1;
}
export function isDebugPay() {
return gameData.serverConst.DEBUG_PAY === 1;
}
export function isCheckWord() {
return gameData.serverConst.CHECK_WORD === 1;
}

View File

@@ -16,5 +16,7 @@
{ "id": 8, "desc": "捐赠", "route": "guild.donateHandler.donate", "param": {}, "interval": 200 },
{ "id": 9, "desc": "碾压镇念塔", "route": "battle.towerBattleHandler.skipTower", "param": {}, "interval": 200 }
],
"DEBUG_PAY": 0
"DEBUG_PAY": 0,
"DEBUG_TIME": 0,
"CHECK_WORD": 1
}