diff --git a/game-server/app/services/auctionService.ts b/game-server/app/services/auctionService.ts index 183b37a62..6624d0eaf 100644 --- a/game-server/app/services/auctionService.ts +++ b/game-server/app/services/auctionService.ts @@ -27,7 +27,7 @@ export function getMaxPrice(gid: number, count: number) { } export async function auctionStage() { - const curTime = new Date().getTime(); + const curTime = await getCurrentTimeWithSetDay(); if (curTime < (await todayGuildBegin()).getTime()) return AUCTION_STAGE.DEFAULT; if (curTime < (await todayWorldBegin()).getTime() && curTime > (await todayGuildBegin()).getTime()) return AUCTION_STAGE.GUILD; if (curTime > (await todayWorldBegin()).getTime() && curTime < (await todayWorldEnd()).getTime()) return AUCTION_STAGE.WORLD; @@ -91,6 +91,17 @@ async function getCurrentTime() { return now } +async function getCurrentTimeWithSetDay() { + let now = new Date(); + if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME == 1) { + let guilds = pinus.app.getServersByType('guild'); + let guild = getRandSingleEelm(guilds); + let currentTime = await pinus.app.rpc.guild.guildActivityRemote.getCurrentTime.toServer(guild.id); + now.setDate(new Date(currentTime).getDate()); + } + return now.getTime(); +} + // 明天军团拍卖行开始时间 20:20 export async function tomorrowGuildBegin() { let now = await getCurrentTime(); @@ -137,7 +148,7 @@ export async function guildAuctionPreview() { // 演武台。8点以前是今天的,8点以后是明天的 export async function getBossAuctionBegin() { - if(Date.now() < (await guildAuctionPreview()).getTime()) { + if((await getCurrentTimeWithSetDay()) < (await guildAuctionPreview()).getTime()) { return await todayGuildBegin(); } else { return await tomorrowGuildBegin(); @@ -146,7 +157,7 @@ export async function getBossAuctionBegin() { // 演武台。8点以前是今天的,8点以后是明天的 export async function getBossAuctionEnd() { - if(Date.now() < (await guildAuctionPreview()).getTime()) { + if((await getCurrentTimeWithSetDay()) < (await guildAuctionPreview()).getTime()) { return await guildAuctionEnd(); } else { return await tomorrowGuildEnd(); diff --git a/game-server/app/services/mailService.ts b/game-server/app/services/mailService.ts index f6ee00151..31464ddcf 100644 --- a/game-server/app/services/mailService.ts +++ b/game-server/app/services/mailService.ts @@ -59,7 +59,7 @@ export async function sendMailByContent(contentId: MAIL_TYPE, hisRoleId: string, } export async function sendMailToGuildByContent(contentId: MAIL_TYPE, guildCode: string, params: { sendName?: string, endTime?: number, params?: string[], goods?: RewardInter[], notPush?: boolean }, guild?: GuildType) { - if(!guild) guild = await GuildModel.findByCode(guildCode); + if(!guild) guild = await GuildModel.findByCode(guildCode, null, '+members'); if(!guild) return false; let f = new SendMailFun(); f.setWithContentId(contentId, params);