拍卖行:修改分红逻辑
This commit is contained in:
@@ -4,7 +4,7 @@ import { AUCTION_STAGE, DEBUG_MAGIC_WORD, STATUS, CURRENCY_BY_TYPE, CURRENCY_TYP
|
||||
import { LotModel } from "../../../db/Lot";
|
||||
import { ItemReward } from "../../../domain/dbGeneral";
|
||||
import { genCode, resResult } from "../../../pubUtils/util";
|
||||
import { auctionStage, calculateDividend, genAuction, sendUngotDividend, startGuildAuction, startWorldAuction, stopAuction, todayGuildBegin, getBasePrice, debugAuctionLots, officialAuctionLots, auctionBidStatus, getMaxPrice, guildBidStatus, getAuction, pushAuctionOver, treatSingleLotTime, treatLotsTime } from "../../../services/auctionService";
|
||||
import { auctionStage, calculateDividend, genAuction, sendUngotDividend, startGuildAuction, startWorldAuction, stopAuction, todayGuildBegin, getBasePrice, debugAuctionLots, officialAuctionLots, auctionBidStatus, getMaxPrice, guildBidStatus, getAuction, pushAuctionOver, treatSingleLotTime, treatLotsTime, pushAuctionUpdate } from "../../../services/auctionService";
|
||||
import { addItems, getGoldObject, handleCost } from '../../../services/role/rewardService';
|
||||
import { getSimpleRoleInfo } from '../../../services/roleService';
|
||||
import { getRoleOnlineInfo } from '../../../services/redisService';
|
||||
@@ -113,10 +113,10 @@ export class AuctionHandler {
|
||||
await pushAuctionOver(newLot); // 推送竞价超过标志
|
||||
res.releaseCallback();
|
||||
|
||||
const incPrice = newPrice - (curBuyer ? curPrice : 0);
|
||||
const incPrice = curPrice - prePrice > 0? prePrice: 0;
|
||||
let newDividend = null;
|
||||
if (lot.auctionStage === AUCTION_STAGE.GUILD) {
|
||||
const dividend = await DividendModel.updateLot(code, gid, newPrice, incPrice, max);
|
||||
const dividend = await DividendModel.updateLot(code, gid, curPrice, incPrice, max);
|
||||
newDividend = await calculateDividend(dividend);
|
||||
}
|
||||
let newLotResult = await treatSingleLotTime(newLot);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 } from './../consts';
|
||||
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 { LotModel, LotParam, LotType } from '../db/Lot';
|
||||
@@ -242,8 +242,12 @@ export async function genAuction(guildCode: string, sourceType: number, sourceCo
|
||||
|
||||
function posDividend(totalPrice: number, roleRatio: number, totalRatio: number) {
|
||||
const dividend = Math.floor(totalPrice * roleRatio / totalRatio);
|
||||
const maxDividend = Math.floor(totalPrice * DIVIDENDMAXRATIO);
|
||||
return dividend <= maxDividend ? dividend : Math.floor(maxDividend * roleRatio / DIVIDENDPOSITIONMAXRATIO);
|
||||
const maxDividend = Math.floor(totalPrice * dicParam.GUILD_AUCTION.DIVIDEND_MAXRATIO);
|
||||
return dividend <= maxDividend ? dividend : Math.floor(maxDividend * roleRatio / getMaxPosRatio());
|
||||
}
|
||||
|
||||
function getMaxPosRatio() {
|
||||
return gameData.guildPosition.get(GUILD_JOB.DAJIANGJUN).sellRatio;
|
||||
}
|
||||
|
||||
function weekendDividend(posNum: number, date: Date) {
|
||||
@@ -275,6 +279,7 @@ export async function calculateDividend(dividend: DividendType) {
|
||||
const totalRatio = totalDividendRatio(participantsData);
|
||||
const dividends: DividendRec[] = participantsData.map(data => {
|
||||
const { roleId } = data;
|
||||
console.log('### calculateDividend', calcuTotalPrice, dividendRate(data), totalRatio)
|
||||
const posNum = posDividend(calcuTotalPrice, dividendRate(data), totalRatio);
|
||||
const weekendNum = weekendDividend(posNum, begin);
|
||||
return {
|
||||
|
||||
@@ -115,13 +115,14 @@ export const GUILDACTIVITY = {
|
||||
GATEACTIVITY_GATEHP_N: 20, // 城门血量倍率
|
||||
};
|
||||
export const GUILD_AUCTION = {
|
||||
DIVIDEND_RATE: 1, // 总金额分红比例,1表示总金额 100% 分红
|
||||
DIVIDEND_RATE: 0.8, // 总金额分红比例,1表示总金额 100% 分红
|
||||
DIVIDEND_WEEKEND_RATE: 0.2, // 额外分红,周末加成,0.2表示周围额外加成 20% 分红
|
||||
AUCTION_PRICE_RISE: 1.1, // 单次竞价价格上涨幅度,1.1表示竞拍每次价格上涨10%
|
||||
AUCTION_BOSS_EXPECT_MAX: 1000, // 演武台预期分红上限
|
||||
AUCTION_BOSS_EXPECT_MIN: 300, // 演武台预期分红下限
|
||||
AUCTION_BOSS_EXPECT_MIN: 0, // 演武台预期分红下限
|
||||
AUCTION_ACTIVITY_EXPECT_MAX: 1500, // 军团活动预期分红上限
|
||||
AUCTION_ACTIVITY_EXPECT_MIN: 300, // 军团活动预期分红下限
|
||||
DIVIDEND_MAXRATIO: 0.1, // 拍卖行单人分红最高不可超过总分红金额的10%
|
||||
};
|
||||
export const BROWSER_DEBUG = {
|
||||
UNLIMITED_MOVEMENT: 0, // 无限行动
|
||||
@@ -285,7 +286,7 @@ export const DUNGEON_WARID = {
|
||||
WARID: 5001, // 秘境战场ID新手引导使用
|
||||
};
|
||||
export const BEGIN_ANIMATION = {
|
||||
PATH: 'spines/sceneSpines/kaijudonghua/kaijudonghua',// 开场动画地址
|
||||
NAME: 'kaijudonghua',// 动画名称
|
||||
ACTION: 'idle',// 动作名称
|
||||
PATH: 'spines/sceneSpines/kaijudonghua/kaijudonghua', // 开场动画地址
|
||||
NAME: 'kaijudonghua', // 动画名称
|
||||
ACTION: 'idle', // 动作名称
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user