✨ feat(gvg): 激战期接口详细返回

This commit is contained in:
luying
2023-02-17 10:59:38 +08:00
parent ab0b7aa9ae
commit 26832196b6
14 changed files with 917 additions and 214 deletions
+28 -27
View File
@@ -1,4 +1,4 @@
import { GVGTeamType, GVGTeamUpdate } from "../../db/GVGTeam";
import GVGTeam, { GVGTeamType } from "../../db/GVGTeam";
// 积分点分类统计,1-3级积分点代表从小到大
export class LeagueCityPoint {
@@ -20,42 +20,43 @@ export class LeagueCityPoint {
}
// 队伍状态
export class GVGTeamMem implements GVGTeamUpdate {
roleId: string; // 玩家id
id: number;
teamCode: string;
teamId: number;
leagueCode: string;
guildCode: string;
areaId: number;
cityId: number;
pointId: number;
head: number;
spine: number;
frame: number;
durability: number;
restartTime: number;
attackTime: number;
defenseTime: number;
startMoveTime: number;
stopMoveTime: number;
export class GVGTeamMem extends GVGTeam {
isMoving: boolean;
point: number;
constructor(team: GVGTeamType) {
for(let key in team) {
this[key] = team[key];
}
super();
this.roleId = team.roleId;
this.roleName = team.roleName;
this.serverId = team.serverId;
this.teamCode = team.teamCode;
this.teamId = team.teamId;
this.leagueCode = team.leagueCode;
this.guildCode = team.guildCode;
this.areaId = team.areaId;
this.fromAreaId = team.fromAreaId;
this.cityId = team.cityId;
this.pointId = team.pointId;
this.head = team.head;
this.spine = team.spine;
this.frame = team.frame;
this.durability = team.durability;
this.restartTime = team.restartTime;
this.attackTime = team.attackTime;
this.defenseTime = team.defenseTime;
this.startMoveTime = team.startMoveTime;
this.stopMoveTime = team.stopMoveTime;
this.point = team.point;
}
public setCity(cityId: number, areaId = 0) {
public setCity(cityId: number, areaId = 0, pointId = 0) {
this.cityId = cityId;
this.areaId = areaId;
this.pointId = 0;
this.pointId = pointId;
}
public moveToArea(areaId: number, startMoveTime: number, stopMoveTime: number) {
public moveToArea(areaId: number, fromAreaId: number, startMoveTime: number, stopMoveTime: number) {
this.areaId = areaId;
this.fromAreaId = fromAreaId;
this.startMoveTime = startMoveTime;
this.stopMoveTime = stopMoveTime;
}
+91 -1
View File
@@ -11,6 +11,9 @@ import { DicWarJson } from "../../pubUtils/dictionary/DicWarJson";
import { gameData } from "../../pubUtils/data";
import { HeroType } from "../../db/Hero";
import { RoleRankInfo } from "../rank";
import { GVGCityType } from "../../db/GVGCity";
import { GVGTeamMem } from "../battleField/gvgBattle";
import { GVGTeamType } from "../../db/GVGTeam";
class LeagueLeaderInfo {
name: string; // 盟主名
@@ -257,7 +260,6 @@ export class LeagueMemberListInfo {
this.serverName = serverNames[role.serverId];
this.ce = role.ce;
this.quitTime = role.quitTime;
this.isOnline = role.quitTime == role.loginTime;
}
setByUserData(data: GVGUserDataType) {
@@ -269,6 +271,10 @@ export class LeagueMemberListInfo {
setAuth(auth: number) {
this.auth = auth;
}
setOnline(isOnline: boolean) {
this.isOnline = isOnline;
}
}
export class LeagueMemberContributeInfo extends LeagueMemberListInfo{
@@ -588,4 +594,88 @@ export class VestigeRank {
this.lineupCe = 0;
this.score = 0;
}
}
// 大地图上城池占林
export class GVGCityMapInfo {
cityId: number; // 城池id
guardLeagueCode: string; // 驻守城池的联军id
guardLeagueName: string; // 驻守这个城池的联军
guardLeagueIcon: number; // 驻守这个城池的联军的icon
teamCnt: number; // 我方队伍数量
constructor(city: GVGCityType, teamCnt: number) {
if(!city) return;
this.cityId = city.cityId;
this.guardLeagueCode = city.guardLeague;
this.guardLeagueName = city.guardLeagueName;
this.guardLeagueIcon = city.guardLeagueIcon;
this.teamCnt = teamCnt;
}
}
export class GVGTeamSpineInMap {
spine: number = 0;
roleName: string = '';
serverName: string = '';
startMoveTime: number = 0;
stopMoveTime: number = 0;
isMoving: boolean = false;
pointId: number = 0;
fromAreaId: number = 0;
constructor(obj: GVGTeamMem, serverNames: {[serverId: string]: string}) {
this.spine = obj.spine;
this.roleName = obj.roleName;
if(obj.serverId) this.serverName = serverNames[obj.serverId];
this.startMoveTime = obj.startMoveTime;
this.stopMoveTime = obj.stopMoveTime;
this.isMoving = nowSeconds() < this.stopMoveTime;
this.pointId = obj.pointId;
this.fromAreaId = obj.fromAreaId;
}
}
export class GVGAreaInMap {
areaId: number;
spines: GVGTeamSpineInMap[] = [];
}
// 地图右边列表上的队伍信息
export class GVGTeamInList {
teamCode: string;
roleName: string;
head: number;
frame: number;
lineupCe: number;
leagueCode: string;
leagueName: string;
durability: number; // 耐久
maxDurability: number; // 最大耐久
constructor(team: GVGTeamType) {
if(!team) return;
this.teamCode = team.teamCode;
this.roleName = team.roleName;
this.head = team.head;
this.frame = team.frame;
this.lineupCe = team.lineupCe;
this.leagueCode = team.leagueCode;
this.leagueName = team.leagueName;
this.durability = team.durability;
this.maxDurability = team.maxDurability;
}
}
export class GVGTeamInListOnPoint extends GVGTeamInList {
pointId: number; // 积分点
hasTeam: boolean; // 是否有队伍占领
isRobot: boolean; // 这个队伍是不是擂台守卫者
constructor(pointId: number, hasTeam: boolean, team?: GVGTeamType) {
super(team);
this.pointId = pointId;
this.hasTeam = hasTeam;
if(team) this.isRobot = team.isRobot;
}
}