拍卖行:时间使用参数表
This commit is contained in:
@@ -31,7 +31,7 @@ export class AuctionHandler {
|
|||||||
const { magicWord } = msg;
|
const { magicWord } = msg;
|
||||||
|
|
||||||
const guildCode = session.get('guildCode');
|
const guildCode = session.get('guildCode');
|
||||||
if (!guildCode) return resResult(STATUS.GUILD_NOT_FOUND);
|
// if (!guildCode) return resResult(STATUS.GUILD_NOT_FOUND);
|
||||||
let result = await getAuction(guildCode, session, magicWord);
|
let result = await getAuction(guildCode, session, magicWord);
|
||||||
|
|
||||||
return resResult(STATUS.SUCCESS, result);
|
return resResult(STATUS.SUCCESS, result);
|
||||||
|
|||||||
@@ -53,31 +53,38 @@ export async function officialAuctionLots(session: FrontendOrBackendSession, beg
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function auctionBegin() {
|
export function auctionBegin() {
|
||||||
return <Date>getTimeFunD().getAfterDayWithHour(0, AUCTION_TIME.GUILD_BEGIN_HOUR, AUCTION_TIME.GUILD_BEGIN_MIN);
|
let { hour, minute } = gameData.auctionTime.get(AUCTION_TIME.GUILD_OPEN);
|
||||||
|
return <Date>getTimeFunD().getAfterDayWithHour(0, hour, minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function guildAuctionEnd() {
|
export function guildAuctionEnd() {
|
||||||
return <Date>getTimeFunD().getAfterDayWithHour(0, AUCTION_TIME.GUILD_END_HOUR, AUCTION_TIME.GUILD_END_MIN);
|
let { hour, minute } = gameData.auctionTime.get(AUCTION_TIME.GUILD_CLOSE);
|
||||||
|
return <Date>getTimeFunD().getAfterDayWithHour(0, hour, minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function auctionEnd() {
|
export function auctionEnd() {
|
||||||
return <Date>getTimeFunD().getAfterDayWithHour(0, AUCTION_TIME.WORLD_END_HOUR, AUCTION_TIME.WORLD_END_MIN);
|
let { hour, minute } = gameData.auctionTime.get(AUCTION_TIME.WORLD_CLOSE);
|
||||||
|
return <Date>getTimeFunD().getAfterDayWithHour(0, hour, minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function todayGuildBegin() {
|
export function todayGuildBegin() {
|
||||||
return <Date>getTimeFunD(getZeroPointD()).getAfterDayWithHour(0, AUCTION_TIME.GUILD_BEGIN_HOUR, AUCTION_TIME.GUILD_BEGIN_MIN);
|
let { hour, minute } = gameData.auctionTime.get(AUCTION_TIME.GUILD_OPEN);
|
||||||
|
return <Date>getTimeFunD(getZeroPointD()).getAfterDayWithHour(0, hour, minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function yestodayGuildBegin() {
|
export function yestodayGuildBegin() {
|
||||||
return <Date>getTimeFunD(getZeroPointD()).getAfterDayWithHour(-1, AUCTION_TIME.GUILD_BEGIN_HOUR, AUCTION_TIME.GUILD_BEGIN_MIN);
|
let { hour, minute } = gameData.auctionTime.get(AUCTION_TIME.GUILD_OPEN);
|
||||||
|
return <Date>getTimeFunD(getZeroPointD()).getAfterDayWithHour(-1, hour, minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function todayWorldBegin() {
|
export function todayWorldBegin() {
|
||||||
return <Date>getTimeFunD(getZeroPointD()).getAfterDayWithHour(0, AUCTION_TIME.WORLD_BEGIN_HOUR, AUCTION_TIME.WORLD_BEGIN_MIN);
|
let { hour, minute } = gameData.auctionTime.get(AUCTION_TIME.WORLD_OPEN);
|
||||||
|
return <Date>getTimeFunD(getZeroPointD()).getAfterDayWithHour(0, hour, minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function todayWorldEnd() {
|
export function todayWorldEnd() {
|
||||||
return <Date>getTimeFunD(getZeroPointD()).getAfterDayWithHour(0, AUCTION_TIME.WORLD_END_HOUR, AUCTION_TIME.WORLD_END_MIN);
|
let { hour, minute } = gameData.auctionTime.get(AUCTION_TIME.WORLD_CLOSE);
|
||||||
|
return <Date>getTimeFunD(getZeroPointD()).getAfterDayWithHour(0, hour, minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -287,6 +294,9 @@ export async function getAuction(guildCode: string, session: FrontendOrBackendSe
|
|||||||
const begin = todayGuildBegin();
|
const begin = todayGuildBegin();
|
||||||
let lots = magicWord === DEBUG_MAGIC_WORD ? await debugAuctionLots(session, begin) : await officialAuctionLots(session, begin);
|
let lots = magicWord === DEBUG_MAGIC_WORD ? await debugAuctionLots(session, begin) : await officialAuctionLots(session, begin);
|
||||||
|
|
||||||
const dividends = await DividendModel.findGuildDividendsByBegin(guildCode, begin);
|
let dividends: DividendType[] = [];
|
||||||
|
if(guildCode) {
|
||||||
|
dividends = await DividendModel.findGuildDividendsByBegin(guildCode, begin);
|
||||||
|
}
|
||||||
return { lots, dividends };
|
return { lots, dividends };
|
||||||
}
|
}
|
||||||
@@ -4,11 +4,11 @@ import { PVPConfigModel } from '../db/SystemConfig';
|
|||||||
import PvpDefenseType, { PvpDefenseModel } from '../db/PvpDefense';
|
import PvpDefenseType, { PvpDefenseModel } from '../db/PvpDefense';
|
||||||
import { PVP } from '../pubUtils/dicParam';
|
import { PVP } from '../pubUtils/dicParam';
|
||||||
import { nowSeconds, getTimeFun } from '../pubUtils/timeUtil';
|
import { nowSeconds, getTimeFun } from '../pubUtils/timeUtil';
|
||||||
import { getPvpGkWarIds, getPvpRankRewards, getPvpHeroRewards, getResultMaxRank, getTodayGuildActivity } from '../pubUtils/data';
|
import { getPvpGkWarIds, getPvpRankRewards, getPvpHeroRewards, getResultMaxRank, getTodayGuildActivity, gameData } from '../pubUtils/data';
|
||||||
import { deepCopy, getRandSingleEelm } from '../pubUtils/util';
|
import { deepCopy, getRandSingleEelm } from '../pubUtils/util';
|
||||||
import { getLvByScore } from './pvpService';
|
import { getLvByScore } from './pvpService';
|
||||||
import { getAllOnlineRoles, getAllServers, initSingleRank, delGuildActivityRank } from './redisService';
|
import { getAllOnlineRoles, getAllServers, initSingleRank, delGuildActivityRank } from './redisService';
|
||||||
import { MAIL_TYPE, REDIS_KEY, GUILD_ACTIVITY_STATUS, GUILD_ACTIVITY_TYPE, TASK_TYPE, TIME_OUTPUT_TYPE, REFRESH_TIME, SEND_NAME, SERVER_OPEN_TIME, COUNTER } from '../consts';
|
import { MAIL_TYPE, REDIS_KEY, GUILD_ACTIVITY_STATUS, GUILD_ACTIVITY_TYPE, TASK_TYPE, TIME_OUTPUT_TYPE, REFRESH_TIME, SEND_NAME, SERVER_OPEN_TIME, COUNTER, AUCTION_TIME } from '../consts';
|
||||||
import { RoleModel } from '../db/Role';
|
import { RoleModel } from '../db/Role';
|
||||||
import { pinus } from 'pinus';
|
import { pinus } from 'pinus';
|
||||||
import { indexOf } from 'underscore';
|
import { indexOf } from 'underscore';
|
||||||
@@ -518,8 +518,12 @@ export async function raceActivitySeconds() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function auctionSchedule() {
|
function auctionSchedule() {
|
||||||
scheduleJob('startGuildAuction', '0 0 20 20 * ?', startGuildAuction);
|
let guildOpen = gameData.auctionTime.get(AUCTION_TIME.GUILD_OPEN);
|
||||||
scheduleJob('startWorldAuction', '0 0 20 30 * ?', startWorldAuction);
|
let worldOpen = gameData.auctionTime.get(AUCTION_TIME.WORLD_OPEN);
|
||||||
scheduleJob('stopAuction', '0 0 22 00 * ?', stopAuction);
|
let worldClose = gameData.auctionTime.get(AUCTION_TIME.WORLD_CLOSE);
|
||||||
|
|
||||||
|
scheduleJob('startGuildAuction', `0 0 ${guildOpen.hour} ${guildOpen.minute} * ?`, startGuildAuction);
|
||||||
|
scheduleJob('startWorldAuction', `0 0 ${worldOpen.hour} ${worldOpen.minute} * ?`, startWorldAuction);
|
||||||
|
scheduleJob('stopAuction', `0 0 ${worldClose.hour} ${worldClose.minute} * ?`, stopAuction);
|
||||||
scheduleJob('sendUngotDividendJob', '0 0 5 00 * ?', sendUngotDividendJob);
|
scheduleJob('sendUngotDividendJob', '0 0 5 00 * ?', sendUngotDividendJob);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,17 +16,14 @@ export const AUCTION_SOURCE = {
|
|||||||
export const LOT_CODE_LEN = 8;
|
export const LOT_CODE_LEN = 8;
|
||||||
export const DIVIDEND_CODE_LEN = 8;
|
export const DIVIDEND_CODE_LEN = 8;
|
||||||
|
|
||||||
// 世界拍卖开始时间需晚于军团拍卖结束时间
|
export enum AUCTION_TIME {
|
||||||
export const AUCTION_TIME = {
|
GUILD_PREVIEW = 1, // 军团拍卖预览时间(非开启时间)
|
||||||
GUILD_BEGIN_HOUR: 20, // 军团拍卖开始
|
GUILD_OPEN = 2, // 军团拍卖开启时间
|
||||||
GUILD_BEGIN_MIN: 20, // 军团拍卖开始
|
GUILD_CLOSE = 3, // 军团拍卖关闭时间
|
||||||
WORLD_BEGIN_HOUR: 20, // 世界拍卖开始
|
WORLD_PREVIEW = 4, // 世界拍卖预览时间(非开启时间)
|
||||||
WORLD_BEGIN_MIN: 30, // 世界拍卖开始
|
WORLD_OPEN = 5, // 世界拍卖开启时间
|
||||||
GUILD_END_HOUR: 20, // 军团拍卖结束
|
WORLD_CLOSE = 6, // 世界拍卖结束时间
|
||||||
GUILD_END_MIN: 30, // 军团拍卖结束
|
}
|
||||||
WORLD_END_HOUR: 22, // 世界拍卖结束
|
|
||||||
WORLD_END_MIN: 0, // 世界拍卖结束
|
|
||||||
};
|
|
||||||
|
|
||||||
export const DIVIDEND_STATUS = {
|
export const DIVIDEND_STATUS = {
|
||||||
DEFAULT: 0, // 0:未开始
|
DEFAULT: 0, // 0:未开始
|
||||||
|
|||||||
+18
-2
@@ -18,7 +18,7 @@ import { dicTowerTask, loadTowerTask } from "./dictionary/DicTowerTask";
|
|||||||
import { dicWar, dicWarPvp, dicDailyWarByType, loadWar } from "./dictionary/DicWar";
|
import { dicWar, dicWarPvp, dicDailyWarByType, loadWar } from "./dictionary/DicWar";
|
||||||
import { dicWarJson, loadWarJson } from "./dictionary/DicWarJson";
|
import { dicWarJson, loadWarJson } from "./dictionary/DicWarJson";
|
||||||
import { dicXunbao, loadXunbao } from "./dictionary/DicXunbao";
|
import { dicXunbao, loadXunbao } from "./dictionary/DicXunbao";
|
||||||
import { SPECIAL_ATTR } from "../consts";
|
import { AUCTION_TIME, SPECIAL_ATTR } from "../consts";
|
||||||
import { dicFashions, loadFashions } from "./dictionary/DicFashions";
|
import { dicFashions, loadFashions } from "./dictionary/DicFashions";
|
||||||
import { friendShips, friendShipHidAandIds, loadFriendShip } from "./dictionary/DicFriendShip";
|
import { friendShips, friendShipHidAandIds, loadFriendShip } from "./dictionary/DicFriendShip";
|
||||||
import { maxFriendShipLv, dicFriendShipLevelMap, loadFriendShipLevel } from "./dictionary/DicFriendShipLevel";
|
import { maxFriendShipLv, dicFriendShipLevelMap, loadFriendShipLevel } from "./dictionary/DicFriendShipLevel";
|
||||||
@@ -235,7 +235,8 @@ export const gameData = {
|
|||||||
ceRatio: new Array<{type: number, val: number}>(),
|
ceRatio: new Array<{type: number, val: number}>(),
|
||||||
holiday: dicHoliday,
|
holiday: dicHoliday,
|
||||||
expeditionSubAttr: dicExpeditionSubAttr,
|
expeditionSubAttr: dicExpeditionSubAttr,
|
||||||
auctionPool: dicAuctionPool
|
auctionPool: dicAuctionPool,
|
||||||
|
auctionTime: new Map<number, { hour: number, minute: number, seconds: number}>()
|
||||||
};
|
};
|
||||||
|
|
||||||
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
||||||
@@ -799,6 +800,20 @@ function loadEquipAttributeRatio() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadAuctionTime() {
|
||||||
|
gameData.auctionTime.set(AUCTION_TIME.GUILD_PREVIEW, splitTime(param.AUCTION.GUILD_AUCTION_PREVIEW_TIME));
|
||||||
|
gameData.auctionTime.set(AUCTION_TIME.GUILD_OPEN, splitTime(param.AUCTION.GUILD_AUCTION_OPEN_TIME));
|
||||||
|
gameData.auctionTime.set(AUCTION_TIME.GUILD_CLOSE, splitTime(param.AUCTION.GUILD_AUCTION_CLOSE_TIME));
|
||||||
|
gameData.auctionTime.set(AUCTION_TIME.WORLD_PREVIEW, splitTime(param.AUCTION.WORLD_AUCTION_PREVIEW_TIME));
|
||||||
|
gameData.auctionTime.set(AUCTION_TIME.WORLD_OPEN, splitTime(param.AUCTION.WORLD_AUCTION_OPEN_TIME));
|
||||||
|
gameData.auctionTime.set(AUCTION_TIME.WORLD_CLOSE, splitTime(param.AUCTION.WORLD_AUCTION_CLOSE_TIME));
|
||||||
|
}
|
||||||
|
|
||||||
|
function splitTime(str: string) {
|
||||||
|
let arr = str.split(':');
|
||||||
|
return { hour: parseInt(arr[0]), minute: parseInt(arr[1]), seconds: parseInt(arr[2]) }
|
||||||
|
}
|
||||||
|
|
||||||
// 初始加载
|
// 初始加载
|
||||||
function initDatas() {
|
function initDatas() {
|
||||||
parseDicParam();
|
parseDicParam();
|
||||||
@@ -815,6 +830,7 @@ function parseDicParam() {
|
|||||||
getHeroTransPiece();
|
getHeroTransPiece();
|
||||||
parseComBtlLvRange();
|
parseComBtlLvRange();
|
||||||
getCeRatio();
|
getCeRatio();
|
||||||
|
loadAuctionTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载json
|
// 加载json
|
||||||
|
|||||||
Reference in New Issue
Block a user