mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-02 08:07:40 -05:00
Extract @sendou/utils, @sendou/build-analyzer, @sendou/map-list-generator and @sendou/scanner-core workspace packages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const badgeId = process.argv[2]?.trim();
|
||||
const discordIds = process.argv[3]?.trim();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import * as BadgeRepository from "~/features/badges/BadgeRepository.server";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const code = process.argv[2]?.trim();
|
||||
const displayName = process.argv[3]?.trim();
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { ADMIN_ID } from "~/features/admin/admin-constants";
|
||||
import { userAsyncLocalStorage } from "~/features/auth/core/user-context.server";
|
||||
import * as LeaderboardRepository from "~/features/leaderboards/LeaderboardRepository.server";
|
||||
@@ -5,8 +7,6 @@ import * as Seasons from "~/features/mmr/core/Seasons";
|
||||
import * as TournamentTeamRepository from "~/features/tournament/TournamentTeamRepository.server";
|
||||
import { tournamentFromDB } from "~/features/tournament-bracket/core/Tournament.server";
|
||||
import * as UserRepository from "~/features/user-page/UserRepository.server";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const tournamentIdArg = process.argv[2]?.trim();
|
||||
const placementsArg = process.argv[3]?.trim();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { roundToNDecimalPlaces } from "@sendou/utils/number";
|
||||
import { userAsyncLocalStorage } from "~/features/auth/core/user-context.server";
|
||||
import * as UserRepository from "~/features/user-page/UserRepository.server";
|
||||
import { logger } from "~/utils/logger";
|
||||
import { roundToNDecimalPlaces } from "~/utils/number";
|
||||
import { type BenchmarkCase, buildCases } from "./benchmark-db/cases";
|
||||
import { resolveFixtures } from "./benchmark-db/fixtures";
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ import type {
|
||||
ModeShort,
|
||||
StageId,
|
||||
} from "@sendou/in-game-lists/types";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { sub } from "date-fns";
|
||||
import { sql } from "kysely";
|
||||
import { db } from "~/db/sql";
|
||||
import type { Tables } from "~/db/tables";
|
||||
import type { SkillTeamIdentifier } from "~/features/mmr/mmr-utils";
|
||||
import { databaseTimestampToDate } from "~/utils/dates";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
export interface Fixtures {
|
||||
heavyUser: { id: number; identifier: string } | null;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// validates all articles files in the project are following the correct .md + grey matter format
|
||||
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { mostRecentArticles } from "~/features/articles/core/list.server";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
async function main() {
|
||||
await mostRecentArticles(1000);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import * as Seasons from "~/features/mmr/core/Seasons";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const rawNth = process.argv[2]?.trim();
|
||||
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import type {
|
||||
BaseWeaponStats,
|
||||
MainWeaponParams,
|
||||
ParamsJson,
|
||||
SubWeaponParams,
|
||||
WeaponKit,
|
||||
} from "@sendou/build-analyzer/analyzer-types";
|
||||
import type {
|
||||
MainWeaponId,
|
||||
SpecialWeaponId,
|
||||
@@ -13,16 +20,9 @@ import {
|
||||
subWeaponIds,
|
||||
weaponIdToBaseWeaponId,
|
||||
} from "@sendou/in-game-lists/weapon-ids";
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { z } from "zod";
|
||||
import type {
|
||||
BaseWeaponStats,
|
||||
MainWeaponParams,
|
||||
ParamsJson,
|
||||
SubWeaponParams,
|
||||
WeaponKit,
|
||||
} from "~/features/build-analyzer/analyzer-types";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
import {
|
||||
LANG_JSONS_TO_CREATE,
|
||||
loadLangDicts,
|
||||
|
||||
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { brandIds } from "@sendou/in-game-lists/brand-ids";
|
||||
import invariant from "~/utils/invariant";
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import {
|
||||
LANG_JSONS_TO_CREATE,
|
||||
loadGearInfoClothes,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// for testing use the command `pnpm exec vite-node ./scripts/create-league-divisions.ts 6 'https://gist.githubusercontent.com/sendou-ink/38aa4d5d8426035ce178c09598ae627f/raw/17be9bb53a9f017c2097d0624f365d1c5a029f01/league.csv'`
|
||||
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { z } from "zod";
|
||||
import { db } from "~/db/sql";
|
||||
import { ADMIN_ID } from "~/features/admin/admin-constants";
|
||||
@@ -8,8 +10,6 @@ import * as TournamentTeamRepository from "~/features/tournament/TournamentTeamR
|
||||
import type { Tournament } from "~/features/tournament-bracket/core/Tournament";
|
||||
import { tournamentFromDB } from "~/features/tournament-bracket/core/Tournament.server";
|
||||
import { dateToDatabaseTimestamp } from "~/utils/dates";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const tournamentId = Number(process.argv[2]?.trim());
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { abilitiesShort } from "@sendou/in-game-lists/abilities";
|
||||
import { brandIds } from "@sendou/in-game-lists/brand-ids";
|
||||
import invariant from "~/utils/invariant";
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import {
|
||||
LANG_JSONS_TO_CREATE,
|
||||
loadLangDicts,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const rawId = process.argv[2]?.trim();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const discordId = process.argv[2]?.trim();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const discordId = process.argv[2]?.trim();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
async function main() {
|
||||
const name = process.argv[2]?.trim();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import * as Seasons from "~/features/mmr/core/Seasons";
|
||||
import { dateToDatabaseTimestamp } from "~/utils/dates";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const discordId = process.argv[2]?.trim();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
// you need at least 150 average monthly active players to be considered established
|
||||
// if you drop below 100 you lose it
|
||||
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
interface MonthData {
|
||||
year: number;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { MainWeaponId } from "@sendou/in-game-lists/types";
|
||||
import { mainWeaponIds } from "@sendou/in-game-lists/weapon-ids";
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import * as BadgeRepository from "~/features/badges/BadgeRepository.server";
|
||||
import * as BuildRepository from "~/features/builds/BuildRepository.server";
|
||||
import * as XRankPlacementRepository from "~/features/top-search/XRankPlacementRepository.server";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
import { xRankSchema } from "./schemas";
|
||||
|
||||
const rawJsonNumber = process.argv[2]?.trim();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const id = process.argv[2]?.trim();
|
||||
const newName = process.argv[3]?.trim();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { logger } from "~/utils/logger";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { loadWeaponInfoMain } from "./utils";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
|
||||
@@ -13,30 +13,26 @@
|
||||
*/
|
||||
import { mkdirSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { loadOpenCV, type Mat } from "../../app/features/scanner/core/cv";
|
||||
import { loadOpenCV, type Mat } from "@sendou/scanner-core/cv";
|
||||
import {
|
||||
TAG_NAME_INNER,
|
||||
TAG_NAME_OUTER,
|
||||
TAG_NAME_TEXT_HEIGHT,
|
||||
TAG_TILT_DEG,
|
||||
} from "../../app/features/scanner/core/detectors/death/rois";
|
||||
} from "@sendou/scanner-core/detectors/death/rois";
|
||||
import {
|
||||
nameRoi,
|
||||
paintRoi,
|
||||
ROW_CENTERS,
|
||||
statRoi,
|
||||
TEAM_SCORE_ROIS,
|
||||
} from "../../app/features/scanner/core/detectors/scoreboard/rois";
|
||||
} from "@sendou/scanner-core/detectors/scoreboard/rois";
|
||||
import {
|
||||
CODE_TEXT_HEIGHT,
|
||||
REPLAY_CODE_ROI,
|
||||
} from "../../app/features/scanner/core/detectors/scoreboard-battle-log-replay/rois";
|
||||
import type { AtlasMeta } from "../../app/features/scanner/core/glyphs";
|
||||
import {
|
||||
normalizeFrame,
|
||||
type Roi,
|
||||
toMat,
|
||||
} from "../../app/features/scanner/core/image";
|
||||
} from "@sendou/scanner-core/detectors/scoreboard-battle-log-replay/rois";
|
||||
import type { AtlasMeta } from "@sendou/scanner-core/glyphs";
|
||||
import { normalizeFrame, type Roi, toMat } from "@sendou/scanner-core/image";
|
||||
import { SCANNER_ASSETS_DIR } from "../../app/features/scanner/node/assets-dir";
|
||||
import { FIXTURES_DIR } from "../../app/features/scanner/node/fixtures";
|
||||
import { readImage, writePng } from "../../app/features/scanner/node/image-io";
|
||||
|
||||
@@ -24,16 +24,16 @@ import { createCanvas, GlobalFonts } from "@napi-rs/canvas";
|
||||
import {
|
||||
DEATH_MESSAGE_TEMPLATES,
|
||||
LOCALIZED_WEAPON_NAMES,
|
||||
} from "../../app/features/scanner/core/detectors/death/localized-messages";
|
||||
import { ALL_WEAPON_ENTRIES } from "../../app/features/scanner/core/detectors/death/weapon-names";
|
||||
import type { AtlasMeta } from "../../app/features/scanner/core/glyphs";
|
||||
} from "@sendou/scanner-core/detectors/death/localized-messages";
|
||||
import { ALL_WEAPON_ENTRIES } from "@sendou/scanner-core/detectors/death/weapon-names";
|
||||
import type { AtlasMeta } from "@sendou/scanner-core/glyphs";
|
||||
import {
|
||||
ALL_LOBBY_ENTRIES,
|
||||
ALL_MODE_ENTRIES,
|
||||
ALL_MODE_LABELS,
|
||||
ALL_STAGE_ENTRIES,
|
||||
RESULT_TAG_ENTRIES,
|
||||
} from "../../app/features/scanner/core/localized";
|
||||
} from "@sendou/scanner-core/localized";
|
||||
import { SCANNER_ASSETS_DIR } from "../../app/features/scanner/node/assets-dir";
|
||||
import { readImage, writePng } from "../../app/features/scanner/node/image-io";
|
||||
import { readFontCoverage } from "./otf-cmap";
|
||||
|
||||
@@ -29,19 +29,19 @@ import { readdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { stageIds } from "@sendou/in-game-lists/stage-ids";
|
||||
import type { ModeShort, StageId } from "@sendou/in-game-lists/types";
|
||||
import { ALL_WEAPON_ENTRIES } from "../../app/features/scanner/core/detectors/death/weapon-names";
|
||||
import type { ScannerLobby } from "../../app/features/scanner/scanner-types";
|
||||
import { ALL_WEAPON_ENTRIES } from "@sendou/scanner-core/detectors/death/weapon-names";
|
||||
import type { ScannerLobby } from "@sendou/scanner-core/scanner-types";
|
||||
import gameMisc from "../../locales/en/game-misc.json";
|
||||
|
||||
const SPLAT3_DIR =
|
||||
process.argv[2] ?? new URL("../../../splat3", import.meta.url).pathname;
|
||||
const LANG_DIR = join(SPLAT3_DIR, "data", "language");
|
||||
const OUT_ENTRIES = new URL(
|
||||
"../../app/features/scanner/core/localized-entries.ts",
|
||||
"@sendou/scanner-core/localized-entries.ts",
|
||||
import.meta.url,
|
||||
).pathname;
|
||||
const OUT_MESSAGES = new URL(
|
||||
"../../app/features/scanner/core/detectors/death/localized-messages.ts",
|
||||
"@sendou/scanner-core/detectors/death/localized-messages.ts",
|
||||
import.meta.url,
|
||||
).pathname;
|
||||
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
*/
|
||||
import { mkdirSync, readdirSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { loadOpenCV } from "../../app/features/scanner/core/cv";
|
||||
import { loadOpenCV } from "@sendou/scanner-core/cv";
|
||||
import {
|
||||
PLANNER_SIG_H,
|
||||
PLANNER_SIG_W,
|
||||
type PlannerManifest,
|
||||
plannerSignature,
|
||||
} from "../../app/features/scanner/core/detectors/minimap/stage";
|
||||
} from "@sendou/scanner-core/detectors/minimap/stage";
|
||||
import {
|
||||
type FrameData,
|
||||
normalizeFrame,
|
||||
toMat,
|
||||
} from "../../app/features/scanner/core/image";
|
||||
} from "@sendou/scanner-core/image";
|
||||
import { SCANNER_ASSETS_DIR } from "../../app/features/scanner/node/assets-dir";
|
||||
import { readImage, writePng } from "../../app/features/scanner/node/image-io";
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
*/
|
||||
import { mkdirSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { loadOpenCV } from "../../app/features/scanner/core/cv";
|
||||
import { loadOpenCV } from "@sendou/scanner-core/cv";
|
||||
import {
|
||||
cropRoi,
|
||||
matToFrameData,
|
||||
normalizeFrame,
|
||||
toMat,
|
||||
} from "../../app/features/scanner/core/image";
|
||||
} from "@sendou/scanner-core/image";
|
||||
import { readImage, writePng } from "../../app/features/scanner/node/image-io";
|
||||
|
||||
const [imagePath, outDir, ...specs] = process.argv.slice(2);
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
* Draw all scoreboard ROIs on a (normalized) frame for visual calibration.
|
||||
* Usage: vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/overlay-rois.ts <image> [out.png] [scoreboard|scoreboard-battle-log-replay|scoreboard-battle-log]
|
||||
*/
|
||||
import { loadOpenCV, type Mat } from "../../app/features/scanner/core/cv";
|
||||
import * as death from "../../app/features/scanner/core/detectors/death/rois";
|
||||
import * as mapStart from "../../app/features/scanner/core/detectors/map-start/rois";
|
||||
import * as minimap from "../../app/features/scanner/core/detectors/minimap/rois";
|
||||
import * as sb from "../../app/features/scanner/core/detectors/scoreboard/rois";
|
||||
import * as bl from "../../app/features/scanner/core/detectors/scoreboard-battle-log/rois";
|
||||
import * as replay from "../../app/features/scanner/core/detectors/scoreboard-battle-log-replay/rois";
|
||||
import { loadOpenCV, type Mat } from "@sendou/scanner-core/cv";
|
||||
import * as death from "@sendou/scanner-core/detectors/death/rois";
|
||||
import * as mapStart from "@sendou/scanner-core/detectors/map-start/rois";
|
||||
import * as minimap from "@sendou/scanner-core/detectors/minimap/rois";
|
||||
import * as sb from "@sendou/scanner-core/detectors/scoreboard/rois";
|
||||
import * as bl from "@sendou/scanner-core/detectors/scoreboard-battle-log/rois";
|
||||
import * as replay from "@sendou/scanner-core/detectors/scoreboard-battle-log-replay/rois";
|
||||
import {
|
||||
matToFrameData,
|
||||
normalizeFrame,
|
||||
type Roi,
|
||||
toMat,
|
||||
} from "../../app/features/scanner/core/image";
|
||||
} from "@sendou/scanner-core/image";
|
||||
import { readImage, writePng } from "../../app/features/scanner/node/image-io";
|
||||
|
||||
const [imagePath, outPath = "roi-overlay.png", detector = "scoreboard"] =
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
*/
|
||||
import { readdirSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { loadOpenCV } from "../../app/features/scanner/core/cv";
|
||||
import { MAP_START_EVENT_TYPE } from "../../app/features/scanner/core/detectors/map-start/index";
|
||||
import { loadOpenCV } from "@sendou/scanner-core/cv";
|
||||
import { MAP_START_EVENT_TYPE } from "@sendou/scanner-core/detectors/map-start/index";
|
||||
import {
|
||||
createAllDetectors,
|
||||
SCOREBOARD_EVENT_TYPES,
|
||||
} from "../../app/features/scanner/core/detectors/registry";
|
||||
import { DetectorScheduler } from "../../app/features/scanner/core/detectors/scheduler";
|
||||
import { normalizeFrame, toMat } from "../../app/features/scanner/core/image";
|
||||
} from "@sendou/scanner-core/detectors/registry";
|
||||
import { DetectorScheduler } from "@sendou/scanner-core/detectors/scheduler";
|
||||
import { normalizeFrame, toMat } from "@sendou/scanner-core/image";
|
||||
import { readImage } from "../../app/features/scanner/node/image-io";
|
||||
import { loadScoreboardResources } from "../../app/features/scanner/node/resources";
|
||||
|
||||
|
||||
@@ -7,30 +7,30 @@
|
||||
*
|
||||
* Usage: pnpm scanner:report
|
||||
*/
|
||||
import { loadOpenCV } from "../../app/features/scanner/core/cv";
|
||||
import { loadOpenCV } from "@sendou/scanner-core/cv";
|
||||
import {
|
||||
createDeathDetector,
|
||||
type DeathData,
|
||||
} from "../../app/features/scanner/core/detectors/death/index";
|
||||
} from "@sendou/scanner-core/detectors/death/index";
|
||||
import {
|
||||
createMapStartDetector,
|
||||
type MapStartData,
|
||||
} from "../../app/features/scanner/core/detectors/map-start/index";
|
||||
} from "@sendou/scanner-core/detectors/map-start/index";
|
||||
import {
|
||||
createMinimapDetector,
|
||||
type MinimapData,
|
||||
} from "../../app/features/scanner/core/detectors/minimap/index";
|
||||
import { createScoreboardDetector } from "../../app/features/scanner/core/detectors/scoreboard/index";
|
||||
import { createScoreboardBattleLogDetector } from "../../app/features/scanner/core/detectors/scoreboard-battle-log/index";
|
||||
} from "@sendou/scanner-core/detectors/minimap/index";
|
||||
import { createScoreboardDetector } from "@sendou/scanner-core/detectors/scoreboard/index";
|
||||
import { createScoreboardBattleLogDetector } from "@sendou/scanner-core/detectors/scoreboard-battle-log/index";
|
||||
import {
|
||||
createScoreboardBattleLogReplayDetector,
|
||||
type ScoreboardBattleLogReplayData,
|
||||
} from "../../app/features/scanner/core/detectors/scoreboard-battle-log-replay/index";
|
||||
} from "@sendou/scanner-core/detectors/scoreboard-battle-log-replay/index";
|
||||
import {
|
||||
createScoreboardOwnDetector,
|
||||
type ScoreboardOwnData,
|
||||
} from "../../app/features/scanner/core/detectors/scoreboard-own/index";
|
||||
import type { Detector } from "../../app/features/scanner/core/detectors/types";
|
||||
} from "@sendou/scanner-core/detectors/scoreboard-own/index";
|
||||
import type { Detector } from "@sendou/scanner-core/detectors/types";
|
||||
import {
|
||||
loadFixtures,
|
||||
runDetectorOnFixture,
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*
|
||||
* Usage: pnpm scanner:fixtures [case-name-substring]
|
||||
*/
|
||||
import { loadOpenCV } from "../../app/features/scanner/core/cv";
|
||||
import { loadOpenCV } from "@sendou/scanner-core/cv";
|
||||
import {
|
||||
createScoreboardDetector,
|
||||
type ScoreboardRowDebug,
|
||||
} from "../../app/features/scanner/core/detectors/scoreboard/index";
|
||||
} from "@sendou/scanner-core/detectors/scoreboard/index";
|
||||
import {
|
||||
loadFixtures,
|
||||
runDetectorOnFixture,
|
||||
|
||||
@@ -17,23 +17,23 @@
|
||||
import { spawn } from "node:child_process";
|
||||
import { writeFileSync } from "node:fs";
|
||||
import { basename } from "node:path";
|
||||
import { loadOpenCV } from "@sendou/scanner-core/cv";
|
||||
import { MAP_START_EVENT_TYPE } from "@sendou/scanner-core/detectors/map-start/index";
|
||||
import {
|
||||
createAllDetectors,
|
||||
SCOREBOARD_EVENT_TYPES,
|
||||
} from "@sendou/scanner-core/detectors/registry";
|
||||
import { DetectorScheduler } from "@sendou/scanner-core/detectors/scheduler";
|
||||
import {
|
||||
createScanTelemetry,
|
||||
detectorTelemetry,
|
||||
} from "@sendou/scanner-core/detectors/telemetry";
|
||||
import { normalizeFrame, toMat } from "@sendou/scanner-core/image";
|
||||
import { TimelineBuilder } from "@sendou/scanner-core/timeline/index";
|
||||
import {
|
||||
type CsvEvent,
|
||||
eventsToCsv,
|
||||
} from "../../app/features/scanner/components/events-csv";
|
||||
import { loadOpenCV } from "../../app/features/scanner/core/cv";
|
||||
import { MAP_START_EVENT_TYPE } from "../../app/features/scanner/core/detectors/map-start/index";
|
||||
import {
|
||||
createAllDetectors,
|
||||
SCOREBOARD_EVENT_TYPES,
|
||||
} from "../../app/features/scanner/core/detectors/registry";
|
||||
import { DetectorScheduler } from "../../app/features/scanner/core/detectors/scheduler";
|
||||
import {
|
||||
createScanTelemetry,
|
||||
detectorTelemetry,
|
||||
} from "../../app/features/scanner/core/detectors/telemetry";
|
||||
import { normalizeFrame, toMat } from "../../app/features/scanner/core/image";
|
||||
import { TimelineBuilder } from "../../app/features/scanner/core/timeline/index";
|
||||
import { loadScoreboardResources } from "../../app/features/scanner/node/resources";
|
||||
|
||||
const FRAME_WIDTH = 1920;
|
||||
|
||||
@@ -28,6 +28,53 @@ import type {
|
||||
StageId,
|
||||
} from "@sendou/in-game-lists/types";
|
||||
import { mainWeaponIds } from "@sendou/in-game-lists/weapon-ids";
|
||||
import {
|
||||
DEATH_EVENT_TYPE,
|
||||
type DeathData,
|
||||
} from "@sendou/scanner-core/detectors/death/index";
|
||||
import { ALL_WEAPON_ENTRIES } from "@sendou/scanner-core/detectors/death/weapon-names";
|
||||
import {
|
||||
MAP_START_EVENT_TYPE,
|
||||
type MapStartData,
|
||||
} from "@sendou/scanner-core/detectors/map-start/index";
|
||||
import {
|
||||
MINIMAP_EVENT_TYPE,
|
||||
type MinimapData,
|
||||
type MinimapEnemy,
|
||||
type MinimapTeammate,
|
||||
} from "@sendou/scanner-core/detectors/minimap/index";
|
||||
import type { CardSlot } from "@sendou/scanner-core/detectors/minimap/rois";
|
||||
import {
|
||||
OBJECTIVE_EVENT_TYPE,
|
||||
type ObjectiveData,
|
||||
} from "@sendou/scanner-core/detectors/objective/index";
|
||||
import {
|
||||
PLAYER_STATUS_EVENT_TYPE,
|
||||
type PlayerStatusData,
|
||||
type PlayerStatusFlags,
|
||||
type PlayerStatusLayout,
|
||||
} from "@sendou/scanner-core/detectors/objective/player-status";
|
||||
import {
|
||||
STRIP_WEAPONS_EVENT_TYPE,
|
||||
type StripWeaponsData,
|
||||
} from "@sendou/scanner-core/detectors/objective/strip-weapons";
|
||||
import {
|
||||
SCOREBOARD_EVENT_TYPE,
|
||||
type ScoreboardData,
|
||||
type ScoreboardPlayer,
|
||||
} from "@sendou/scanner-core/detectors/scoreboard/index";
|
||||
import { SCOREBOARD_BATTLE_LOG_EVENT_TYPE } from "@sendou/scanner-core/detectors/scoreboard-battle-log/index";
|
||||
import { SCOREBOARD_BATTLE_LOG_REPLAY_EVENT_TYPE } from "@sendou/scanner-core/detectors/scoreboard-battle-log-replay/index";
|
||||
import type { DetectedEvent } from "@sendou/scanner-core/detectors/types";
|
||||
import {
|
||||
type BuiltMatch,
|
||||
buildScannerMatches,
|
||||
} from "@sendou/scanner-core/match-builder";
|
||||
import type {
|
||||
ScannerMatch,
|
||||
ScannerMatchPlayerStatusSample,
|
||||
} from "@sendou/scanner-core/scanner-match";
|
||||
import type { ScannerLobby } from "@sendou/scanner-core/scanner-types";
|
||||
import { statusSpans } from "../../app/components/PlayerStatusTimeline";
|
||||
import { formatTime } from "../../app/features/scanner/components/format";
|
||||
import {
|
||||
@@ -36,53 +83,6 @@ import {
|
||||
modeLabel,
|
||||
stageLabel,
|
||||
} from "../../app/features/scanner/components/labels";
|
||||
import {
|
||||
DEATH_EVENT_TYPE,
|
||||
type DeathData,
|
||||
} from "../../app/features/scanner/core/detectors/death/index";
|
||||
import { ALL_WEAPON_ENTRIES } from "../../app/features/scanner/core/detectors/death/weapon-names";
|
||||
import {
|
||||
MAP_START_EVENT_TYPE,
|
||||
type MapStartData,
|
||||
} from "../../app/features/scanner/core/detectors/map-start/index";
|
||||
import {
|
||||
MINIMAP_EVENT_TYPE,
|
||||
type MinimapData,
|
||||
type MinimapEnemy,
|
||||
type MinimapTeammate,
|
||||
} from "../../app/features/scanner/core/detectors/minimap/index";
|
||||
import type { CardSlot } from "../../app/features/scanner/core/detectors/minimap/rois";
|
||||
import {
|
||||
OBJECTIVE_EVENT_TYPE,
|
||||
type ObjectiveData,
|
||||
} from "../../app/features/scanner/core/detectors/objective/index";
|
||||
import {
|
||||
PLAYER_STATUS_EVENT_TYPE,
|
||||
type PlayerStatusData,
|
||||
type PlayerStatusFlags,
|
||||
type PlayerStatusLayout,
|
||||
} from "../../app/features/scanner/core/detectors/objective/player-status";
|
||||
import {
|
||||
STRIP_WEAPONS_EVENT_TYPE,
|
||||
type StripWeaponsData,
|
||||
} from "../../app/features/scanner/core/detectors/objective/strip-weapons";
|
||||
import {
|
||||
SCOREBOARD_EVENT_TYPE,
|
||||
type ScoreboardData,
|
||||
type ScoreboardPlayer,
|
||||
} from "../../app/features/scanner/core/detectors/scoreboard/index";
|
||||
import { SCOREBOARD_BATTLE_LOG_EVENT_TYPE } from "../../app/features/scanner/core/detectors/scoreboard-battle-log/index";
|
||||
import { SCOREBOARD_BATTLE_LOG_REPLAY_EVENT_TYPE } from "../../app/features/scanner/core/detectors/scoreboard-battle-log-replay/index";
|
||||
import type { DetectedEvent } from "../../app/features/scanner/core/detectors/types";
|
||||
import {
|
||||
type BuiltMatch,
|
||||
buildScannerMatches,
|
||||
} from "../../app/features/scanner/core/match-builder";
|
||||
import type {
|
||||
ScannerMatch,
|
||||
ScannerMatchPlayerStatusSample,
|
||||
} from "../../app/features/scanner/core/scanner-match";
|
||||
import type { ScannerLobby } from "../../app/features/scanner/scanner-types";
|
||||
|
||||
/** Mirrors PlayerStatusTimeline's MAX_BRIDGE_SECONDS: longer sample gaps render as unobserved. */
|
||||
const OBSERVATION_GAP_SECONDS = 15;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { ordinal } from "openskill";
|
||||
import { db } from "~/db/sql";
|
||||
import type { Tables } from "~/db/tables";
|
||||
import { TIERS, type TierName } from "~/features/mmr/mmr-constants";
|
||||
import * as SkillRepository from "~/features/mmr/SkillRepository.server";
|
||||
import { freshUserSkills } from "~/features/mmr/tiered.server";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const rawNth = process.argv[2]?.trim();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { join } from "node:path";
|
||||
import { Readable } from "node:stream";
|
||||
import { S3 } from "@aws-sdk/client-s3";
|
||||
import { Upload } from "@aws-sdk/lib-storage";
|
||||
import { logger } from "~/utils/logger";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import {
|
||||
getArtFilename,
|
||||
SEED_ART_URLS,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import { notify } from "~/features/notifications/core/notify.server";
|
||||
import { webPushEnabled } from "~/features/notifications/core/webPush.server";
|
||||
import * as NotificationRepository from "~/features/notifications/NotificationRepository.server";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const username = process.argv[2]?.trim() ?? "Sendou";
|
||||
const seasonNth = Number(process.argv[3] ?? 1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import { logger } from "~/utils/logger";
|
||||
import { seedImages } from "./seed-images";
|
||||
|
||||
async function main() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import * as Seasons from "~/features/mmr/core/Seasons";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const discordId = process.argv[2]?.trim();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { db } from "~/db/sql";
|
||||
import invariant from "~/utils/invariant";
|
||||
|
||||
const discordId = process.argv[2]?.trim();
|
||||
const discordId2 = process.argv[3]?.trim();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import * as BadgeRepository from "~/features/badges/BadgeRepository.server";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const HOMEMADE_BADGES_URL =
|
||||
"https://raw.githubusercontent.com/sendou-ink/assets/main/homemade.json";
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
specialWeaponIds,
|
||||
subWeaponIds,
|
||||
} from "@sendou/in-game-lists/weapon-ids";
|
||||
import { logger } from "~/utils/logger";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import {
|
||||
loadWeaponInfoMain,
|
||||
loadWeaponInfoSpecial,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import invariant from "@sendou/utils/invariant";
|
||||
import { logger } from "@sendou/utils/logger";
|
||||
import { db } from "~/db/sql";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
const discordId = process.argv[2]?.trim();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user