🐞 fix(拍卖行): 延长竞价有时没有道具问题

This commit is contained in:
luying
2023-06-29 09:57:58 +08:00
parent 5d7670e6f8
commit 142a753874

View File

@@ -494,29 +494,29 @@ export async function pushAuctionOver(lot: LotType) {
}
export async function pushAuctionUpdate(lots: LotType[], dividends: DividendType[]) {
let lotsByGuild = new Map<string, LotType[]>();
let lotsByServer = new Map<number, LotType[]>();
// let lotsByGuild = new Map<string, LotType[]>();
// let lotsByServer = new Map<number, LotType[]>();
for(let lot of lots) {
if(lot.auctionStage === AUCTION_STAGE.DEFAULT || lot.auctionStage === AUCTION_STAGE.GUILD) {
if(!lotsByGuild.has(lot.guildCode)) {
lotsByGuild.set(lot.guildCode, []);
}
lotsByGuild.get(lot.guildCode).push(lot);
} else {
if(!lotsByServer.has(lot.serverId)) {
lotsByServer.set(lot.serverId, []);
}
lotsByServer.get(lot.serverId).push(lot);
}
}
// for(let lot of lots) {
// if(lot.auctionStage === AUCTION_STAGE.DEFAULT || lot.auctionStage === AUCTION_STAGE.GUILD) {
// if(!lotsByGuild.has(lot.guildCode)) {
// lotsByGuild.set(lot.guildCode, []);
// }
// lotsByGuild.get(lot.guildCode).push(lot);
// } else {
// if(!lotsByServer.has(lot.serverId)) {
// lotsByServer.set(lot.serverId, []);
// }
// lotsByServer.get(lot.serverId).push(lot);
// }
// }
for(let [guildCode, lots] of lotsByGuild) {
await sendMessageToGuildWithSuc(guildCode, PUSH_ROUTE.AUCTION_UPDATE, { lots: processLotsFormat(lots) });
}
for(let [serverId, lots] of lotsByServer) {
await sendMessageToServerWithSuc(serverId, PUSH_ROUTE.AUCTION_UPDATE, { lots: processLotsFormat(lots) });
}
// for(let [guildCode, lots] of lotsByGuild) {
// await sendMessageToGuildWithSuc(guildCode, PUSH_ROUTE.AUCTION_UPDATE, { lots: processLotsFormat(lots) });
// }
// for(let [serverId, lots] of lotsByServer) {
// await sendMessageToServerWithSuc(serverId, PUSH_ROUTE.AUCTION_UPDATE, { lots: processLotsFormat(lots) });
// }
let dividendsResult = new Map<string, DividendType[]>();
for(let dividend of dividends) {