From 07957e60f22f7e09d79e86d3e40a1a221e67c049 Mon Sep 17 00:00:00 2001 From: luying Date: Mon, 12 Apr 2021 11:37:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=A6=9C=EF=BC=9Afix?= =?UTF-8?q?=E5=86=9B=E5=9B=A2=E6=8E=92=E8=A1=8C=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/rankService.ts | 6 +++--- game-server/app/services/redisService.ts | 1 + shared/pubUtils/util.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/game-server/app/services/rankService.ts b/game-server/app/services/rankService.ts index e3f05102f..b85b257e4 100644 --- a/game-server/app/services/rankService.ts +++ b/game-server/app/services/rankService.ts @@ -577,12 +577,12 @@ export class Rank { const { score, time } = this.decodeScore(rankFromDb[ii + 1]); const info = await redisClient().hgetAsync(this.infoKey, this.composeFields(this.infoKey, myId)); const userInfo = JSON.parse(info); - if(nowSeconds() - userInfo.updatedAt > 2 * 30 * 24 * 60 * 60) { - continue; - } let param: RoleRankInfo | GuildRankInfo; if (this.infoKey == REDIS_KEY.USER_INFO) { + if(nowSeconds() - userInfo.updatedAt > 2 * 30 * 24 * 60 * 60) { + continue; + } param = new RoleRankInfo(userInfo, false); param.setInfo(Math.floor(ii / 2) + 1, myId, score, time); } else if (this.infoKey == REDIS_KEY.GUILD_INFO) { diff --git a/game-server/app/services/redisService.ts b/game-server/app/services/redisService.ts index c2ab21406..4276feba4 100644 --- a/game-server/app/services/redisService.ts +++ b/game-server/app/services/redisService.ts @@ -19,6 +19,7 @@ export async function initAllRank() { await delKeys(REDIS_KEY.HERO_INFO); await delKeys(REDIS_KEY.PVP_RANK); await delKeys(REDIS_KEY.TOWER_RANK); + await delKeys(REDIS_KEY.GUILD_LV_RANK); await delKeys(REDIS_KEY.GUILD_ACTIVE_RANK); await delKeys(REDIS_KEY.TOP_LINEUP_RANK); await delKeys(REDIS_KEY.TOP_HERO_RANK); diff --git a/shared/pubUtils/util.ts b/shared/pubUtils/util.ts index 0206d2889..39573b94b 100644 --- a/shared/pubUtils/util.ts +++ b/shared/pubUtils/util.ts @@ -27,10 +27,10 @@ export function aesDecrypt(data, key, iv) { } export function aesEncryptcfb(data, key, iv) { - console.log('****aesEncryptcfb', data) const cipher = crypto.createCipheriv('aes-192-cfb', key, iv); let crypted = cipher.update(data, 'utf8', 'hex'); crypted += cipher.final('hex'); + console.log('****aesEncryptcfb', data, crypted) return crypted; }