jenkins:debug用拍卖行测试出价

This commit is contained in:
luying
2022-06-07 13:31:20 +08:00
parent ecbe93856c
commit 90e729b686
3 changed files with 8 additions and 6 deletions
@@ -46,8 +46,8 @@ export class AuctionHandler {
} }
async offer(msg: { code: string, max: boolean, auctionStage: number }, session: BackendSession) { async offer(msg: { code: string, max: boolean, auctionStage: number, magicWord: string }, session: BackendSession) {
const { code, max, auctionStage } = msg; const { code, max, auctionStage, magicWord } = msg;
const roleId = session.get('roleId'); const roleId = session.get('roleId');
const sid = session.get('sid'); const sid = session.get('sid');
const serverId = session.get('serverId'); const serverId = session.get('serverId');
@@ -71,7 +71,7 @@ export class AuctionHandler {
return resResult(STATUS.AUCTION_GUILD_MEMBER_ONLY); return resResult(STATUS.AUCTION_GUILD_MEMBER_ONLY);
} }
if(!await checkAuctionStage(auctionStage)) { if(!await checkAuctionStage(auctionStage, magicWord)) {
res.releaseCallback(); res.releaseCallback();
return resResult(STATUS.AUCITON_STAGE_ERR); return resResult(STATUS.AUCITON_STAGE_ERR);
} }
+3 -1
View File
@@ -515,7 +515,9 @@ export async function pushAuctionUpdate(lots: LotType[], dividends: DividendType
} }
export async function checkAuctionStage(auctionStage: number) { export async function checkAuctionStage(auctionStage: number, magicWord: string) {
if(magicWord == DEBUG_MAGIC_WORD) return true
const curTime = await getCurrentTimeWithSetDay(); const curTime = await getCurrentTimeWithSetDay();
if(auctionStage != AUCTION_STAGE.GUILD && auctionStage != AUCTION_STAGE.WORLD) return false; if(auctionStage != AUCTION_STAGE.GUILD && auctionStage != AUCTION_STAGE.WORLD) return false;
if(auctionStage == AUCTION_STAGE.GUILD) { if(auctionStage == AUCTION_STAGE.GUILD) {
+2 -2
View File
@@ -129,7 +129,7 @@ describe('拍卖行测试', function () {
done(); done();
return; return;
} }
pinusClient.request('guild.auctionHandler.offer', { code: unsoldLots[0].code, max: false }, (res) => { pinusClient.request('guild.auctionHandler.offer', { code: unsoldLots[0].code, max: false, magicWord: DEBUG_MAGIC_WORD }, (res) => {
checkSuccessResponse(res); checkSuccessResponse(res);
checkLot(res.data.lot); checkLot(res.data.lot);
if (res.data.dividend) { if (res.data.dividend) {
@@ -144,7 +144,7 @@ describe('拍卖行测试', function () {
return; return;
} }
gid = unsoldLots[0].gid; gid = unsoldLots[0].gid;
pinusClient.request('guild.auctionHandler.offer', { code: unsoldLots[0].code, max: true }, (res) => { pinusClient.request('guild.auctionHandler.offer', { code: unsoldLots[0].code, max: true, magicWord: DEBUG_MAGIC_WORD }, (res) => {
checkSuccessResponse(res); checkSuccessResponse(res);
checkLot(res.data.lot); checkLot(res.data.lot);
if(res.data.dividend) { if(res.data.dividend) {