Compare commits

..

No commits in common. "ca88b0e490687602b437fba7df8490ca40de5836" and "6dd721bbabe702bc12c0c2381ab25a6d572f9806" have entirely different histories.

2 changed files with 16 additions and 12 deletions

View File

@ -3,7 +3,7 @@
[![Build status](https://github.com/spacemeowx2/s3si.ts/workflows/Build/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/ci.yaml) [![Build status](https://github.com/spacemeowx2/s3si.ts/workflows/Build/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/ci.yaml)
[![Constant check status](https://github.com/spacemeowx2/s3si.ts/workflows/Constant%20Check/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/constant-check.yaml) [![Constant check status](https://github.com/spacemeowx2/s3si.ts/workflows/Constant%20Check/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/constant-check.yaml)
Export your battles from SplatNet to stat.ink and Splashcat. Export your battles from SplatNet to stat.ink.
If you have used s3s, please see [here](#migrate-from-s3s). If you have used s3s, please see [here](#migrate-from-s3s).
@ -17,9 +17,9 @@ If you have used s3s, please see [here](#migrate-from-s3s).
``` ```
Options: 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,splashcat) --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,splashcat") (e.g. "stat.ink,file")
--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,10 +38,6 @@ 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
Splashcat requires battles uploaded to use `en-US` (set with `userLang`). Splashcat will localize battle results into the user's language when displayed.
### Track your rank ### Track your rank
- Run - Run
@ -75,8 +71,7 @@ Splashcat requires battles uploaded to use `en-US` (set with `userLang`). Splash
// 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": "..."
} }
``` ```
@ -100,4 +95,3 @@ Then run `s3si.ts`, and it will work without login prompt.
- https://github.com/frozenpandaman/s3s - https://github.com/frozenpandaman/s3s
- https://github.com/fetus-hina/stat.ink - https://github.com/fetus-hina/stat.ink
- forked from https://github.com/spacemeowx2/s3si.ts

View File

@ -8,6 +8,8 @@ import {
GameExporter, GameExporter,
Nameplate, Nameplate,
PlayerGear, PlayerGear,
StatInkPostBody,
VsHistoryDetail,
VsInfo, VsInfo,
VsPlayer, VsPlayer,
VsTeam, VsTeam,
@ -15,6 +17,8 @@ VsTeam,
import { base64, msgpack, Mutex } from "../../deps.ts"; import { base64, msgpack, Mutex } from "../../deps.ts";
import { APIError } from "../APIError.ts"; import { APIError } from "../APIError.ts";
import { import {
b64Number,
gameId,
parseHistoryDetailId, parseHistoryDetailId,
} from "../utils.ts"; } from "../utils.ts";
import { Env } from "../env.ts"; import { Env } from "../env.ts";
@ -57,7 +61,13 @@ class SplashcatAPI {
body: msgpack.encode(body), body: msgpack.encode(body),
}); });
const json = await resp.json(); const json: unknown = {}//await resp.json().catch(() => ({}));
console.log(json)
// read the body again as text
const text = await resp.text();
console.log(text);
if (resp.status !== 200 && resp.status !== 201) { if (resp.status !== 200 && resp.status !== 201) {
throw new APIError({ throw new APIError({
@ -107,7 +117,7 @@ export class SplashcatExporter implements GameExporter {
} else { } else {
return { return {
status: "skip", status: "skip",
reason: "Splashcat does not support Salmon Run", reason: "Splashcat API does not support Salmon Run",
} }
} }
} }