排行榜:fix军团排行榜

This commit is contained in:
luying
2021-04-12 11:37:33 +08:00
parent 92a5035ad6
commit 07957e60f2
3 changed files with 5 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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;
}