拍卖行:修复获取排品缺少演武的问题
This commit is contained in:
@@ -20,6 +20,7 @@ import { GuildActivityCityType, GuildActivityCityModel } from "../db/GuildActivi
|
||||
import { DicCityActivity } from "../pubUtils/dictionary/DicCityActivity";
|
||||
import { GateActivityObject, CityActivityObject, RaceActivityObject } from "./guildActivityObjService";
|
||||
import { Rank } from "./rankService";
|
||||
import { BossInstanceModel } from "../db/BossInstance";
|
||||
|
||||
let gateActivityObj: GateActivityObject;
|
||||
let cityActivityObj: CityActivityObject;
|
||||
@@ -486,10 +487,19 @@ export async function autoDeclare(serverId: number) {
|
||||
* @param sourceCode 活动唯一code
|
||||
*/
|
||||
export async function participants(guildCode: string, sourceType: number, sourceCode: string) {
|
||||
let rec = await GuildActivityRecordModel.findBySourceCode(guildCode, sourceType, sourceCode);
|
||||
if(!rec) return [];
|
||||
if(sourceType == AUCTION_SOURCE.BOSS) {
|
||||
let rec = await BossInstanceModel.findBySourceCode(guildCode, sourceCode);
|
||||
if(!rec) return [];
|
||||
|
||||
return rec.members||[];
|
||||
return rec.ranks.map(cur => {
|
||||
return { roleId: cur.roleId, job: cur.job }
|
||||
});
|
||||
} else {
|
||||
let rec = await GuildActivityRecordModel.findBySourceCode(guildCode, sourceType, sourceCode);
|
||||
if(!rec) return [];
|
||||
|
||||
return rec.members||[];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,11 +8,12 @@ import { pinus } from 'pinus';
|
||||
import { STATUS } from '../consts/statusCode';
|
||||
import { deepCopy, resResult } from '../pubUtils/util';
|
||||
import { BattleRecordModel } from '../db/BattleRecord';
|
||||
import { getArmyBossRank } from '../pubUtils/data';
|
||||
import { getArmyBossRank, gameData } from '../pubUtils/data';
|
||||
import { getMailContent } from '../services/mailService';
|
||||
import { pushMail } from '../pubUtils/interface';
|
||||
import { MAIL_TYPE } from '../consts';
|
||||
import { MAIL_TYPE, AUCTION_SOURCE } from '../consts';
|
||||
import { GUILD_BOSS_STATUS } from '../consts/constModules/guildConst';
|
||||
import { genAuction } from './auctionService';
|
||||
/**
|
||||
* 获得boss界面
|
||||
* @param bossInstance
|
||||
@@ -102,7 +103,7 @@ export async function bossResult(code: string, serverId: number, dataName: strin
|
||||
let res:any = await lockData(serverId, dataName, code);//加锁
|
||||
if (!!res.err)
|
||||
return true;
|
||||
let {winSettled, ranks, num, warId, bossHp, bossLv} = await BossInstanceModel.findBossInstance(code);//锁定关卡信息
|
||||
let {winSettled, ranks, num, warId, bossHp, bossLv, code: bossCode } = await BossInstanceModel.findBossInstance(code);//锁定关卡信息
|
||||
if (winSettled) {
|
||||
res.releaseCallback();//解锁
|
||||
await BossInstanceModel.recordRoleIdWhenCheck(code, roleId);
|
||||
@@ -138,6 +139,12 @@ export async function bossResult(code: string, serverId: number, dataName: strin
|
||||
pushMessage.forEach(({route, data, uids })=>{
|
||||
pinus.app.channelService.pushMessageByUids(route, resResult(STATUS.SUCCESS, { mails: data }), uids);
|
||||
});
|
||||
// 加入拍卖行
|
||||
let dicBossBase = gameData.bossBaseByBossLv.get(bossLv);
|
||||
if(dicBossBase) {
|
||||
await genAuction(code, AUCTION_SOURCE.BOSS, bossCode, serverId, dicBossBase.reward);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user