✨ feat(离线icon): 到8110dd75c

This commit is contained in:
luying
2023-09-01 11:01:35 +08:00
parent a89392eb27
commit 94cce57ce6
9 changed files with 150 additions and 48 deletions
@@ -10,7 +10,7 @@ import { GVGVestigeModel } from "../../db/GVGVestige";
import { GVGVestigeLeagueRankModel, GVGVestigeLeagueRankType } from "../../db/GVGVestigeLeagueRank";
import { GVGVestigeLockModel } from "../../db/GVGVestigeLock";
import { GVGVestigeRankModel, GVGVestigeRankType, GVGVestigeRankUpdate } from "../../db/GVGVestigeRank";
import { GVGVestigeRecType } from "../../db/GVGVestigeRec";
import { GVGVestigeRecModel, GVGVestigeRecType, GVGVestigeRecUpdate } from "../../db/GVGVestigeRec";
import { GVGVestigeSumRankModel, GVGVestigeSumRankType } from "../../db/GVGVestigeSumRank";
import { HeroModel, HeroType } from "../../db/Hero";
import { RoleModel } from "../../db/Role";
@@ -34,6 +34,9 @@ import { calFighterContribute } from "./gvgPrepareService";
import { addVestigeLeagueRankRec, addVestigeRankMessage } from "./gvgRecService";
import { getGroupKey, getGVGServerType, getPeriodByTime } from "./gvgService";
import { Combo } from "../../domain/battleField/pvp";
import { getRemoteRplPrefix } from "../../pubUtils/battleUtils";
import { pinus } from "pinus";
import { pushIconShow } from "../connectorService";
let gvgFightTime = undefined;
@@ -530,4 +533,16 @@ export function calVestigeLeagueBoxRewards(canReceiveRanks: { rank: number }[],
return {
leagueReward, rewards, boxPreview, canReceiveBox: canReceiveRanks.length > 0 || canReceivePlayerRanks.length > 0
}
}
export async function pushGvgFightIconShow(roleId: string, battleCode: string) {
const rec = await GVGVestigeRecModel.findByBattleCode(battleCode);
let result: (GVGVestigeRecUpdate & { rplFileUrl: string })[] = [];
const { attackRoleId, hasRpl, remoteUrl } = rec;
const rplFileUrl = battleCode && hasRpl ? remoteUrl : '';
const obj = getVestigeRecStatus(rec);
if (obj.status == VESTIGE_STATUS.COMPLETE) result.push({ ...rec, endTime: obj.time, rplFileUrl });
let gvgFightRecs = { list: result, rplPrefixUrl: getRemoteRplPrefix(pinus.app.get('env')) };
await pushIconShow(roleId, false, gvgFightRecs)
}