修改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
+9 -9
View File
@@ -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);