✨ feat(战场): 保存战阵连携顺序

This commit is contained in:
luying
2023-08-01 17:20:21 +08:00
parent 07bce370aa
commit f0ab9b0aeb
14 changed files with 102 additions and 33 deletions
+5
View File
@@ -8,6 +8,7 @@ import { DicGVGAreaPoint } from "../pubUtils/dictionary/DicGVGAreaPoint";
import { InitTeamParam, SaveTeamUpdateParam } from "../domain/gvgField/gvgDb";
import { GVGHeroInfo } from "../domain/dbGeneral";
import { GVG_BATTLE_PRE_TIME, GVG_CATAPULT, GVG_ROBOT } from "../consts";
import { Combo } from "../domain/battleField/pvp";
@index({ roleId: 1, index: 1 })
@index({ teamCode: 1 })
@@ -110,6 +111,9 @@ export default class GVGTeam extends BaseModel {
@prop({ required: true, type: () => GVGHeroInfo, _id: false })
lineup: GVGHeroInfo[];
@prop({ required: true, type: () => Combo, _id: false })
combo: Combo[];
@prop({ required: true })
lineupCe: number;
@@ -137,6 +141,7 @@ export default class GVGTeam extends BaseModel {
const teamCode = genCode(8);
const insert = Object.assign(doc.toJSON(), { ...initParam, teamCode });
delete insert.lineup;
delete insert.combo;
const team: GVGTeamType | null = await GVGTeamModel.findOneAndUpdate({ roleId, index }, { $setOnInsert: insert, $set: updateParam }, { upsert: true, new: true }).lean();
return team;
}