拍卖行:显示时间
This commit is contained in:
@@ -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 = <number>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 = <number>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 = <number>getTimeFunM().getTimeWithWeek(day, 22, 0, 0);
|
||||
pinus.app.rpc.guild.guildActivityRemote.setCurrentTime.broadcast(time);
|
||||
await pushCurrentTime(time);
|
||||
}
|
||||
return true;
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user