拍卖行:军团拍卖阶段仅有军团成员可以出价
This commit is contained in:
@@ -43,6 +43,7 @@ export class AuctionHandler {
|
|||||||
const roleName = session.get('roleName');
|
const roleName = session.get('roleName');
|
||||||
const sid = session.get('sid');
|
const sid = session.get('sid');
|
||||||
const serverId = session.get('serverId');
|
const serverId = session.get('serverId');
|
||||||
|
const guildCode = session.get('guildCode');
|
||||||
let res: any = await lockData(serverId, DATA_NAME.AUCTION_LOT, code);// 加锁
|
let res: any = await lockData(serverId, DATA_NAME.AUCTION_LOT, code);// 加锁
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -56,6 +57,11 @@ export class AuctionHandler {
|
|||||||
return resResult(STATUS.GUILD_LOT_NOT_FOUND);
|
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;
|
const { curBuyer, curPrice, maxPrice, gid, count, bidRoles, watchingRoles } = lot;
|
||||||
if (curBuyer === roleId) {
|
if (curBuyer === roleId) {
|
||||||
res.releaseCallback();
|
res.releaseCallback();
|
||||||
@@ -89,7 +95,7 @@ export class AuctionHandler {
|
|||||||
|
|
||||||
const incPrice = newPrice - (curBuyer ? curPrice : 0);
|
const incPrice = newPrice - (curBuyer ? curPrice : 0);
|
||||||
let newDividend = null;
|
let newDividend = null;
|
||||||
if (auctionStage() === AUCTION_STAGE.GUILD) {
|
if (stage === AUCTION_STAGE.GUILD) {
|
||||||
const dividend = await DividendModel.updateLot(code, gid, newPrice, incPrice, max);
|
const dividend = await DividendModel.updateLot(code, gid, newPrice, incPrice, max);
|
||||||
newDividend = await calculateDividend(dividend);
|
newDividend = await calculateDividend(dividend);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ export const STATUS = {
|
|||||||
LOT_OFFER_SERIAL: { code: 21002, simStr: '不能连续出价' },
|
LOT_OFFER_SERIAL: { code: 21002, simStr: '不能连续出价' },
|
||||||
DIVIDEND_NOT_READY: { code: 21003, simStr: '还不可以领取分红' },
|
DIVIDEND_NOT_READY: { code: 21003, simStr: '还不可以领取分红' },
|
||||||
DIVIDEND_GUILD_PLAYER_ONLY: { code: 21004, simStr: '需要参加军团活动才能领取' },
|
DIVIDEND_GUILD_PLAYER_ONLY: { code: 21004, simStr: '需要参加军团活动才能领取' },
|
||||||
|
AUCTION_GUILD_MEMBER_ONLY: { code: 21005, simStr: '不是军团的成员无法出价' },
|
||||||
|
|
||||||
// 军团活动 21100-21199
|
// 军团活动 21100-21199
|
||||||
GUILD_ACTIVITY_NOT_OPEN: { code: 21100, simStr: '活动未开放' },
|
GUILD_ACTIVITY_NOT_OPEN: { code: 21100, simStr: '活动未开放' },
|
||||||
|
|||||||
Reference in New Issue
Block a user