拍卖:修改超越牌价推送
This commit is contained in:
@@ -223,7 +223,7 @@ export async function genAuction(guildCode: string, sourceType: number, sourceCo
|
||||
const dividend = await DividendModel.createDividend(dividendData);
|
||||
let channelSid = await getGuildChannelSid(guildCode);
|
||||
pinus.app.rpc.chat.guildRemote.pushAuctionAdd.toServer(channelSid, guildCode, { lots, dividends: [dividend] });
|
||||
return { lots, dividend };
|
||||
return { lots, dividend };
|
||||
}
|
||||
|
||||
function posDividend(totalPrice: number, roleRatio: number, totalRatio: number) {
|
||||
@@ -340,7 +340,6 @@ export async function stopAuction() {
|
||||
let lots = await LotModel.setLotSoldByBegin(begin); // 正在竞拍的拍品
|
||||
await sendLotsRewardToMlail(lots);
|
||||
lots = await LotModel.updateLotsStageByBegin(begin, AUCTION_STAGE.END);
|
||||
let dividends = await DividendModel.findDividendsByBegin(begin);
|
||||
|
||||
if(dicParam.SERVER_DEBUG_MODE.CURRENT_TIME == 1) {
|
||||
let day = getCurDay();
|
||||
@@ -348,7 +347,7 @@ export async function stopAuction() {
|
||||
pinus.app.rpc.guild.guildActivityRemote.setCurrentTime.broadcast(time);
|
||||
await pushCurrentTime(time);
|
||||
}
|
||||
await pushAuctionUpdate(lots, dividends);
|
||||
await pushAuctionUpdate(lots, []);
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.error('stopAuction err: ', e);
|
||||
@@ -450,7 +449,7 @@ export async function getAuction(guildCode: string, session: FrontendOrBackendSe
|
||||
|
||||
export async function pushAuctionOver(lot: LotType) {
|
||||
if(lot.auctionStage == AUCTION_STAGE.GUILD) {
|
||||
let chatSid = await getGuildAuctionChannelSid(lot.guildCode);
|
||||
let chatSid = await getGuildChannelSid(lot.guildCode);
|
||||
pinus.app.rpc.chat.chatRemote.sendGuildAuction.toServer(chatSid, lot.guildCode, lot);
|
||||
} else if (lot.auctionStage == AUCTION_STAGE.WORLD) {
|
||||
let chatSid = await getWorldAuctionChannelSid(lot.serverId);
|
||||
@@ -461,7 +460,7 @@ export async function pushAuctionOver(lot: LotType) {
|
||||
export async function pushAuctionUpdate(lots: LotType[], dividends: DividendType[]) {
|
||||
const stage = await auctionStage();
|
||||
if(stage === AUCTION_STAGE.DEFAULT || stage === AUCTION_STAGE.GUILD) {
|
||||
let lotsResult = new Map<string, LotType[]>(), dividendsResult = new Map<string, DividendType[]>();
|
||||
let lotsResult = new Map<string, LotType[]>();
|
||||
|
||||
for(let lot of lots) {
|
||||
if(!lotsResult.has(lot.guildCode)) {
|
||||
@@ -469,17 +468,10 @@ export async function pushAuctionUpdate(lots: LotType[], dividends: DividendType
|
||||
}
|
||||
lotsResult.get(lot.guildCode).push(lot);
|
||||
}
|
||||
for(let dividend of dividends) {
|
||||
if(!dividendsResult.has(dividend.guildCode)) {
|
||||
dividendsResult.set(dividend.guildCode, []);
|
||||
}
|
||||
dividendsResult.get(dividend.guildCode).push(dividend);
|
||||
}
|
||||
|
||||
for(let [guildCode, lots] of lotsResult) {
|
||||
let dividends = dividendsResult.get(guildCode)||[];
|
||||
let channelSid = await getGuildChannelSid(guildCode);
|
||||
pinus.app.rpc.chat.guildRemote.pushAuctionUpdate.toServer(channelSid, guildCode, { lots, dividends });
|
||||
pinus.app.rpc.chat.guildRemote.pushAuctionUpdate.toServer(channelSid, guildCode, { lots });
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -497,5 +489,17 @@ export async function pushAuctionUpdate(lots: LotType[], dividends: DividendType
|
||||
pinus.app.rpc.chat.chatRemote.sendAuctionUpdate.toServer(channelSid, serverId, { lots });
|
||||
}
|
||||
}
|
||||
let dividendsResult = new Map<string, DividendType[]>();
|
||||
for(let dividend of dividends) {
|
||||
if(!dividendsResult.has(dividend.guildCode)) {
|
||||
dividendsResult.set(dividend.guildCode, []);
|
||||
}
|
||||
dividendsResult.get(dividend.guildCode).push(dividend);
|
||||
}
|
||||
for(let [guildCode, dividends] of dividendsResult) {
|
||||
let channelSid = await getGuildChannelSid(guildCode);
|
||||
pinus.app.rpc.chat.guildRemote.pushAuctionUpdate.toServer(channelSid, guildCode, { dividends });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user