🐞 fix(gvg): 玩家贡献更新下发推送
This commit is contained in:
@@ -204,4 +204,5 @@ export const PUSH_ROUTE = {
|
||||
GVG_PLAYER_LEAVE_AREA: 'onPlayerLeaveArea', // 积分点上的驻守人变更
|
||||
GVG_CITY_RANK_UPDATE: 'onGVGCityRankUpdate', // 城池积分排名
|
||||
GVG_SPINE_ATTACKED: 'onSpinesAttacked', // 4.7 队伍在地图上受到攻击
|
||||
GVG_CONTRIBUTE_UPDATE: 'onGVGContributeUpdate', // 贡献更新
|
||||
}
|
||||
@@ -115,9 +115,12 @@ export default class GVGUserData extends BaseModel {
|
||||
}
|
||||
|
||||
public static async addVestigeScores(configId: number, memberScores: { leagueCode: string, roleId: string, score: number }[]) {
|
||||
await GVGUserDataModel.bulkWrite(memberScores.map(({ leagueCode, roleId, score }) => {
|
||||
return { updateOne: { filter: { configId, leagueCode, roleId }, update: { $inc: { 'contribute.score': score } } } }
|
||||
}));
|
||||
let result: GVGUserDataType[] = [];
|
||||
for(let { leagueCode, roleId, score } of memberScores) {
|
||||
let data: GVGUserDataType = await GVGUserDataModel.findOneAndUpdate({ configId, leagueCode, roleId }, { $inc: { 'contribute.score': score } }, { new: true }).lean();
|
||||
if(data) result.push(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async receiveBox(configId: number, leagueCode: string, roleId: string, boxId: number) {
|
||||
|
||||
Reference in New Issue
Block a user