🎈 perf(dispatch): 路由使用redis
This commit is contained in:
@@ -4,8 +4,9 @@ import { pinus } from "pinus";
|
||||
import { GVG_CATAPULT, GVG_PERIOD } from "../../consts";
|
||||
import { GVGTeamModel, GVGTeamType } from "../../db/GVGTeam";
|
||||
import { GVGTeamMem } from "../../domain/battleField/gvgBattle";
|
||||
import { dispatch } from "../../util/dispatcher";
|
||||
import { dispatch } from "../../pubUtils/dispatcher";
|
||||
import { getGVGPeriodData } from "./gvgService";
|
||||
import { redisClient } from "../redisService";
|
||||
|
||||
// 积分点占领情况,groupId_serverType_cityId -> GVGBattleData
|
||||
const gvgBattleMap: Map<string, GVGBattleData> = new Map();
|
||||
@@ -244,7 +245,7 @@ export async function initTeamToMem() {
|
||||
let teams = await GVGTeamModel.findByConfigId(configId);
|
||||
for(let team of teams) {
|
||||
if(team.isBroken) continue;
|
||||
if(dispatch(team.cityId.toString(), servers)?.id == sid) {
|
||||
if((await dispatch(redisClient(), team.cityId.toString(), servers, 'guild'))?.id == sid) {
|
||||
let teamObj = getGVGBattleData(team.groupKey);
|
||||
teamObj.enterCity(team);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user