🐞 fix(gvg): 调整spine下发数量开关
This commit is contained in:
@@ -451,6 +451,11 @@ export async function redisAddSettleScore(gvgTeam: GVGTeamType, incScore: number
|
||||
await r2.setRankWithLeagueInfo(leagueCode, incScore, Date.now(), null, true);
|
||||
}
|
||||
|
||||
export async function getSpineCnt() {
|
||||
let cnt = await redisClient().getAsync(REDIS_KEY.GVG_SPINE_CNT);
|
||||
return cnt? parseInt(cnt): 20;
|
||||
}
|
||||
|
||||
// 获取排行榜
|
||||
export async function getBattleRanksByCity(configId: number, groupKey: string, cityId: number, myLeague?: GVGLeagueType) {
|
||||
let teamObj = getGVGBattleData(groupKey);
|
||||
@@ -478,6 +483,8 @@ export async function gvgBattleSeconds() {
|
||||
const { configId, period } = getGVGPeriodData();
|
||||
let { startFightTime, endFightTime } = getFightTimeByPeriod(period);
|
||||
const serverNames = await getAllServerName();
|
||||
|
||||
let spineCnt = await getSpineCnt();
|
||||
let keys: { groupKey: string, cityId: number }[] = []
|
||||
for(let [_key, teamObj] of getGVGBattleMap()) {
|
||||
// console.log('#### gvgBattleSeconds groupKey: ', _key, 'areas', teamObj.findAreas(), 'appid', pinus.app.getServerId());
|
||||
@@ -495,7 +502,7 @@ export async function gvgBattleSeconds() {
|
||||
let spinesByCity = new Map<number, GVGTeamSpineInMap[]>();
|
||||
for(let areaId of teamObj.findAreas()) {
|
||||
let dicArea = gameData.gvgArea.get(areaId);
|
||||
let teams = teamObj.findTeamsByArea(areaId);
|
||||
let teams = teamObj.findTeamsByArea(areaId, spineCnt);
|
||||
let spines = teams.map(team => new GVGTeamSpineInMap(team, serverNames));
|
||||
if(!spinesByCity.has(dicArea.cityId)) spinesByCity.set(dicArea.cityId, []);
|
||||
spinesByCity.get(dicArea.cityId).push(...spines);
|
||||
|
||||
Reference in New Issue
Block a user