✨ feat(活动): 小游戏
This commit is contained in:
@@ -20,6 +20,7 @@ import { GVGVestigeSumRankModel } from "../db/GVGVestigeSumRank";
|
||||
import { GVGLeagueModel, GVGLeagueType } from "../db/GVGLeague";
|
||||
import { GVGVestigeLeagueRankModel } from "../db/GVGVestigeLeagueRank";
|
||||
import { getDayKeyInfo } from "./gvg/gvgFightService";
|
||||
import { ActivityMiniGameModel } from "../db/ActivityMiniGame";
|
||||
|
||||
|
||||
/**
|
||||
@@ -1207,6 +1208,16 @@ export async function setRankRedisFromDb(type: string, args?: { serverId?: numbe
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type == REDIS_KEY.ACTIVITY_MINI_GAME) {
|
||||
let ranks = await ActivityMiniGameModel.findRank();
|
||||
for(let { _id: { activityId, roundIndex }, roleIds, arr } of ranks) {
|
||||
let r = new Rank(type, { activityId, roundIndex });
|
||||
let roles = await RoleModel.findByRoleIds(roleIds, ROLE_SELECT.RANK);
|
||||
for(let { roleId, score, updatedAt } of arr) {
|
||||
let role = roles.find(cur => cur.roleId == roleId);
|
||||
if(role) await r.setRankWithRoleInfo(roleId, score, updatedAt.getTime(), role, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user