活动:任务接口添加serverId接口

This commit is contained in:
qiaoxin
2021-05-20 19:25:52 +08:00
parent d637e5701d
commit 718f19a42a
39 changed files with 481 additions and 465 deletions

View File

@@ -74,7 +74,7 @@ export class GachaHandler {
let userGacha = await UserGachaModel.findByRole(roleId, gachaId, activityId);
let { floor, freeCount, hope, point, pickHero, refFreeTime, count: historyCount } = await refreshGacha(dicGacha, userGacha);
if((gachaId == GACHA_ID.ASSIGN|| gachaId == GACHA_ID.TIMELIMIT) && !pickHero) return resResult(STATUS.GACHA_NOT_ASSIGN);
if ((gachaId == GACHA_ID.ASSIGN || gachaId == GACHA_ID.TIMELIMIT) && !pickHero) return resResult(STATUS.GACHA_NOT_ASSIGN);
let userHeroes = await HeroModel.findByRole(roleId);
@@ -155,7 +155,7 @@ export class GachaHandler {
for (let { hid } of hope) {
let dicHero = gameData.hero.get(hid);
if(hid != 0) {
if (hid != 0) {
if (!dicHero) return resResult(STATUS.DIC_DATA_NOT_FOUND);
if (hid != 0 && dicHero.quality != HERO_QUALITY_TYPE.GOLD) {
return resResult(STATUS.GACHA_HOPE_NOT_GOLD);
@@ -255,6 +255,7 @@ export class GachaHandler {
async setPickHero(msg: { gachaId: number, activityId: number, pickHero: number }, session: BackendSession) {
const { gachaId, activityId = 0, pickHero } = msg;
const roleId: string = session.get('roleId');
const serverId: number = session.get('serverId');
if (gachaId != GACHA_ID.ASSIGN && gachaId != GACHA_ID.TIMELIMIT)
return resResult(STATUS.WRONG_PARMS);
let dicHero = gameData.hero.get(pickHero);
@@ -262,7 +263,7 @@ export class GachaHandler {
let heroes: number[] = [];
if (gachaId == GACHA_ID.TIMELIMIT) {
let activityData = await ActivityModel.findActivity(activityId, true);
let activityData = await ActivityModel.findActivity(serverId, activityId, true);
if (!activityData) return resResult(STATUS.ACTIVITY_MISSING);
let gachaData = new GachaData(activityData);