fix: FEST upload failed

main
spacemeowx2 2022-11-02 04:00:55 +08:00
parent a20c1165ec
commit b6a7a91c6d
3 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,7 @@
0.1.14
fix: FEST upload failed
0.1.13
feat: auto track after promotion challenge success

View File

@ -1,7 +1,7 @@
import type { StatInkPostBody, VsHistoryDetail } from "./types.ts";
export const AGENT_NAME = "s3si.ts";
export const S3SI_VERSION = "0.1.13";
export const S3SI_VERSION = "0.1.14";
export const NSOAPP_VERSION = "2.3.1";
export const WEB_VIEW_VERSION = "1.0.0-5644e7a2";
export const S3SI_LINK = "https://github.com/spacemeowx2/s3si.ts";

View File

@ -56,9 +56,12 @@ export class StatInkExporter implements GameExporter {
"Authorization": `Bearer ${this.statInkApiKey}`,
};
}
isTriColor({ vsMode }: VsHistoryDetail): boolean {
return vsMode.mode === "FEST" && b64Number(vsMode.id) === 8;
}
async exportGame(game: VsInfo | CoopInfo) {
if (game.type === "CoopInfo") {
// TODO: support coop
if (game.type === "CoopInfo" || (this.isTriColor(game.detail))) {
// TODO: support coop and tri-color fest
return {};
}
const body = await this.mapBattle(game);
@ -130,11 +133,13 @@ export class StatInkExporter implements GameExporter {
} else if (vsMode === "PRIVATE") {
return "private";
} else if (vsMode === "FEST") {
const modeId = b64Number(vsDetail.id);
const modeId = b64Number(vsDetail.vsMode.id);
if (modeId === 6) {
return "splatfest_open";
} else if (modeId === 7) {
return "splatfest_challenge";
} else if (modeId === 8) {
throw new Error("Tri-color battle is not supported");
}
}