拍卖行:军团拍卖阶段仅有军团成员可以出价

This commit is contained in:
liangtongchuan
2021-03-22 11:53:20 +08:00
parent 42ecaa8aad
commit 43bae5f4cf
2 changed files with 8 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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: '活动未开放' },