修改debug模式开关读取地点
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { DividendModel } from './../db/Dividend';
|
||||
import { LOT_CODE_LEN, AUCTION_STAGE, AUCTION_TIME, DIVIDEND_CODE_LEN, DIVIDEND_STATUS, LOT_STATUS, MAIL_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, DIVIDENDMAXRATIO, DIVIDENDPOSITIONMAXRATIO, ROLE_RECEIVE_STATUS, AUCTION_BID_STATUS, DEBUG_MAGIC_WORD, AUCTION_SOURCE, TA_EVENT, getAuctionSourceTypeName, PUSH_ROUTE, GUILD_JOB } from './../consts';
|
||||
import { DividendRec, ItemReward } from "../domain/dbGeneral";
|
||||
import { genCode, getRandSingleEelm } from '../pubUtils/util';
|
||||
import { LOT_CODE_LEN, AUCTION_STAGE, AUCTION_TIME, DIVIDEND_CODE_LEN, DIVIDEND_STATUS, LOT_STATUS, MAIL_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, ROLE_RECEIVE_STATUS, AUCTION_BID_STATUS, DEBUG_MAGIC_WORD, AUCTION_SOURCE, TA_EVENT, getAuctionSourceTypeName, PUSH_ROUTE, GUILD_JOB } from './../consts';
|
||||
import { DividendRec, } from "../domain/dbGeneral";
|
||||
import { genCode, getRandSingleEelm, isDebugTime } from '../pubUtils/util';
|
||||
import { LotModel, LotParam, LotType } from '../db/Lot';
|
||||
import { getCurDay, getTimeFunD, getTimeFunM, nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { gameData, getGoodById } from '../pubUtils/data';
|
||||
@@ -66,7 +66,7 @@ export async function treatLotsTime(lots: LotType[]) {
|
||||
}
|
||||
|
||||
export async function treatSingleLotTime(lot: LotType) {
|
||||
if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME == 1) {
|
||||
if(isDebugTime()) {
|
||||
let current = await getCurrentTime();
|
||||
if(Math.floor(current/1000) != nowSeconds()) {
|
||||
lot.begin.setHours(20, 20, 0, 0);
|
||||
@@ -107,7 +107,7 @@ export async function todayGuildBegin() {
|
||||
|
||||
async function getCurrentTime() {
|
||||
let now = Date.now();
|
||||
if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME == 1) {
|
||||
if(isDebugTime()) {
|
||||
let guilds = pinus.app.getServersByType('guild');
|
||||
let guild = getRandSingleEelm(guilds);
|
||||
now = await pinus.app.rpc.guild.guildActivityRemote.getCurrentTime.toServer(guild.id);
|
||||
@@ -117,7 +117,7 @@ async function getCurrentTime() {
|
||||
|
||||
async function getCurrentTimeWithSetDay() {
|
||||
let now = new Date();
|
||||
if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME == 1) {
|
||||
if(isDebugTime()) {
|
||||
let guilds = pinus.app.getServersByType('guild');
|
||||
let guild = getRandSingleEelm(guilds);
|
||||
let currentTime = await pinus.app.rpc.guild.guildActivityRemote.getCurrentTime.toServer(guild.id);
|
||||
@@ -302,7 +302,7 @@ export async function startGuildAuction() {
|
||||
let lots = await LotModel.updateLotsStageByBegin(begin, AUCTION_STAGE.GUILD);
|
||||
let dividends = await DividendModel.updateDividendsStatus(begin, DIVIDEND_STATUS.ING);
|
||||
|
||||
if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME == 1) {
|
||||
if(isDebugTime()) {
|
||||
let day = getCurDay();
|
||||
let time = <number>getTimeFunM().getTimeWithWeek(day, 20, 20, 0);
|
||||
pinus.app.rpc.guild.guildActivityRemote.setCurrentTime.broadcast(time);
|
||||
@@ -343,7 +343,7 @@ export async function startWorldAuction() {
|
||||
lots = await LotModel.updateUnSoldLotsStageByBegin(begin, AUCTION_STAGE.WORLD);
|
||||
let dividends = await DividendModel.updateDividendsStatus(begin, DIVIDEND_STATUS.END);
|
||||
|
||||
if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME == 1) {
|
||||
if(isDebugTime()) {
|
||||
let day = getCurDay();
|
||||
let time = <number>getTimeFunM().getTimeWithWeek(day, 20, 40, 0);
|
||||
pinus.app.rpc.guild.guildActivityRemote.setCurrentTime.broadcast(time);
|
||||
@@ -365,7 +365,7 @@ export async function stopAuction() {
|
||||
await sendLotsRewardToMlail(lots);
|
||||
lots = await LotModel.updateLotsStageByBegin(begin, AUCTION_STAGE.END);
|
||||
|
||||
if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME == 1) {
|
||||
if(isDebugTime()) {
|
||||
let day = getCurDay();
|
||||
let time = <number>getTimeFunM().getTimeWithWeek(day, 22, 0, 0);
|
||||
pinus.app.rpc.guild.guildActivityRemote.setCurrentTime.broadcast(time);
|
||||
|
||||
@@ -18,7 +18,7 @@ import { makeRefreshShopReward } from './activity/refreshShopService';
|
||||
import { ActivityMonopolyModel, ActivityMonopolyModelType } from '../db/ActivityMonopoly';
|
||||
import { ActivityMonopolyLandModel, ActivityMonopolyLandModelType } from '../db/ActivityMonopolyLand';
|
||||
import { pinus } from 'pinus';
|
||||
import { resResult } from '../pubUtils/util';
|
||||
import { isDebugPay, resResult } from '../pubUtils/util';
|
||||
import { checkOrderWX } from './pay/weixinPay';
|
||||
import { addRechargeMoney } from './activity/rechargeMoneyService';
|
||||
import { addVipRechargeMoney } from './activity/vipRechargeMoneyService';
|
||||
@@ -33,6 +33,7 @@ import { makeTaskPass } from './activity/taskPassService';
|
||||
import { addGuildPay } from './activity/guildPayService';
|
||||
import { sendMessageToUserWithSuc } from './pushService';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
import { checkParamPrice } from '../pubUtils/sdkUtil';
|
||||
|
||||
export async function checkOrderCanBuy(roleId: string, serverId: number, activityData: ActivityModelType, productID: string, paramStr: string) {
|
||||
let activityId = activityData.activityId;
|
||||
@@ -278,7 +279,7 @@ export async function settleOrderFromRedisPub(message: string) {
|
||||
console.log('订单玩家错误');
|
||||
return false;
|
||||
}
|
||||
if((gameData.serverConst.DEBUG_PAY != 1 && order.price != parseFloat(params.money))||(gameData.serverConst.DEBUG_PAY == 1 && parseFloat(params.money) != DEBUG_PRICE)) {
|
||||
if((!checkParamPrice(order.price, params.money))) {
|
||||
console.log('订单金额错误');
|
||||
return false;
|
||||
}
|
||||
@@ -291,7 +292,6 @@ export async function settleOrderFromRedisPub(message: string) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
export async function refundOrderFromRedisPub(message: string) {
|
||||
console.log('**********refundOrderFromRedisPub*******')
|
||||
console.log('message: ', message);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { UserModel } from "../../db/User";
|
||||
import { LoginValidateData37 } from "../../domain/sdk";
|
||||
import { DicRMB } from "../../pubUtils/dictionary/DicRMB";
|
||||
import { nowSeconds } from "../../pubUtils/timeUtil";
|
||||
import { resResult } from "../../pubUtils/util";
|
||||
import { isDebugPay, resResult } from "../../pubUtils/util";
|
||||
import { get37Md5SignA } from "../../pubUtils/sdkUtil";
|
||||
import { pinus } from "pinus";
|
||||
import { gameData } from "../../pubUtils/data";
|
||||
@@ -39,7 +39,7 @@ export async function applyOrder37(localOrderID: string, roleId: string, product
|
||||
time: nowSeconds(),
|
||||
ext
|
||||
}
|
||||
if(gameData.serverConst.DEBUG_PAY == 1) {
|
||||
if(isDebugPay()) {
|
||||
body = {...body, money: DEBUG_PRICE}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FrontendOrBackendSession, pinus } from "pinus";
|
||||
import { STATUS } from '../consts/statusCode';
|
||||
import { resResult, shouldRefresh, shouldRefreshWeek } from '../pubUtils/util';
|
||||
import { isDebugTime, resResult, shouldRefresh, shouldRefreshWeek } from '../pubUtils/util';
|
||||
import { nowSeconds } from "../pubUtils/timeUtil";
|
||||
// import { RoleModel } from '../db/Role';
|
||||
import { refDailyTask, refDailyTaskBox } from './task/taskService'
|
||||
@@ -19,7 +19,7 @@ export async function refresh(session: FrontendOrBackendSession) {
|
||||
const roleId = session.get('roleId')||'test';
|
||||
const sid = session.get('sid');
|
||||
|
||||
if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME != 1) {
|
||||
if(isDebugTime()) {
|
||||
sendMessageToUserWithSuc(roleId, PUSH_ROUTE.PUSH_CURRENT_TIME, { time: Date.now() }, sid);
|
||||
} else {
|
||||
let guilds = pinus.app.getServersByType('guild');
|
||||
|
||||
Reference in New Issue
Block a user