修复:名将谱战力、活动铜币数量、引导抽卡new问题、未初始推送

This commit is contained in:
luying
2021-12-28 14:53:42 +08:00
parent 5097979bf4
commit 7d5ef79407
8 changed files with 35 additions and 18 deletions
@@ -78,12 +78,13 @@ export class DailyCoinHandler {
} }
let rate = playerData.getRate()//翻几倍 let rate = playerData.getRate()//翻几倍
rateArray.push(rate); rateArray.push(rate);
let rewardItem: CoinRewardFormulaItem = playerData.findCoinRewardFormulaItem(index); let lv = role.lv;//玩家等级
let rewardItem: CoinRewardFormulaItem = playerData.findCoinRewardFormulaItem(lv);
if (!rewardItem) { if (!rewardItem) {
return resResult(STATUS.ACTIVITY_DATA_ERROR); return resResult(STATUS.ACTIVITY_DATA_ERROR);
} }
let lv = role.lv;//玩家等级
let coinRewardCount = eval(rewardItem.rewardFormula); let coinRewardCount = eval(rewardItem.rewardFormula);
console.log('******** coinReward', lv, rewardItem.rewardFormula, coinRewardCount)
let baseRewardParamArr: Array<RewardParam> = [{ id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.COIN), count: coinRewardCount, type: ACTIVITY_RESOURCES_TYPE.GOODS }]; let baseRewardParamArr: Array<RewardParam> = [{ id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.COIN), count: coinRewardCount, type: ACTIVITY_RESOURCES_TYPE.GOODS }];
console.log('第几次抽奖:', index, ' 基础奖励翻倍:', rate, JSON.stringify(baseRewardParamArr),) console.log('第几次抽奖:', index, ' 基础奖励翻倍:', rate, JSON.stringify(baseRewardParamArr),)
@@ -380,7 +380,8 @@ export class GachaHandler {
if (!costResult) return resResult(STATUS.GACHA_COST_NOT_ENOUGH); if (!costResult) return resResult(STATUS.GACHA_COST_NOT_ENOUGH);
} }
let gachaPull = new GachaPull(gachaId, 0, []); let userHeroes = await HeroModel.findByRole(roleId);
let gachaPull = new GachaPull(gachaId, 0, userHeroes);
gachaPull.setByUserGacha({...dicGacha, floorReward: 0}, userGacha); gachaPull.setByUserGacha({...dicGacha, floorReward: 0}, userGacha);
let { resultList } = gachaPull.pull(count); let { resultList } = gachaPull.pull(count);
@@ -95,7 +95,7 @@ export class EntryHandler {
checkTaskWithRole(serverId, role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SUM, role); checkTaskWithRole(serverId, role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SUM, role);
checkTaskWithRole(serverId, role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SERIES, role); checkTaskWithRole(serverId, role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SERIES, role);
// 推送数据 // 推送数据
if (role.hasInit) pushData(role, session); pushData(role.hasInit, role, session);
role['heros'] = heros; role['heros'] = heros;
role['equips'] = equips; role['equips'] = equips;
@@ -181,7 +181,7 @@ export class EntryHandler {
checkTaskWithRole(serverId, role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SUM, role); checkTaskWithRole(serverId, role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SUM, role);
checkTaskWithRole(serverId, role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SERIES, role); checkTaskWithRole(serverId, role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SERIES, role);
// 推送数据 // 推送数据
pushData(role, session, 'refresh'); pushData(role.hasInit, role, session, 'refresh');
let todayZeroPoint = getZeroPoint(); let todayZeroPoint = getZeroPoint();
return resResult(STATUS.SUCCESS, { todayZeroPoint }); return resResult(STATUS.SUCCESS, { todayZeroPoint });
+10 -5
View File
@@ -38,7 +38,7 @@ import { PvpDefenseModel } from '../db/PvpDefense';
import { getDonation } from './donateService'; import { getDonation } from './donateService';
import { refChallengeCnt } from './pvpService'; import { refChallengeCnt } from './pvpService';
export async function pushData(role: RoleType, session: FrontendOrBackendSession, pushType: 'entry' | 'refresh' = 'entry') { export async function pushData(hasInit: boolean, role: RoleType, session: FrontendOrBackendSession, pushType: 'entry' | 'refresh' = 'entry') {
try { try {
const { roleId } = role; const { roleId } = role;
const sid = session.get('sid'); const sid = session.get('sid');
@@ -46,11 +46,16 @@ export async function pushData(role: RoleType, session: FrontendOrBackendSession
pushEntryStart(roleId, sid); pushEntryStart(roleId, sid);
// 军团 // 军团
const guildData = await getGuildEntryData(role, sid, session); const guildData = await getGuildEntryData(role, sid, session);
let modules = ['lv', 'battle', 'rank', 'mail', 'friend', 'daily', 'expedition', 'tower', 'comBattle', 'dungeon', 'pvp', 'gacha', 'school', 'task', 'chat', 'event', 'guild']; let modules = [];
if (guildData.hasGuild) { if(!hasInit) {
modules.push('auction', 'train', 'boss', 'wishPool', 'guildActivity', 'donate'); modules.push('lv', 'battle');
} else {
modules.push('lv', 'battle', 'rank', 'mail', 'friend', 'daily', 'expedition', 'tower', 'comBattle', 'dungeon', 'pvp', 'gacha', 'school', 'task', 'chat', 'event', 'guild');
if (guildData.hasGuild) {
modules.push('auction', 'train', 'boss', 'wishPool', 'guildActivity', 'donate');
}
modules.push('shop')
} }
modules.push('shop')
let notIncludeModule: string[] = []; let notIncludeModule: string[] = [];
if (pushType == 'refresh') { // 每天5点刷新的时候不推送 if (pushType == 'refresh') { // 每天5点刷新的时候不推送
notIncludeModule = ['rank', 'mail', 'school', 'auction', 'train', 'chat', 'battle']; notIncludeModule = ['rank', 'mail', 'school', 'auction', 'train', 'chat', 'battle'];
+2
View File
@@ -41,6 +41,8 @@ class SimpleResult {
contentId: number; contentId: number;
@prop({ required: true }) @prop({ required: true })
hid: number; hid: number;
@prop({ required: true })
isTransfer: boolean;
} }
/** /**
+5 -5
View File
@@ -1,6 +1,6 @@
// 武将技能表 // 武将技能表
import { readFileAndParse } from '../util' import { readFileAndParse } from '../util'
import { FILENAME, ABI_STAGE } from '../../consts' import { FILENAME, ABI_TYPE } from '../../consts'
export interface DicHeroScroll { export interface DicHeroScroll {
@@ -39,9 +39,9 @@ export function loadHeroScroll() {
function parseCeAttr(elem) { function parseCeAttr(elem) {
let ceAttr = new Map<number, number>(); let ceAttr = new Map<number, number>();
ceAttr.set(ABI_STAGE.HP, elem.hp); ceAttr.set(ABI_TYPE.ABI_HP, elem.hp);
ceAttr.set(ABI_STAGE.ATK, elem.atk); ceAttr.set(ABI_TYPE.ABI_ATK, elem.atk);
ceAttr.set(ABI_STAGE.DEF, elem.def); ceAttr.set(ABI_TYPE.ABI_DEF, elem.def);
ceAttr.set(ABI_STAGE.MDEF, elem.mdef); ceAttr.set(ABI_TYPE.ABI_MDEF, elem.mdef);
return ceAttr; return ceAttr;
} }
+2 -2
View File
@@ -8,8 +8,8 @@ import { gameData } from "./data";
function getParamBySession(session: any) { function getParamBySession(session: any) {
let uid = session.get('userid'); let uid = session.get('userid');
let roleId = session.get('roleId'); let roleId = session.get('roleId')||'';
let roleName = session.get('roleName'); let roleName = session.get('roleName')||'';
let ip = session.get('ip'); let ip = session.get('ip');
let serverId = session.get('serverId'); let serverId = session.get('serverId');
return { uid, roleId, roleName, ip, serverId }; return { uid, roleId, roleName, ip, serverId };
+9 -1
View File
@@ -960,20 +960,28 @@ async function calSchoolStarIncAttr(role: RoleType, heros: HeroType[], type: num
*/ */
function calScrollAddAttr(role: RoleType,heros: HeroType[], hid: number) { function calScrollAddAttr(role: RoleType,heros: HeroType[], hid: number) {
let { attr: roleAttrs } = role; let { attr: roleAttrs } = role;
console.log('********** calScrollAddAttr', hid)
let curHero = heros.find(cur => cur.hid == hid); let curHero = heros.find(cur => cur.hid == hid);
let dicHero = gameData.hero.get(hid); let dicHero = gameData.hero.get(hid);
if (!curHero || !dicHero) return roleAttrs; if (!curHero || !dicHero) return roleAttrs;
let { quality } = dicHero; let { quality } = dicHero;
let { star, quality: curQuality, colorStar } = curHero; let { star, quality: curQuality, colorStar } = curHero;
console.log('********** calScrollAddAttr curHero', star, curQuality, colorStar);
let heroScroll = getScollByStar(quality, star, curQuality, colorStar); let heroScroll = getScollByStar(quality, star, curQuality, colorStar);
if (!heroScroll) return roleAttrs; if (!heroScroll) return roleAttrs;
console.log('********** heroScroll', heroScroll);
let isInit = star == dicHero.initialStars && curQuality == dicHero.quality && colorStar == 0;
let preScroll = isInit? null: gameData.preHeroScroll.get(heroScroll.id);
console.log('********** preScroll', preScroll);
let preScroll = gameData.preHeroScroll.get(heroScroll.id);
heroScroll.ceAttr.forEach((add, attrId) => { heroScroll.ceAttr.forEach((add, attrId) => {
let preAdd = preScroll ? preScroll.ceAttr.get(attrId) : 0; let preAdd = preScroll ? preScroll.ceAttr.get(attrId) : 0;
let fixUp = (add - preAdd) * HERO_CE_RATIO; let fixUp = (add - preAdd) * HERO_CE_RATIO;
console.log('********** preAdd', attrId, preAdd, fixUp);
updateRoleAttr(roleAttrs, attrId, { inc: { fixUp } }); updateRoleAttr(roleAttrs, attrId, { inc: { fixUp } });
}); });
return roleAttrs; return roleAttrs;