Compare commits
2 Commits
425fa1ef73
...
94fb731fe0
| Author | SHA1 | Date |
|---|---|---|
|
|
94fb731fe0 | |
|
|
cb0df39102 |
11
README.md
11
README.md
|
|
@ -3,7 +3,7 @@
|
||||||
[](https://github.com/spacemeowx2/s3si.ts/actions/workflows/ci.yaml)
|
[](https://github.com/spacemeowx2/s3si.ts/actions/workflows/ci.yaml)
|
||||||
[](https://github.com/spacemeowx2/s3si.ts/actions/workflows/constant-check.yaml)
|
[](https://github.com/spacemeowx2/s3si.ts/actions/workflows/constant-check.yaml)
|
||||||
|
|
||||||
Export your battles from SplatNet to stat.ink.
|
Export your battles from SplatNet to stat.ink and Splashcat.
|
||||||
|
|
||||||
If you have used s3s, please see [here](#migrate-from-s3s).
|
If you have used s3s, please see [here](#migrate-from-s3s).
|
||||||
|
|
||||||
|
|
@ -19,7 +19,7 @@ Options:
|
||||||
--profile-path <path>, -p Path to config file (default: ./profile.json)
|
--profile-path <path>, -p Path to config file (default: ./profile.json)
|
||||||
--exporter <exporter>, -e Exporter list to use (default: stat.ink)
|
--exporter <exporter>, -e Exporter list to use (default: stat.ink)
|
||||||
Multiple exporters can be separated by commas
|
Multiple exporters can be separated by commas
|
||||||
(e.g. "stat.ink,file")
|
(e.g. "stat.ink,file,splashcat")
|
||||||
--list-method When set to "latest", the latest 50 matches will be obtained.
|
--list-method When set to "latest", the latest 50 matches will be obtained.
|
||||||
When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches).
|
When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches).
|
||||||
When set to "auto", the latest 50 matches will be obtained. If 50 matches have not been uploaded yet, matches will be obtained from the list of all modes.
|
When set to "auto", the latest 50 matches will be obtained. If 50 matches have not been uploaded yet, matches will be obtained from the list of all modes.
|
||||||
|
|
@ -38,6 +38,10 @@ Options:
|
||||||
- If you want to use a different profile, use `-p` to specify the path to the
|
- If you want to use a different profile, use `-p` to specify the path to the
|
||||||
profile file.
|
profile file.
|
||||||
|
|
||||||
|
### Splashcat Notes
|
||||||
|
|
||||||
|
Due to limitations with SplatNet 3 data, Splashcat requires battles uploaded to use `en-US` (set with `userLang`). Splashcat will localize most parts of battle results into the user's language when displayed.
|
||||||
|
|
||||||
### Track your rank
|
### Track your rank
|
||||||
|
|
||||||
- Run
|
- Run
|
||||||
|
|
@ -71,7 +75,8 @@ Options:
|
||||||
// userLang will effect the language of the exported games to stat.ink
|
// userLang will effect the language of the exported games to stat.ink
|
||||||
"userLang": "zh-CN",
|
"userLang": "zh-CN",
|
||||||
"userCountry": "JP",
|
"userCountry": "JP",
|
||||||
"statInkApiKey": "..."
|
"statInkApiKey": "...",
|
||||||
|
"splashcatApiKey": "..."
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
2
s3si.ts
2
s3si.ts
|
|
@ -29,7 +29,7 @@ Options:
|
||||||
--profile-path <path>, -p Path to config file (default: ./profile.json)
|
--profile-path <path>, -p Path to config file (default: ./profile.json)
|
||||||
--exporter <exporter>, -e Exporter list to use (default: stat.ink)
|
--exporter <exporter>, -e Exporter list to use (default: stat.ink)
|
||||||
Multiple exporters can be separated by commas
|
Multiple exporters can be separated by commas
|
||||||
(e.g. "stat.ink,file")
|
(e.g. "stat.ink,file,splashcat")
|
||||||
--list-method When set to "latest", the latest 50 matches will be obtained.
|
--list-method When set to "latest", the latest 50 matches will be obtained.
|
||||||
When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches).
|
When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches).
|
||||||
When set to "auto", the latest 50 matches will be obtained. If 50 matches have not been uploaded yet, matches will be obtained from the list of all modes.
|
When set to "auto", the latest 50 matches will be obtained. If 50 matches have not been uploaded yet, matches will be obtained from the list of all modes.
|
||||||
|
|
|
||||||
24
src/app.ts
24
src/app.ts
|
|
@ -9,6 +9,7 @@ import { FileExporter } from "./exporters/file.ts";
|
||||||
import { delay, showError } from "./utils.ts";
|
import { delay, showError } from "./utils.ts";
|
||||||
import { GameFetcher } from "./GameFetcher.ts";
|
import { GameFetcher } from "./GameFetcher.ts";
|
||||||
import { DEFAULT_ENV, Env } from "./env.ts";
|
import { DEFAULT_ENV, Env } from "./env.ts";
|
||||||
|
import { SplashcatExporter } from "./exporters/splashcat.ts";
|
||||||
|
|
||||||
export type Opts = {
|
export type Opts = {
|
||||||
profilePath: string;
|
profilePath: string;
|
||||||
|
|
@ -220,6 +221,29 @@ export class App {
|
||||||
out.push(new FileExporter(state.fileExportPath));
|
out.push(new FileExporter(state.fileExportPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (exporters.includes("splashcat")) {
|
||||||
|
if (!state.splashcatApiKey) {
|
||||||
|
const key = (await this.env.prompts.prompt(
|
||||||
|
"Splashcat API key is not set. Please enter below.",
|
||||||
|
)).trim();
|
||||||
|
if (!key) {
|
||||||
|
this.env.logger.error("API key is required.");
|
||||||
|
Deno.exit(1);
|
||||||
|
}
|
||||||
|
await this.profile.writeState({
|
||||||
|
...state,
|
||||||
|
splashcatApiKey: key,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
out.push(
|
||||||
|
new SplashcatExporter({
|
||||||
|
splashcatApiKey: this.profile.state.splashcatApiKey!,
|
||||||
|
uploadMode: this.opts.monitor ? "Monitoring" : "Manual",
|
||||||
|
env: this.env,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
exporterProgress(title: string) {
|
exporterProgress(title: string) {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ export type State = {
|
||||||
statInkApiKey?: string;
|
statInkApiKey?: string;
|
||||||
fileExportPath: string;
|
fileExportPath: string;
|
||||||
monitorInterval: number;
|
monitorInterval: number;
|
||||||
|
splashcatApiKey?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DEFAULT_STATE: State = {
|
export const DEFAULT_STATE: State = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue