send challenge data
parent
97a3e45926
commit
a10d97d91d
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* A battle to be uploaded to Splashcat. Any SplatNet 3 strings should use en-US locale.
|
* A battle to be uploaded to Splashcat. Any SplatNet 3 strings should use en-US locale.
|
||||||
* Splashcat will translate strings into the user's langauge.
|
* Splashcat will translate strings into the user's language.
|
||||||
*/
|
*/
|
||||||
export interface SplashcatBattle {
|
export interface SplashcatBattle {
|
||||||
anarchy?: Anarchy;
|
anarchy?: Anarchy;
|
||||||
|
|
@ -9,6 +9,7 @@ export interface SplashcatBattle {
|
||||||
* and manage the award's rank.
|
* and manage the award's rank.
|
||||||
*/
|
*/
|
||||||
awards: string[];
|
awards: string[];
|
||||||
|
challenge?: Challenge;
|
||||||
duration: number;
|
duration: number;
|
||||||
judgement: SplashcatBattleJudgement;
|
judgement: SplashcatBattleJudgement;
|
||||||
knockout?: Knockout;
|
knockout?: Knockout;
|
||||||
|
|
@ -29,11 +30,21 @@ export interface SplashcatBattle {
|
||||||
export interface Anarchy {
|
export interface Anarchy {
|
||||||
mode?: AnarchyMode;
|
mode?: AnarchyMode;
|
||||||
pointChange?: number;
|
pointChange?: number;
|
||||||
|
power?: number;
|
||||||
[property: string]: any;
|
[property: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AnarchyMode = "SERIES" | "OPEN";
|
export type AnarchyMode = "SERIES" | "OPEN";
|
||||||
|
|
||||||
|
export interface Challenge {
|
||||||
|
/**
|
||||||
|
* base64 decoded and split by `-` to get the last section
|
||||||
|
*/
|
||||||
|
id?: string;
|
||||||
|
power?: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
export type SplashcatBattleJudgement = "WIN" | "LOSE" | "DRAW" | "EXEMPTED_LOSE" | "DEEMED_LOSE";
|
export type SplashcatBattleJudgement = "WIN" | "LOSE" | "DRAW" | "EXEMPTED_LOSE" | "DEEMED_LOSE";
|
||||||
|
|
||||||
export type Knockout = "NEITHER" | "WIN" | "LOSE";
|
export type Knockout = "NEITHER" | "WIN" | "LOSE";
|
||||||
|
|
@ -56,7 +67,7 @@ export interface Team {
|
||||||
festUniformBonusRate?: number;
|
festUniformBonusRate?: number;
|
||||||
festUniformName?: string;
|
festUniformName?: string;
|
||||||
isMyTeam: boolean;
|
isMyTeam: boolean;
|
||||||
judgement: TeamJudgement;
|
judgement?: TeamJudgement;
|
||||||
noroshi?: number;
|
noroshi?: number;
|
||||||
order: number;
|
order: number;
|
||||||
paintRatio?: number;
|
paintRatio?: number;
|
||||||
|
|
@ -81,12 +92,15 @@ export interface Player {
|
||||||
/**
|
/**
|
||||||
* Array of badge IDs. Use JSON `null` for empty slots.
|
* Array of badge IDs. Use JSON `null` for empty slots.
|
||||||
*/
|
*/
|
||||||
badges: Array<number | null>;
|
badges: Array<number | null>;
|
||||||
clothingGear: Gear;
|
clothingGear: Gear;
|
||||||
deaths?: number;
|
deaths?: number;
|
||||||
disconnected: boolean;
|
disconnected: boolean;
|
||||||
headGear: Gear;
|
headGear: Gear;
|
||||||
isMe: boolean;
|
isMe: boolean;
|
||||||
|
/**
|
||||||
|
* Should report the same way that SplatNet 3 does (kills + assists)
|
||||||
|
*/
|
||||||
kills?: number;
|
kills?: number;
|
||||||
name: string;
|
name: string;
|
||||||
nameId: string;
|
nameId: string;
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,10 @@ export class SplashcatExporter implements GameExporter {
|
||||||
xBattle: vsDetail.vsMode.mode === "X_MATCH" ? {
|
xBattle: vsDetail.vsMode.mode === "X_MATCH" ? {
|
||||||
xPower: vsDetail.xMatch?.lastXPower ?? undefined,
|
xPower: vsDetail.xMatch?.lastXPower ?? undefined,
|
||||||
} : undefined,
|
} : undefined,
|
||||||
|
challenge: vsDetail.vsMode.mode === "LEAGUE" ? {
|
||||||
|
id: new TextDecoder().decode(base64.decode(vsDetail.leagueMatch?.leagueMatchEvent?.id!)).split("-")[1],
|
||||||
|
power: vsDetail.leagueMatch?.myLeaguePower ?? undefined,
|
||||||
|
} : undefined,
|
||||||
teams: [],
|
teams: [],
|
||||||
awards: vsDetail.awards.map((i) => i.name),
|
awards: vsDetail.awards.map((i) => i.name),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue