清理一些console
This commit is contained in:
@@ -84,10 +84,10 @@ export class DailyCoinHandler {
|
||||
return resResult(STATUS.ACTIVITY_DATA_ERROR);
|
||||
}
|
||||
let coinRewardCount = eval(rewardItem.rewardFormula);
|
||||
console.log('******** coinReward', lv, rewardItem.rewardFormula, coinRewardCount)
|
||||
// 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 }];
|
||||
console.log('第几次抽奖:', index, ' 基础奖励翻倍:', rate, JSON.stringify(baseRewardParamArr),)
|
||||
// console.log('第几次抽奖:', index, ' 基础奖励翻倍:', rate, JSON.stringify(baseRewardParamArr),)
|
||||
for (let reward of baseRewardParamArr) {
|
||||
reward.count = reward.count * rate;
|
||||
}
|
||||
@@ -96,15 +96,15 @@ export class DailyCoinHandler {
|
||||
if (extraIndex != -1) {//额外奖励
|
||||
let extraRewardParamArr: Array<RewardParam> = stringToRewardParam(playerData.extraReward);
|
||||
let extraReward = extraRewardParamArr[extraIndex];
|
||||
console.log('额外奖励', JSON.stringify(extraReward))
|
||||
// console.log('额外奖励', JSON.stringify(extraReward))
|
||||
allReward.push(extraReward);
|
||||
}
|
||||
}
|
||||
|
||||
let newConsume = mergeData(allConsume);
|
||||
let newReward = mergeData(allReward);
|
||||
console.log('所有消耗', JSON.stringify(newConsume))
|
||||
console.log('所有奖励', JSON.stringify(newReward))
|
||||
// console.log('所有消耗', JSON.stringify(newConsume))
|
||||
// console.log('所有奖励', JSON.stringify(newReward))
|
||||
|
||||
//检查资源
|
||||
let consumeResult = await handleCost(roleId, sid, newConsume, ITEM_CHANGE_REASON.DAILY_COIN_EXCHANGE);
|
||||
|
||||
@@ -63,7 +63,7 @@ export class RechargeMoneyHandler {
|
||||
|
||||
let recordArray = playerData.recordArray.filter(obj => { return obj && !obj.rewardTime })
|
||||
let rechargeItem = recordArray[0];
|
||||
console.log('recordArray', JSON.stringify(recordArray));
|
||||
// console.log('recordArray', JSON.stringify(recordArray));
|
||||
await ActivityRechargeMoneyModel.addRecord(rechargeItem._id, item.id, item.reward)
|
||||
let rewardParamArr: Array<RewardParam> = stringToRewardParam(item.reward);
|
||||
let result = await addReward(roleId, roleName, sid, serverId, rewardParamArr, ITEM_CHANGE_REASON.RECHARGE_REWARD)
|
||||
|
||||
@@ -93,7 +93,7 @@ export class ThirtyDaysHandler {
|
||||
if (activityDays < todayIndex && todayIndex <= (activityDays + playerData.days)) {//时间正常范围内
|
||||
|
||||
} else if (todayIndex > (activityDays + playerData.days)) {//活动已经过期
|
||||
console.log('过期奖励')
|
||||
// console.log('过期奖励')
|
||||
let expiredItems: Array<ThirtyDaysPointItem> = playerData.needMark();
|
||||
let cells = expiredItems.map(obj => obj.cellIndex)
|
||||
await ActivityThirtyDaysPointRewardModel.setExpired(activityId, roleId, cells);
|
||||
|
||||
@@ -55,7 +55,7 @@ export class ActivityRemote {
|
||||
this.app.set('activityByType', this.activityByType);
|
||||
this.app.set('activities', this.activities);
|
||||
this.app.set('groupToServer', this.groupToServer);
|
||||
console.log('****** loadActivities')
|
||||
// console.log('****** loadActivities')
|
||||
}
|
||||
|
||||
private setActivityTypeAndServer() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { difference } from 'underscore';
|
||||
* @Last Modified by: 梁桐川
|
||||
* @Last Modified time: 2021-08-27 17:47:56
|
||||
*/
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, COM_BTL_QUALITY, MSG_SOURCE, QUALITY_TYPE, ROLE_SELECT, TASK_TYPE, KING_EXP_RATIO_TYPE, ITEM_CHANGE_REASON, getChannelType, CHANNEL_PREFIX } from './../../../consts';
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, COM_BTL_QUALITY, MSG_SOURCE, QUALITY_TYPE, ROLE_SELECT, TASK_TYPE, KING_EXP_RATIO_TYPE, ITEM_CHANGE_REASON } from './../../../consts';
|
||||
import Role, { RoleModel } from '../../../db/Role';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import { Application, BackendSession } from 'pinus';
|
||||
@@ -24,7 +24,7 @@ import { pushComBtlTeamMsg, pushFriendTeamInviteMsg, pushNormalItemMsg, pushTeam
|
||||
import { EXTERIOR } from '../../../pubUtils/dicParam';
|
||||
import { getZeroPointD, getTimeFunD, getSeconds, nowSeconds } from '../../../pubUtils/timeUtil';
|
||||
import { FriendParams } from '../../../domain/roleField/friend';
|
||||
import { checkActivityTask, checkTask, checkTaskWithArgs, checkTaskWithGoods } from '../../../services/taskService';
|
||||
import { checkTask, checkTaskWithGoods } from '../../../services/taskService';
|
||||
import { gameData, getWarByBlueprtId } from '../../../pubUtils/data';
|
||||
import { HeroModel } from '../../../db/Hero';
|
||||
|
||||
@@ -54,7 +54,7 @@ export class ComBattleHandler {
|
||||
let teamCode = session.get('teamCode');
|
||||
const { blueprtId, pub, ceLimit } = msg;
|
||||
|
||||
console.log('createTeam msg: ', msg);
|
||||
// console.log('createTeam msg: ', msg);
|
||||
// 检查藏宝图Id是否合法
|
||||
if (!blueprtIdValid(blueprtId)) return resResult(STATUS.COM_BATTLE_BLUEPRT_INVALID);
|
||||
const enoughBlueprt = await hasEnoughBlueprt(roleId, sid, blueprtId);
|
||||
@@ -680,21 +680,13 @@ export class ComBattleHandler {
|
||||
|
||||
async sendTeamMsg(msg: { teamCode: string, type: number, content: string, targetRoleId: string, targetMsgCode: string }, session: BackendSession) {
|
||||
let roleId = session.get('roleId');
|
||||
let sid = session.get('sid');
|
||||
let roleName = session.get('roleName');
|
||||
let serverId = session.get('serverId');
|
||||
|
||||
const { teamCode, type, content, targetRoleId, targetMsgCode } = msg;
|
||||
const result = await pushComBtlTeamMsg(teamCode, roleId, roleName, type, MSG_SOURCE.TEAM_ROLE, content, targetRoleId, targetMsgCode);
|
||||
if (!result) {
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
}
|
||||
|
||||
// 任务
|
||||
await checkTaskWithArgs(roleId, sid, TASK_TYPE.CHAT, [getChannelType(CHANNEL_PREFIX.TEAM)]);
|
||||
|
||||
//活动任务
|
||||
await checkActivityTask(serverId, sid, roleId, TASK_TYPE.CHAT, 1, { chatType: getChannelType(CHANNEL_PREFIX.TEAM) })
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
|
||||
const roleId: string = session.get('roleId');
|
||||
const uid: number = session.get('userid');
|
||||
const ip: string = session.get('ip');
|
||||
console.log('*********** global before ip', ip)
|
||||
// console.log('*********** global before ip', ip)
|
||||
let guildCode = session.get('guildCode');
|
||||
let blockType = session.get('blockType');
|
||||
// 访问频率控制
|
||||
|
||||
@@ -18,7 +18,7 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
|
||||
const groupId = session.get('groupId');
|
||||
|
||||
let route = routeRecord.route;
|
||||
console.log('********uid', uid, route);
|
||||
// console.log('********uid', uid, route);
|
||||
let dicApi = gameData.apiByUrl.get(route);
|
||||
if(!dicApi) {
|
||||
return next(new Error(), resResult(STATUS.GM_MISS_API));
|
||||
|
||||
@@ -172,7 +172,7 @@ export class RoleHandler {
|
||||
if (!dicReward || dicReward.rankId != type) continue;
|
||||
|
||||
let rankFirst: RankFirstType = pinus.app.get('rankFirstRewards').get(serverId)?.get(id);
|
||||
console.log('*******', pinus.app.get('rankFirstRewards'), rankFirst);
|
||||
// console.log('*******', pinus.app.get('rankFirstRewards'), rankFirst);
|
||||
if (!rankFirst) continue;
|
||||
if (role.rankReceived.includes(id)) continue;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export class RoleRemote {
|
||||
}
|
||||
|
||||
public setRankFirst(rank: RankFirstType) {
|
||||
console.log('****** setRankFirst', rank.serverId, rank.id, rank)
|
||||
// console.log('****** setRankFirst', rank.serverId, rank.id, rank)
|
||||
if(!this.rankFirstRewards.has(rank.serverId)) {
|
||||
this.rankFirstRewards.set(rank.serverId, new Map());
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ function getApWithDataAp(roleId: string, ip: string, lv: number, dataAp: ActionP
|
||||
* @param sid
|
||||
*/
|
||||
export async function setAp(roleId: string, ip: string, lv: number, changeAp: number, sid: string, reason: ITEM_CHANGE_REASON) {
|
||||
console.log('***** setAp', roleId, ip, lv, changeAp)
|
||||
// console.log('***** setAp', roleId, ip, lv, changeAp)
|
||||
const now = Date.now();
|
||||
const dicAp = getDicApByLv(lv);
|
||||
let ApResult = await getAp(roleId, ip, lv, true);
|
||||
|
||||
@@ -254,7 +254,7 @@ export function _getActivitiesByType(serverId: number, type: number) {
|
||||
export function _getActivities() {
|
||||
try {
|
||||
let activities = pinus.app.get('activities');
|
||||
console.log('***** activities', activities);
|
||||
// console.log('***** activities', activities);
|
||||
let result: ActivityInRemote[] = [];
|
||||
for(let [_, activity] of activities) {
|
||||
result.push(activity);
|
||||
|
||||
@@ -41,7 +41,7 @@ export function getRandBlueprtId(qualityArr: number[], lvRange: number, cnt = 1)
|
||||
if (blueprtIdArr.length === 0) return null;
|
||||
|
||||
const res = getRandEelm(blueprtIdArr, cnt);
|
||||
console.log('******** getRandBlueprtId', blueprtIdArr, cnt, res)
|
||||
// console.log('******** getRandBlueprtId', blueprtIdArr, cnt, res)
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ function pushEventMsg(sid: string, roleId: string, msg: any ) {
|
||||
* @param status 状态id
|
||||
*/
|
||||
export function checkEventStatus(type: number, status: number) {
|
||||
console.log('type = '+ type + ' status = '+status);
|
||||
// console.log('type = '+ type + ' status = '+status);
|
||||
let flag: boolean; // 检查状态是否正确
|
||||
if(type == EVENT_TYPE.BATTLE||type ==EVENT_TYPE.QUIZ) {
|
||||
if(status == EVENT_RECORD_STATUS.BATTLE_SUCCESS) {
|
||||
|
||||
@@ -104,7 +104,7 @@ export function getAllGuildActivityStatus() {
|
||||
|
||||
export function getGuildActivityByDic(dicGuildActivity: DicGuildActivity) {
|
||||
let t = getTimeFun();
|
||||
console.log('*********', dicGuildActivity.startTime, dicGuildActivity.startMinute, dicGuildActivity.startSeconds)
|
||||
// console.log('*********', dicGuildActivity.startTime, dicGuildActivity.startMinute, dicGuildActivity.startSeconds)
|
||||
let startTime = <number>t.getTimeWithHour(dicGuildActivity.startTime, dicGuildActivity.startMinute, dicGuildActivity.startSeconds);
|
||||
let countdownTime = <number>t.getTimeWithHour(dicGuildActivity.countDown);
|
||||
let { duringTime, openDay } = dicGuildActivity;
|
||||
@@ -305,7 +305,7 @@ export async function sendGuildActEndMsg(aid: number) {
|
||||
let guilds = obj.getGuilds();
|
||||
console.log('******** guilds', guilds);
|
||||
for (let [serverId, guildCodes] of guilds) {
|
||||
console.log('***** serverId', serverId, 'guildCodes', guildCodes);
|
||||
// console.log('***** serverId', serverId, 'guildCodes', guildCodes);
|
||||
for (let guildCode of guildCodes) {
|
||||
await gateActivitySettleReward(guildCode, serverId);
|
||||
}
|
||||
@@ -387,15 +387,15 @@ export async function gateActivitySettleReward(guildCode: string, serverId: numb
|
||||
console.log('gateActivitySettleReward', guildCode, serverId);
|
||||
let obj = getGateActivityObj();
|
||||
let { gateHp, members } = obj.getObj(guildCode, serverId);
|
||||
console.log('***** gateHp', gateHp, 'members', members);
|
||||
// console.log('***** gateHp', gateHp, 'members', members);
|
||||
|
||||
let r = new Rank(REDIS_KEY.GATE_ACTIVITY, { serverId }, true);
|
||||
let rank = await r.getMyRank({ guildCode });
|
||||
let guildScore = await r.getMyScore({ guildCode });
|
||||
console.log('****** ranks', rank, 'guildScore', guildScore);
|
||||
// console.log('****** ranks', rank, 'guildScore', guildScore);
|
||||
|
||||
let rewards = getGuildAuctionRewards(GUILD_ACTIVITY_TYPE.GATE_ACTIVITY, rank);
|
||||
console.log('***** rewards', JSON.stringify(rewards));
|
||||
// console.log('***** rewards', JSON.stringify(rewards));
|
||||
|
||||
let rec = await GuildActivityRecordModel.updateInfo(guildCode, GUILD_ACTIVITY_TYPE.GATE_ACTIVITY, {
|
||||
isSuccess: gateHp > 0,
|
||||
@@ -766,14 +766,14 @@ export async function setDicGuildActivity(now: number, aid: number, startSeconds
|
||||
|
||||
export async function setDicAuctionTime(startTime: number, endActivity: number, startGuild: number, endGuild: number, startWorld: number, endWorld: number) {
|
||||
|
||||
console.log('********* setDicAuctionTime', startTime, endActivity, startGuild, endGuild, startWorld, endWorld);
|
||||
// console.log('********* setDicAuctionTime', startTime, endActivity, startGuild, endGuild, startWorld, endWorld);
|
||||
let startGuildDate = new Date(startTime + endActivity * 1000 + startGuild * 1000);
|
||||
let endGuildDate = new Date(startGuildDate.getTime() + endGuild * 1000);
|
||||
let startWorldDate = new Date(endGuildDate.getTime() + startWorld * 1000);
|
||||
let endWorldDate = new Date(startWorldDate.getTime() + endWorld * 1000);
|
||||
|
||||
|
||||
console.log('********* setDicAuctionTime', startGuildDate, endGuildDate, startWorldDate, endWorldDate);
|
||||
// console.log('********* setDicAuctionTime', startGuildDate, endGuildDate, startWorldDate, endWorldDate);
|
||||
|
||||
gameData.auctionTime.set(AUCTION_TIME.GUILD_PREVIEW, formatTime(new Date(startTime)));
|
||||
gameData.auctionTime.set(AUCTION_TIME.GUILD_OPEN, formatTime(startGuildDate));
|
||||
@@ -782,7 +782,7 @@ export async function setDicAuctionTime(startTime: number, endActivity: number,
|
||||
gameData.auctionTime.set(AUCTION_TIME.WORLD_OPEN, formatTime(startWorldDate));
|
||||
gameData.auctionTime.set(AUCTION_TIME.WORLD_CLOSE, formatTime(endWorldDate));
|
||||
|
||||
console.log('*********** setDicAuctionTime', gameData.auctionTime)
|
||||
// console.log('*********** setDicAuctionTime', gameData.auctionTime)
|
||||
}
|
||||
|
||||
function formatTime(date: Date) {
|
||||
|
||||
@@ -54,7 +54,7 @@ export async function checkAuth(func: number, targetCode: string, guildAuth: num
|
||||
guildAuth = GUILD_AUTH.OTHERS;
|
||||
}
|
||||
const dicGuildAuth = gameData.guildAuth.get(func);
|
||||
console.log('*checkAuth*', func, guildAuth, dicGuildAuth)
|
||||
// console.log('*checkAuth*', func, guildAuth, dicGuildAuth)
|
||||
if (!dicGuildAuth) return false;
|
||||
|
||||
return dicGuildAuth.includes(guildAuth);
|
||||
|
||||
@@ -528,7 +528,7 @@ export async function generPVPOppRecInfo(isSuccess: boolean, curOpp: OppPlayer,
|
||||
let resultMaxRank = gameData.pvpRankMax.max;//根据排行榜的奖励表,获得最大排名挡位的最小值,其余不在结算中结算的玩家按照最大排名挡位在登录或进入pvp时结算
|
||||
let r = new Rank(REDIS_KEY.PVP_RANK, { seasonNum: pvpConfig.seasonNum }, false, resultMaxRank.min - 1);
|
||||
let allRank = <RoleRankInfo[]>(await r.getRankByRange());
|
||||
console.log('******** allRank', 0, resultMaxRank.min - 2, allRank)
|
||||
// console.log('******** allRank', 0, resultMaxRank.min - 2, allRank)
|
||||
for(let { rank, roleId } of allRank) {
|
||||
console.log('******** pvpSeasonEnd: ', rank, roleId);
|
||||
let pvpDefense = await PvpDefenseModel.findByRoleId(roleId);
|
||||
|
||||
@@ -81,7 +81,7 @@ export async function checkActivityTask(serverId: number, sid: string, roleId: s
|
||||
}
|
||||
|
||||
export async function pushActivityUpdate(roleId: string, sid: string, pushMessage: any[]) {
|
||||
console.log('pushActivityUpdate', JSON.stringify(pushMessage))
|
||||
// console.log('pushActivityUpdate', JSON.stringify(pushMessage))
|
||||
if (pushMessage.length > 0) {
|
||||
if (!sid) {
|
||||
let onlineUser = await getRoleOnlineInfo(roleId);
|
||||
@@ -161,7 +161,7 @@ export async function checkTaskInBattleSweep(serverId: number, roleId: string, s
|
||||
}
|
||||
|
||||
export async function checkTaskInComBattleEnd(roleStatus: RoleStatus[], capId: string, quality: number) {
|
||||
console.log('********', JSON.stringify(roleStatus), capId, quality)
|
||||
// console.log('********', JSON.stringify(roleStatus), capId, quality)
|
||||
for (let { roleId, isRobot } of roleStatus) {
|
||||
if (!isRobot) {
|
||||
|
||||
|
||||
@@ -366,9 +366,9 @@ export function auctionSchedule() {
|
||||
let worldOpen = gameData.auctionTime.get(AUCTION_TIME.WORLD_OPEN);
|
||||
let worldClose = gameData.auctionTime.get(AUCTION_TIME.WORLD_CLOSE);
|
||||
|
||||
console.log('***** auctionSchedule', guildOpen.hour, guildOpen.minute, guildOpen.seconds);
|
||||
console.log('***** auctionSchedule', worldOpen.hour, worldOpen.minute, worldOpen.seconds);
|
||||
console.log('***** auctionSchedule', worldClose.hour, worldClose.minute, worldClose.seconds);
|
||||
// console.log('***** auctionSchedule', guildOpen.hour, guildOpen.minute, guildOpen.seconds);
|
||||
// console.log('***** auctionSchedule', worldOpen.hour, worldOpen.minute, worldOpen.seconds);
|
||||
// console.log('***** auctionSchedule', worldClose.hour, worldClose.minute, worldClose.seconds);
|
||||
startGuildAuctionJobId = scheduleJob('startGuildAuction', `${guildOpen.seconds} ${guildOpen.minute} ${guildOpen.hour} * * ?`, startGuildAuction);
|
||||
startWorldAuctionJobId = scheduleJob('startWorldAuction', `${worldOpen.seconds} ${worldOpen.minute} ${worldOpen.hour} * * ?`, startWorldAuction);
|
||||
stopAuctionJobId = scheduleJob('stopAuction', `${worldClose.seconds} ${worldClose.minute} ${worldClose.hour} * * ?`, stopAuction);
|
||||
|
||||
@@ -39,13 +39,13 @@ export default class HangUpRecord extends BaseModel {
|
||||
received: boolean; // 是否已经领取,true-领取,false-未领取
|
||||
|
||||
public static async initRecord(roleId: string, roleName: string, lean = true) {
|
||||
console.log('****** initRecord before')
|
||||
// console.log('****** initRecord before')
|
||||
const curTime = new Date();
|
||||
const recDoc = new HangUpRecordModel();
|
||||
const update = Object.assign(recDoc.toJSON(), {roleId, roleName, startTime: curTime, startLv: dicParam.TOWER_HANG_UP.TOWER_HANG_UP_ENABLE_LV + 1});
|
||||
const rec: HangUpRecordType = await HangUpRecordModel.findOneAndUpdate({roleId, startLv: dicParam.TOWER_HANG_UP.TOWER_HANG_UP_ENABLE_LV + 1}, { $setOnInsert: update }, {upsert: true, new: true}).lean(lean);
|
||||
|
||||
console.log('****** initRecord after')
|
||||
// console.log('****** initRecord after')
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export abstract class ActivityBase {
|
||||
|
||||
this.type = activityData.type;
|
||||
// console.log('今天是活动第几天', activityData.beginTime, new Date, this.todayIndex)
|
||||
console.log('***** activityData', activityData.timeType)
|
||||
// console.log('***** activityData', activityData.timeType)
|
||||
switch (activityData.timeType) {
|
||||
case ACTIVITY_TIME_TYPE.SERVER_OPEN_TIME: {
|
||||
this.beginTime = moment(SERVER_OPEN_TIME).add(this.delayDay, 'd').startOf('d').add(REFRESH_TIME, 'h').valueOf();
|
||||
@@ -43,7 +43,7 @@ export abstract class ActivityBase {
|
||||
this.endTime = moment(this.beginTime).add(1, 'd').valueOf();
|
||||
}
|
||||
this.todayIndex = deltaDays(moment(this.beginTime).toDate(), new Date) + 1;
|
||||
console.log('活动时间数据11...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
|
||||
// console.log('活动时间数据11...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
|
||||
break;
|
||||
}
|
||||
case ACTIVITY_TIME_TYPE.ROLE_REGISTER_TIME: {
|
||||
@@ -55,11 +55,11 @@ export abstract class ActivityBase {
|
||||
}
|
||||
this.todayIndex = deltaDays(moment(this.beginTime).toDate(), new Date) + 1;
|
||||
|
||||
console.log('活动时间数据22...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
|
||||
// console.log('活动时间数据22...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
|
||||
break;
|
||||
}
|
||||
case ACTIVITY_TIME_TYPE.DATE_TIME: {
|
||||
console.log('活动时间数据33...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
|
||||
// console.log('活动时间数据33...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -71,9 +71,9 @@ export abstract class ActivityBase {
|
||||
this.nextRefreshTime = moment(this.beginTime).add(activityData.interval * this.roundIndex, 'second').valueOf();
|
||||
this.todayIndex = Math.ceil(((moment(new Date).valueOf() - this.beginTime) / (24 * 60 * 60 * 1000)));
|
||||
}
|
||||
console.log('活动时间数据...', '活动id:', activityData.activityId, '类型:', activityData.timeType, '开始时间:', this.beginTime, moment(this.beginTime).toDate(),
|
||||
'结束:', this.endTime, moment(this.endTime).toDate(),
|
||||
'今天第几天:', this.todayIndex, '回合:', this.roundIndex, '下次刷新:', this.nextRefreshTime, moment(this.nextRefreshTime).toDate())
|
||||
// console.log('活动时间数据...', '活动id:', activityData.activityId, '类型:', activityData.timeType, '开始时间:', this.beginTime, moment(this.beginTime).toDate(),
|
||||
// '结束:', this.endTime, moment(this.endTime).toDate(),
|
||||
// '今天第几天:', this.todayIndex, '回合:', this.roundIndex, '下次刷新:', this.nextRefreshTime, moment(this.nextRefreshTime).toDate())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -772,7 +772,7 @@ export function getWishPoolReward(id: number) {
|
||||
if(dicItid.type == CONSUME_TYPE.PIECE) {
|
||||
starLevel = dicGoods.equipLvl;
|
||||
}
|
||||
console.log('*****', dicGoods.itid, starLevel, dicGoods.quality)
|
||||
// console.log('*****', dicGoods.itid, starLevel, dicGoods.quality)
|
||||
return gameData.guildWishReward.get(`${dicGoods.itid}_${starLevel}_${dicGoods.quality}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
|
||||
update.topLineupCe = topLineupCe;
|
||||
}
|
||||
|
||||
console.log('************ roleAttr', update.attr)
|
||||
// console.log('************ roleAttr', update.attr)
|
||||
role = await RoleModel.incRoleInfo(roleId, { ce: allIncCe },update);
|
||||
|
||||
let guild = await GuildModel.updateCe(roleId, allIncCe); // 公会更新战力
|
||||
@@ -959,28 +959,28 @@ async function calSchoolStarIncAttr(role: RoleType, heros: HeroType[], type: num
|
||||
*/
|
||||
function calScrollAddAttr(role: RoleType,heros: HeroType[], hid: number) {
|
||||
let { attr: roleAttrs } = role;
|
||||
console.log('********** calScrollAddAttr', hid)
|
||||
// console.log('********** calScrollAddAttr', hid)
|
||||
|
||||
let curHero = heros.find(cur => cur.hid == hid);
|
||||
let dicHero = gameData.hero.get(hid);
|
||||
if (!curHero || !dicHero) return roleAttrs;
|
||||
let { quality } = dicHero;
|
||||
let { star, quality: curQuality, colorStar } = curHero;
|
||||
console.log('********** calScrollAddAttr curHero', star, curQuality, colorStar);
|
||||
// console.log('********** calScrollAddAttr curHero', star, curQuality, colorStar);
|
||||
let heroScroll = getScollByStar(quality, star, curQuality, colorStar);
|
||||
if (!heroScroll) return roleAttrs;
|
||||
console.log('********** heroScroll', heroScroll);
|
||||
// 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);
|
||||
// console.log('********** preScroll', preScroll);
|
||||
|
||||
|
||||
heroScroll.ceAttr.forEach((add, attrId) => {
|
||||
|
||||
let preAdd = preScroll ? preScroll.ceAttr.get(attrId) : 0;
|
||||
let fixUp = (add - preAdd) * HERO_CE_RATIO;
|
||||
console.log('********** preAdd', attrId, preAdd, fixUp);
|
||||
// console.log('********** preAdd', attrId, preAdd, fixUp);
|
||||
updateRoleAttr(roleAttrs, attrId, { inc: { fixUp } });
|
||||
});
|
||||
return roleAttrs;
|
||||
|
||||
@@ -325,18 +325,18 @@ export class CreateHeroes extends UpdateHeroes {
|
||||
|
||||
public async clearTask(activitiesTypeMap: ActivityInRemote[]) {
|
||||
// 任务
|
||||
console.log('****** checkTask before', Date.now())
|
||||
// console.log('****** checkTask before', Date.now())
|
||||
let m1 = await checkTask(this.roleId, TASK_TYPE.HERO_NUM, this.heroNum, true, {});
|
||||
let m2 = await checkTaskWithHeroes(this.roleId, TASK_TYPE.HERO_QUALITY, this.resultHeroes);
|
||||
let m3 = await checkTaskWithHeroes(this.roleId, TASK_TYPE.HERO_QUALITY_STAR_UP, this.resultHeroes);
|
||||
let m4 = await checkTaskWithHeroes(this.roleId, TASK_TYPE.HERO_LV, this.resultHeroes);
|
||||
this.taskPushMessage.push(...m1, ...m2, ...m3, ...m4);
|
||||
console.log('****** checkTask after', Date.now())
|
||||
// console.log('****** checkTask after', Date.now())
|
||||
//成长任务
|
||||
console.log('****** accomplishTask before', Date.now())
|
||||
// console.log('****** accomplishTask before', Date.now())
|
||||
let mm1 = await accomplishTask(this.serverId, this.roleId, TASK_TYPE.HERO_NUM, this.heroNum, null, activitiesTypeMap)
|
||||
let mm2 = await accomplishTask(this.serverId, this.roleId, TASK_TYPE.HERO_QUALITY, this.heroNum, { heroes: this.resultHeroes }, activitiesTypeMap);
|
||||
console.log('****** accomplishTask after', Date.now())
|
||||
// console.log('****** accomplishTask after', Date.now())
|
||||
this.activityTaskPushMessage.push(...mm1, ...mm2);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as crypto from 'crypto'
|
||||
|
||||
export function md5(str: string, treatStr?: (str: string) => string) {
|
||||
if(treatStr) str = treatStr(str);
|
||||
console.log('*****str', str)
|
||||
// console.log('*****str', str)
|
||||
return crypto.createHash('md5').update(str, 'utf8').digest("hex");
|
||||
};
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ export async function accomplishTask(serverId: number, roleId: string, taskType:
|
||||
let taskRecord = await ActivityDailyChallengesModel.findDataByCellIndex(serverId, activity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType)
|
||||
let recordData = taskRecord && taskRecord.data ? JSON.parse(taskRecord.data) : null
|
||||
let { addCount, record } = isComplete(roleId, task.taskType, task.taskParam, count, activity.activityId, parma, recordData);
|
||||
console.log('******* dailyChallenge', addCount, record)
|
||||
// console.log('******* dailyChallenge', addCount, record)
|
||||
if (addCount) {
|
||||
if (taskType == TASK_TYPE.ROLE_LV || taskType == TASK_TYPE.ROLE_TITLE || taskType == TASK_TYPE.BATTLE_TOWER_LV || taskType == TASK_TYPE.FRIEND_NUM) {
|
||||
let playerRecord = await ActivityDailyChallengesModel.setTaskCount(serverId, activity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType, addCount);
|
||||
|
||||
Reference in New Issue
Block a user