From 411e1bcf2d60b4c079c65e71e7957f07d3bba4a5 Mon Sep 17 00:00:00 2001 From: luying Date: Mon, 25 Oct 2021 14:15:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=8D=E5=8D=96=E8=A1=8C=EF=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/auctionService.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/game-server/app/services/auctionService.ts b/game-server/app/services/auctionService.ts index 6624d0eaf..8c7dc1904 100644 --- a/game-server/app/services/auctionService.ts +++ b/game-server/app/services/auctionService.ts @@ -2,8 +2,8 @@ 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 } from './../consts'; import { DividendRec, ItemReward } from "../domain/dbGeneral"; import { genCode, getRandSingleEelm } from '../pubUtils/util'; -import { LotModel, LotParam } from '../db/Lot'; -import { getCurDay, getTimeFunD, getTimeFunM } from '../pubUtils/timeUtil'; +import { LotModel, LotParam, LotType } from '../db/Lot'; +import { getCurDay, getTimeFunD, getTimeFunM, nowSeconds } from '../pubUtils/timeUtil'; import { gameData, getGoodById } from '../pubUtils/data'; import { DividendParam, DividendType } from '../db/Dividend'; import { sendMailByContent } from './mailService'; @@ -44,12 +44,24 @@ export async function officialAuctionLots(session: FrontendOrBackendSession, beg const serverId = session.get('serverId'); const guildCode = session.get('guildCode'); const stage = await auctionStage(); - let lots = []; + let lots: LotType[] = []; if (stage === AUCTION_STAGE.DEFAULT || stage === AUCTION_STAGE.GUILD) { lots = await LotModel.findGuildLotsByBegin(guildCode, begin); } else if (stage === AUCTION_STAGE.WORLD) { lots = await LotModel.findWorldLotsByBegin(serverId, begin); } + + if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME == 1) { + let current = await getCurrentTime(); + if(Math.floor(current/1000) != nowSeconds()) { + lots = lots.map(cur => { + cur.begin.setHours(20, 20, 0, 0); + cur.end.setHours(22, 0, 0, 0); + return {...cur, begin: cur.begin, end: cur.end} + }); + } + } + return lots; } @@ -261,6 +273,7 @@ export async function startGuildAuction() { let day = getCurDay(); let time = getTimeFunM().getTimeWithWeek(day, 20, 20, 0); pinus.app.rpc.guild.guildActivityRemote.setCurrentTime.broadcast(time); + await pushCurrentTime(time); } return true; @@ -282,6 +295,7 @@ export async function startWorldAuction() { let day = getCurDay(); let time = getTimeFunM().getTimeWithWeek(day, 20, 40, 0); pinus.app.rpc.guild.guildActivityRemote.setCurrentTime.broadcast(time); + await pushCurrentTime(time); } return true; } catch (e) { @@ -301,6 +315,7 @@ export async function stopAuction() { let day = getCurDay(); let time = getTimeFunM().getTimeWithWeek(day, 22, 0, 0); pinus.app.rpc.guild.guildActivityRemote.setCurrentTime.broadcast(time); + await pushCurrentTime(time); } return true; } catch (e) {