Merge branch 'bugfix' into dev

This commit is contained in:
dy 2023-12-21 09:52:15 +08:00
commit dd60fe3bab
5 changed files with 62 additions and 25 deletions

View File

@ -85,7 +85,9 @@ async function checkAndRefreshEnemy() {
export async function refreshEnemys(call: ApiCall) {
if (!lastRefreshTime) await checkAndRefreshEnemy()
let dbUser = enemyObject[Math.floor(call.conn.gud.lv / 10)]
let lvDw = Math.floor(call.conn.gud.lv / 10 > 8 ? 8 : call.conn.gud.lv / 10)
let dbUser = enemyObject[lvDw] || []
let enemys: joinFightData[] = [];

View File

@ -9,6 +9,7 @@ let uid2processId = {};
//订阅redis
let subscribeRedis: RedisClientType
let firstPid = null;
//发布和可写redis复用原 setRedis 里的redisClient
@ -43,14 +44,19 @@ export function clusterPublish(key: string, data: any) {
* N个进程中使
*/
export function clusterRunOnce(fun) {
console.log(`${process.pid}环境变量pm_id===>${process.env.pm_id}`);
if (process.env.pm_id == null || process.env.pm_id === '0') {
//非pm2启动的或是pm2下启动的第一个进程
console.log("run clusterRunOnce1 ===>", process.pid)
fun();
return;
}
if(G.config.isG123)return;
if (firstPid == process.pid) {
//pm2的其中一个进程
console.log("run clusterRunOnce2 ===>", process.pid)
fun();
return;
}

View File

@ -788,7 +788,7 @@ export class TaskAllEmitFun {
let _val = node.call.req.num;
G.emit("Class_task_136", 'Class_task_136', node.call, _val, 0);
// todo 统计藏品修复胶此处只是临时处理防止线上任务数据出错正确做法是统计修复胶的消耗走136任务的统计
G.emit("Class_task_134", 'Class_task_134', node.call, _val, 0, {});
G.emit("Class_task_134", 'Class_task_134', node.call, _val, 0, []);
}
if (node.call.service.name == 'peijian/LvUp' && node.return.isSucc) {

View File

@ -390,8 +390,11 @@ export module manager {
async initVal(call: ApiCall, con) {
const data = await TanXianFun.getData(call);
if (data?.resetTime > PublicShared.getToDayZeroTime()) {
return data.useFastGuaJiNum || 0
}
return 0
}
}
// 第25个任务 竞技场中挑战 n 次对手
@ -401,8 +404,11 @@ export module manager {
async initVal(call: ApiCall, con) {
let data = await JJCFun.getData(call);
if (data?.resetTime >= PublicShared.getToDayZeroTime()) {
return data?.useFightNum || 0
}
return 0
}
}
// 第26个任务 斩草除根进行 n 次通关或扫荡
@ -418,8 +424,11 @@ export module manager {
async initVal(call: ApiCall, con) {
let myData = await G.mongodb.cPlayerInfo('meirishilian').findOne({uid: call.uid, type: 'meirishilian'});
if (myData.data.refreshTime > PublicShared.getToDayZeroTime()) {
return R.compose(R.sum(), R.map(i => i[0].useFightNum), R.values())(myData.data.numInfo) || 0
}
return 0
}
}
// 第28个任务 地盘争夺抢夺或战领 n 次
@ -435,7 +444,10 @@ export module manager {
async initVal(call: ApiCall, con) {
let myData = await G.mongodb.cPlayerInfo('qjzzd').findOne({uid: call.uid, type: 'qjzzd'});
return myData.useFightNum || 0
if (myData?.refreFightTime > PublicShared.getToDayZeroTime()) {
return myData?.useFightNum || 0
}
return 0
}
}
@ -491,8 +503,11 @@ export module manager {
async initVal(call: ApiCall, con) {
let data: Partial<CollectionWanted> = await G.mongodb.collection('wanted').findOne({uid: call.uid}) || {};
if (data.refreshTime > PublicShared.getToDayZeroTime()) {
return data.toDayUseNum || 0
}
return 0
}
}
// 第35个任务 进行 x 教会招募
@ -766,6 +781,7 @@ export module manager {
return call.conn.gud?.helpHeros?.length || 0;
}
}
// 第56个任务 完成圣诞活动小游戏
export class Class_task_154 extends BaseClass {
stype = 154
@ -775,6 +791,7 @@ export module manager {
return 0;
}
}
// 第57个任务 领取每日任务最终宝箱
export class Class_task_155 extends BaseClass {
stype = 155

View File

@ -182,6 +182,18 @@ export function getBuffDPS(toRole: FightObj, fromRole: FightObj, extData: { xiao
// todo 主角技能还没有限制百分比的最大伤害以下判断修复技能buff没有伤害
if (fromRole.getData('pos') != 7){
dps = dps > maxDps ? maxDps : dps;
} else {
// 主角技能伤害最大值: avg(所有上场干部的maxDps) * 2
let sumHeroMaxDps = 0, heroCount = 0;
const fromRoleSide = fromRole.getData('side');
fromRole.fightControl.fightRolesArr.forEach(role => {
if (role.getData('pos') < 7 && role.getData('side') === fromRoleSide) {
sumHeroMaxDps += role.getData('maxdps');
heroCount++;
}
});
maxDps = sumHeroMaxDps / heroCount * 2;
dps = dps > maxDps ? maxDps : dps;
}
return { num: -dps, dps: -dps, miss: miss, baoji: baoji, fromRole: fromRole, toRole: toRole };