diff --git a/game-server/app/servers/guild/handler/auctionHandler.ts b/game-server/app/servers/guild/handler/auctionHandler.ts index 03830bed5..487f9b57e 100644 --- a/game-server/app/servers/guild/handler/auctionHandler.ts +++ b/game-server/app/servers/guild/handler/auctionHandler.ts @@ -121,9 +121,9 @@ export class AuctionHandler { if (auctionStage === AUCTION_STAGE.GUILD) { const dividend = await DividendModel.updateLot(code, gid, curPrice, incPrice, max); newDividend = await calculateDividend(dividend); + await sendMessageToGuildWithSuc(guildCode, PUSH_ROUTE.DIVIDEND_UPDATE, { dividends: processDividendFormat([newDividend]) }) } let newLotResult = processSingleLotFormat(newLot); - await sendMessageToGuildWithSuc(guildCode, PUSH_ROUTE.DIVIDEND_UPDATE, { dividends: processDividendFormat([newDividend]) }) return resResult(STATUS.SUCCESS, { lot: newLotResult, dividend: processSingleDividendFormat(newDividend) }); } catch (e) { console.log('offer got err:', e); diff --git a/game-server/app/services/auctionService.ts b/game-server/app/services/auctionService.ts index 60b846c88..989534e85 100644 --- a/game-server/app/services/auctionService.ts +++ b/game-server/app/services/auctionService.ts @@ -530,6 +530,7 @@ export async function checkAuctionStage(auctionStage: number) { } export function processSingleDividendFormat(dividend: DividendType) { + if(!dividend) return null; let newDividend = { ...dividend, begin: getSeconds(dividend.begin)} return pick(newDividend, ['serverId', 'guildCode', 'sourceType', 'sourceCode', 'code', 'totalPrice', 'dividends', 'status', 'begin']) } @@ -539,6 +540,7 @@ export function processDividendFormat(dividends: DividendType[]) { } export function processSingleLotFormat(lot: LotType) { + if(!lot) return null; let newLot = { ...lot, begin: getSeconds(lot.begin), end: getSeconds(lot.end)} return pick(newLot, ['auctionStage', 'sourceType', 'sourceCode', 'serverId', 'guildCode', 'code', 'gid', 'count', 'prePrice', 'curPrice', 'curBuyer', 'maxPrice', 'bidRoles', 'watchingRoles', 'begin', 'end', 'status', 'sort']) }