diff --git a/game-server/app/servers/battle/handler/auctionHandler.ts b/game-server/app/servers/battle/handler/auctionHandler.ts index 7342dff74..1812a99ac 100644 --- a/game-server/app/servers/battle/handler/auctionHandler.ts +++ b/game-server/app/servers/battle/handler/auctionHandler.ts @@ -43,6 +43,7 @@ export class AuctionHandler { const roleName = session.get('roleName'); const sid = session.get('sid'); const serverId = session.get('serverId'); + const guildCode = session.get('guildCode'); let res: any = await lockData(serverId, DATA_NAME.AUCTION_LOT, code);// 加锁 try { @@ -56,6 +57,11 @@ export class AuctionHandler { return resResult(STATUS.GUILD_LOT_NOT_FOUND); } + const stage = auctionStage(); + if (stage === AUCTION_STAGE.GUILD && lot.guildCode !== guildCode) { + return resResult(STATUS.AUCTION_GUILD_MEMBER_ONLY); + } + const { curBuyer, curPrice, maxPrice, gid, count, bidRoles, watchingRoles } = lot; if (curBuyer === roleId) { res.releaseCallback(); @@ -89,7 +95,7 @@ export class AuctionHandler { const incPrice = newPrice - (curBuyer ? curPrice : 0); let newDividend = null; - if (auctionStage() === AUCTION_STAGE.GUILD) { + if (stage === AUCTION_STAGE.GUILD) { const dividend = await DividendModel.updateLot(code, gid, newPrice, incPrice, max); newDividend = await calculateDividend(dividend); } diff --git a/shared/consts/statusCode.ts b/shared/consts/statusCode.ts index 51b5b7c7a..5b5a778d8 100644 --- a/shared/consts/statusCode.ts +++ b/shared/consts/statusCode.ts @@ -196,6 +196,7 @@ export const STATUS = { LOT_OFFER_SERIAL: { code: 21002, simStr: '不能连续出价' }, DIVIDEND_NOT_READY: { code: 21003, simStr: '还不可以领取分红' }, DIVIDEND_GUILD_PLAYER_ONLY: { code: 21004, simStr: '需要参加军团活动才能领取' }, + AUCTION_GUILD_MEMBER_ONLY: { code: 21005, simStr: '不是军团的成员无法出价' }, // 军团活动 21100-21199 GUILD_ACTIVITY_NOT_OPEN: { code: 21100, simStr: '活动未开放' },