fix 奇遇无法刷出
This commit is contained in:
@@ -127,7 +127,7 @@ export class PvpHandler {
|
|||||||
|
|
||||||
await BattleRecordModel.updateBattleRecordByCode(battleCode, {
|
await BattleRecordModel.updateBattleRecordByCode(battleCode, {
|
||||||
$set: {
|
$set: {
|
||||||
roleId, roleName, warId,
|
roleId, roleName, battleId: warId,
|
||||||
status: 0,
|
status: 0,
|
||||||
warName: warInfo.gk_name,
|
warName: warInfo.gk_name,
|
||||||
warType: warInfo.warType,
|
warType: warInfo.warType,
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export class EntryHandler {
|
|||||||
let equips = await EquipModel.findbyRole(role.roleId);
|
let equips = await EquipModel.findbyRole(role.roleId);
|
||||||
let items = await ItemModel.findbyRole(role.roleId);
|
let items = await ItemModel.findbyRole(role.roleId);
|
||||||
|
|
||||||
await chackFunOpenWhenLogin(role, session.get('funcs'));
|
await chackFunOpenWhenLogin(role, session);
|
||||||
await loginRefresh(role.roleId);
|
await loginRefresh(role.roleId);
|
||||||
|
|
||||||
role['heros'] = heros.map(cur => returnHeroCeRatio(cur));
|
role['heros'] = heros.map(cur => returnHeroCeRatio(cur));
|
||||||
|
|||||||
@@ -31,6 +31,6 @@ export async function switchOnFunc(roleId: string, type: number, param: number,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function chackFunOpenWhenLogin(role: any, dataFuncs:Array<number>) {
|
export async function chackFunOpenWhenLogin(role: any, session: BackendSession|FrontendSession) {
|
||||||
await eventOnPlayerLvUp(role.roleId, role.lv, [], dataFuncs);
|
await switchOnFunc(role.roleId, FUNC_OPT_TYPE.LEVEL_UP, role.lv, session);
|
||||||
}
|
}
|
||||||
@@ -5,12 +5,14 @@ import { fromCallback } from 'bluebird';
|
|||||||
import { checkPvp, findPvpDefByRoleId } from '../services/pvpService'
|
import { checkPvp, findPvpDefByRoleId } from '../services/pvpService'
|
||||||
import { getFuncsSwitch } from '../pubUtils/data';
|
import { getFuncsSwitch } from '../pubUtils/data';
|
||||||
import { FUNCS_ID, FUNC_OPT_TYPE } from '../consts/constModules/sysConst';
|
import { FUNCS_ID, FUNC_OPT_TYPE } from '../consts/constModules/sysConst';
|
||||||
import { RoleModel } from '../db/Role'
|
import { RoleModel } from '../db/Role';
|
||||||
|
import { startEvent } from "./eventSercive";
|
||||||
|
|
||||||
export async function eventOnPlayerLvUp(roleId: string, lv: number, addFuncs: Array<number>, dataFuncs: Array<number>) {
|
export async function eventOnPlayerLvUp(roleId: string, lv: number, addFuncs: Array<number>, dataFuncs: Array<number>) {
|
||||||
|
|
||||||
if (!dataFuncs.includes(FUNCS_ID.PVP)) {//开启pvp
|
if (!dataFuncs.includes(FUNCS_ID.PVP)) {//开启pvp
|
||||||
let res = getFuncsSwitch(FUNCS_ID.PVP);
|
let res = getFuncsSwitch(FUNCS_ID.PVP);
|
||||||
if (!res || lv >= res.param) {
|
if (res && lv >= res.param) {
|
||||||
let role = await RoleModel.findByRoleId(roleId);
|
let role = await RoleModel.findByRoleId(roleId);
|
||||||
await checkPvp(role);
|
await checkPvp(role);
|
||||||
addFuncs.push(FUNCS_ID.PVP);
|
addFuncs.push(FUNCS_ID.PVP);
|
||||||
@@ -19,7 +21,7 @@ export async function eventOnPlayerLvUp(roleId: string, lv: number, addFuncs: Ar
|
|||||||
|
|
||||||
if (!dataFuncs.includes(FUNCS_ID.EVENT)) {//开启奇遇
|
if (!dataFuncs.includes(FUNCS_ID.EVENT)) {//开启奇遇
|
||||||
let res = getFuncsSwitch(FUNCS_ID.EVENT);
|
let res = getFuncsSwitch(FUNCS_ID.EVENT);
|
||||||
if (!res || lv >= res.param) {
|
if (res && lv >= res.param) {
|
||||||
addFuncs.push(FUNCS_ID.EVENT);
|
addFuncs.push(FUNCS_ID.EVENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,5 +5,12 @@
|
|||||||
"conditionType": 1,
|
"conditionType": 1,
|
||||||
"param": 1,
|
"param": 1,
|
||||||
"script": "&"
|
"script": "&"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"desc": "PVP",
|
||||||
|
"conditionType": 1,
|
||||||
|
"param": 1,
|
||||||
|
"script": "&"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user