feat: Big Run (#50)
* style: less indents * feat: add basic big run support * feat: add skip big run for nowmain
parent
751de398b0
commit
235391f002
|
|
@ -278,6 +278,14 @@ export class StatInkExporter implements GameExporter {
|
||||||
url,
|
url,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
if (game.detail.rule !== "REGULAR") {
|
||||||
|
return {
|
||||||
|
status: "skip",
|
||||||
|
reason:
|
||||||
|
`This salmon run rule is not supported yet: ${game.detail.rule}`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const body = await this.mapCoop(game);
|
const body = await this.mapCoop(game);
|
||||||
const { url } = await this.api.postCoop(body);
|
const { url } = await this.api.postCoop(body);
|
||||||
|
|
||||||
|
|
@ -776,7 +784,7 @@ export class StatInkExporter implements GameExporter {
|
||||||
const result: StatInkCoopPostBody = {
|
const result: StatInkCoopPostBody = {
|
||||||
uuid: await gameId(detail.id),
|
uuid: await gameId(detail.id),
|
||||||
private: groupInfo?.mode === "PRIVATE_CUSTOM" ? "yes" : "no",
|
private: groupInfo?.mode === "PRIVATE_CUSTOM" ? "yes" : "no",
|
||||||
big_run: "no",
|
big_run: detail.rule === "BIG_RUN" ? "yes" : "no",
|
||||||
stage: b64Number(detail.coopStage.id).toString(),
|
stage: b64Number(detail.coopStage.id).toString(),
|
||||||
danger_rate: dangerRate * 100,
|
danger_rate: dangerRate * 100,
|
||||||
clear_waves,
|
clear_waves,
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ export type CoopHistoryGroup = {
|
||||||
jobScore: number;
|
jobScore: number;
|
||||||
};
|
};
|
||||||
mode: "PRIVATE_CUSTOM" | "REGULAR";
|
mode: "PRIVATE_CUSTOM" | "REGULAR";
|
||||||
rule: "REGULAR";
|
rule: "REGULAR" | "BIG_RUN";
|
||||||
|
|
||||||
historyDetails: {
|
historyDetails: {
|
||||||
nodes: CoopListNode[];
|
nodes: CoopListNode[];
|
||||||
|
|
@ -276,7 +276,7 @@ export type CoopHistoryDetail = {
|
||||||
name: string;
|
name: string;
|
||||||
id: string;
|
id: string;
|
||||||
};
|
};
|
||||||
rule: "REGULAR";
|
rule: "REGULAR" | "BIG_RUN";
|
||||||
myResult: CoopHistoryPlayerResult;
|
myResult: CoopHistoryPlayerResult;
|
||||||
memberResults: CoopHistoryPlayerResult[];
|
memberResults: CoopHistoryPlayerResult[];
|
||||||
bossResult: null | {
|
bossResult: null | {
|
||||||
|
|
@ -690,7 +690,7 @@ export type StatInkCoopPostBody = {
|
||||||
test?: "yes" | "no";
|
test?: "yes" | "no";
|
||||||
uuid: string;
|
uuid: string;
|
||||||
private: "yes" | "no";
|
private: "yes" | "no";
|
||||||
big_run: "no";
|
big_run: "yes" | "no";
|
||||||
stage: string;
|
stage: string;
|
||||||
// [0, 333]
|
// [0, 333]
|
||||||
danger_rate: number;
|
danger_rate: number;
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,14 @@ import { base64 } from "../deps.ts";
|
||||||
import { assertEquals } from "../dev_deps.ts";
|
import { assertEquals } from "../dev_deps.ts";
|
||||||
import { gameId, s3sCoopGameId } from "./utils.ts";
|
import { gameId, s3sCoopGameId } from "./utils.ts";
|
||||||
|
|
||||||
|
const VS_ID =
|
||||||
|
`VsHistoryDetail-asdf:asdf:20220101T012345_12345678-abcd-1234-5678-0123456789ab`;
|
||||||
const COOP_ID =
|
const COOP_ID =
|
||||||
`CoopHistoryDetail-u-asdf:20220101T012345_12345678-abcd-1234-5678-0123456789ab`;
|
`CoopHistoryDetail-u-asdf:20220101T012345_12345678-abcd-1234-5678-0123456789ab`;
|
||||||
|
|
||||||
Deno.test("gameId", async () => {
|
Deno.test("gameId", async () => {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
await gameId(
|
await gameId(base64.encode(VS_ID)),
|
||||||
base64.encode(
|
|
||||||
`VsHistoryDetail-asdf:asdf:20220101T012345_12345678-abcd-1234-5678-0123456789ab`,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
"042bcac9-6b25-5d2e-a5ea-800939a6dea1",
|
"042bcac9-6b25-5d2e-a5ea-800939a6dea1",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -23,5 +21,8 @@ Deno.test("gameId", async () => {
|
||||||
|
|
||||||
Deno.test("s3sCoopGameId", async () => {
|
Deno.test("s3sCoopGameId", async () => {
|
||||||
const S3S_COOP_UUID = "be4435b1-0ac5-577b-81bb-766585bec028";
|
const S3S_COOP_UUID = "be4435b1-0ac5-577b-81bb-766585bec028";
|
||||||
assertEquals(await s3sCoopGameId(base64.encode(COOP_ID)), S3S_COOP_UUID);
|
assertEquals(
|
||||||
|
await s3sCoopGameId(base64.encode(COOP_ID)),
|
||||||
|
S3S_COOP_UUID,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue