mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
fix: no cross-bot imports
This commit is contained in:
1 parent
6c0b46725d
commit
7c6f381bbe
58 files changed
+233
-252
No files matched your search
@@ -2,6 +2,7 @@
|
||||
"name": "@blitzkit/bot",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"types": "src/types.d.ts",
|
||||
"dependencies": {
|
||||
"@blitzkit/core": "workspace:*",
|
||||
"satori": "^0.10.14",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getBlitzStarsLinkButton } from '../../../../website/src/core/blitzstars/getBlitzStarsLinkButton';
|
||||
import { getBlitzStarsLinkButton } from '../../core/blitzstars/getBlitzStarsLinkButton';
|
||||
import addPeriodicFilterOptions from '../../core/discord/addPeriodicFilterOptions';
|
||||
import addUsernameChoices from '../../core/discord/addUsernameChoices';
|
||||
import autocompleteTanks from '../../core/discord/autocompleteTanks';
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
TankDefinition,
|
||||
tankDefinitions,
|
||||
} from '@blitzkit/core';
|
||||
import { blitzStarsTankAverages } from '@blitzkit/core/src/blitzstars/tankAverages';
|
||||
import calculateWN8 from '@blitzkit/core/src/statistics/calculateWN8';
|
||||
import getWN8Percentile from '@blitzkit/core/src/statistics/getWN8Percentile';
|
||||
import { Locale } from 'discord.js';
|
||||
@@ -12,13 +13,12 @@ import { chunk } from 'lodash';
|
||||
import { getAccountInfo } from '../../../../website/src/core/blitz/getAccountInfo';
|
||||
import { getClanAccountInfo } from '../../../../website/src/core/blitz/getClanAccountInfo';
|
||||
import getTankStats from '../../../../website/src/core/blitz/getTankStats';
|
||||
import { filtersToDescription } from '../../../../website/src/core/blitzkit/filtersToDescription';
|
||||
import { tankAverages } from '../../../../website/src/core/blitzstars/tankAverages';
|
||||
import { UserError } from '../../../../website/src/hooks/userError';
|
||||
import * as Breakdown from '../../components/Breakdown';
|
||||
import CommandWrapper from '../../components/CommandWrapper';
|
||||
import NoData from '../../components/NoData';
|
||||
import TitleBar from '../../components/TitleBar';
|
||||
import { filtersToDescription } from '../../core/blitzkit/filtersToDescription';
|
||||
import getStatsInPeriod from '../../core/blitzstars/getStatsInPeriod';
|
||||
import { ResolvedPeriod } from '../../core/discord/resolvePeriodFromCommand';
|
||||
import { ResolvedPlayer } from '../../core/discord/resolvePlayerFromCommand';
|
||||
@@ -35,7 +35,7 @@ export async function renderBreakdown(
|
||||
) {
|
||||
const { t, translate } = translator(locale);
|
||||
const awaitedTankDefinitions = await tankDefinitions;
|
||||
const awaitedTankAverages = await tankAverages;
|
||||
const awaitedTankAverages = await blitzStarsTankAverages;
|
||||
const statsInPeriod = await getStatsInPeriod(region, id, start, end, locale);
|
||||
const { filteredOrder } = await filterStats(statsInPeriod, filters);
|
||||
const accountInfo = await getAccountInfo(region, id);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Locale, SlashCommandSubcommandGroupBuilder } from 'discord.js';
|
||||
import { getAccountInfo } from '../../../website/src/core/blitz/getAccountInfo';
|
||||
import { getClanAccountInfo } from '../../../website/src/core/blitz/getClanAccountInfo';
|
||||
import resolveTankId from '../../../website/src/core/blitz/resolveTankId';
|
||||
import { emblemURL } from '../../../website/src/core/blitzkit/emblemURL';
|
||||
import { getBlitzStarsLinkButton } from '../../../website/src/core/blitzstars/getBlitzStarsLinkButton';
|
||||
import getPlayerHistories from '../../../website/src/core/blitzstars/getPlayerHistories';
|
||||
import CommandWrapper from '../components/CommandWrapper';
|
||||
import * as Graph from '../components/Graph';
|
||||
import { LineColor } from '../components/Graph/components/Line/constants';
|
||||
import NoData from '../components/NoData';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import resolveTankId from '../core/blitz/resolveTankId';
|
||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||
import getPlayerHistories from '../core/blitzstars/getPlayerHistories';
|
||||
import getTankHistories from '../core/blitzstars/getTankHistories';
|
||||
import { addPeriodSubCommands } from '../core/discord/addPeriodSubCommands';
|
||||
import addTankChoices from '../core/discord/addTankChoices';
|
||||
|
||||
@@ -3,13 +3,13 @@ import { Locale } from 'discord.js';
|
||||
import { getAccountInfo } from '../../../website/src/core/blitz/getAccountInfo';
|
||||
import { getClanAccountInfo } from '../../../website/src/core/blitz/getClanAccountInfo';
|
||||
import { emblemURL } from '../../../website/src/core/blitzkit/emblemURL';
|
||||
import { filtersToDescription } from '../../../website/src/core/blitzkit/filtersToDescription';
|
||||
import { getBlitzStarsLinkButton } from '../../../website/src/core/blitzstars/getBlitzStarsLinkButton';
|
||||
import CommandWrapper from '../components/CommandWrapper';
|
||||
import GenericAllStats from '../components/GenericAllStats';
|
||||
import NoData from '../components/NoData';
|
||||
import TierWeights from '../components/TierWeights';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import { filtersToDescription } from '../core/blitzkit/filtersToDescription';
|
||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||
import getStatsInPeriod from '../core/blitzstars/getStatsInPeriod';
|
||||
import addPeriodicFilterOptions from '../core/discord/addPeriodicFilterOptions';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
|
||||
@@ -2,6 +2,7 @@ import {
|
||||
BkrlDiscriminatedEntries,
|
||||
FIRST_MINIMAL_ARCHIVED_RATING_SEASON,
|
||||
LEAGUES,
|
||||
RatingInfo,
|
||||
Region,
|
||||
} from '@blitzkit/core';
|
||||
import {
|
||||
@@ -34,93 +35,6 @@ import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { translator } from '../core/localization/translator';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
|
||||
export interface RatingPlayer {
|
||||
spa_id: number;
|
||||
mmr: number;
|
||||
season_number: number;
|
||||
calibrationBattlesLeft: number;
|
||||
number: number;
|
||||
percentile: number;
|
||||
skip: boolean;
|
||||
updated_at: string;
|
||||
score: number;
|
||||
nickname: string;
|
||||
clan_tag: string;
|
||||
}
|
||||
|
||||
export interface LeagueTop {
|
||||
result: RatingPlayer[];
|
||||
}
|
||||
|
||||
export type RatingReward = {
|
||||
from_position: number;
|
||||
to_position: number;
|
||||
count: number;
|
||||
} & (
|
||||
| {
|
||||
type: 'vehicle';
|
||||
|
||||
vehicle: {
|
||||
id: number;
|
||||
name: string;
|
||||
nation: string;
|
||||
subnation: string;
|
||||
use_subnation_flag: boolean;
|
||||
type_slug: string;
|
||||
level: number;
|
||||
roman_level: string;
|
||||
user_string: string;
|
||||
image_url: string;
|
||||
preview_image_url: string;
|
||||
is_premium: boolean;
|
||||
is_collectible: boolean;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: 'stuff';
|
||||
|
||||
stuff: {
|
||||
name: string;
|
||||
count: number;
|
||||
title: string;
|
||||
image_url: string;
|
||||
type: string;
|
||||
|
||||
sizes: {};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
export interface RatingLeague {
|
||||
title: string;
|
||||
small_icon: string;
|
||||
big_icon: string;
|
||||
background: string;
|
||||
index: number;
|
||||
percentile: number;
|
||||
}
|
||||
|
||||
export type RatingInfo =
|
||||
| {
|
||||
detail: undefined;
|
||||
|
||||
title: string;
|
||||
icon: string | null;
|
||||
start_at: string;
|
||||
finish_at: string;
|
||||
current_season: number;
|
||||
updated_at: string;
|
||||
count: number;
|
||||
|
||||
rewards: RatingReward[];
|
||||
leagues: RatingLeague[];
|
||||
}
|
||||
| { detail: { error: string } };
|
||||
|
||||
export interface RatingNeighbors {
|
||||
neighbors: RatingPlayer[];
|
||||
}
|
||||
|
||||
interface SimplifiedPlayer {
|
||||
id: number;
|
||||
score: number;
|
||||
@@ -256,7 +170,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
name_localizations: localizationObject(
|
||||
`common.leagues.${name}`,
|
||||
),
|
||||
} satisfies APIApplicationCommandOptionChoice<string>),
|
||||
}) satisfies APIApplicationCommandOptionChoice<string>,
|
||||
),
|
||||
)
|
||||
.setRequired(true);
|
||||
@@ -279,8 +193,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
const season = seasonOption
|
||||
? parseInt(seasonOption)
|
||||
: onGoingSeason
|
||||
? latestArchivedSeasonNumber + 1
|
||||
: latestArchivedSeasonNumber;
|
||||
? latestArchivedSeasonNumber + 1
|
||||
: latestArchivedSeasonNumber;
|
||||
const isCurrentSeason = season === latestArchivedSeasonNumber + 1;
|
||||
let titleName: string;
|
||||
let titleImage: string | undefined;
|
||||
@@ -313,7 +227,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
position: player.number,
|
||||
clan: player.clan_tag,
|
||||
nickname: player.nickname,
|
||||
} satisfies SimplifiedPlayer),
|
||||
}) satisfies SimplifiedPlayer,
|
||||
),
|
||||
)
|
||||
: await getArchivedRatingLeaderboard(region, season!).then(
|
||||
@@ -349,7 +263,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
'bot.commands.rating_leaderboard.body.deleted_player',
|
||||
[`${player.id}`],
|
||||
),
|
||||
} satisfies SimplifiedPlayer),
|
||||
}) satisfies SimplifiedPlayer,
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -398,7 +312,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
score: player.score,
|
||||
clan: player.clan_tag,
|
||||
nickname: player.nickname,
|
||||
} satisfies SimplifiedPlayer),
|
||||
}) satisfies SimplifiedPlayer,
|
||||
),
|
||||
)
|
||||
: await getArchivedRatingLeaderboard(region, season!).then(
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
TIER_ROMAN_NUMERALS,
|
||||
} from '@blitzkit/core';
|
||||
import { tankIcon } from '@blitzkit/core/src/blitzkit/tankIcon';
|
||||
import { blitzStarsTankAverages } from '@blitzkit/core/src/blitzstars/tankAverages';
|
||||
import calculateWN8 from '@blitzkit/core/src/statistics/calculateWN8';
|
||||
import { clamp } from 'lodash';
|
||||
import { getClanAccountInfo } from '../../../website/src/core/blitz/getClanAccountInfo';
|
||||
@@ -11,7 +12,6 @@ import { emblemURL } from '../../../website/src/core/blitzkit/emblemURL';
|
||||
import { iconPng } from '../../../website/src/core/blitzkit/iconPng';
|
||||
import { mapDefinitions } from '../../../website/src/core/blitzkit/mapDefinitions';
|
||||
import { RenderConfiguration } from '../../../website/src/core/blitzkit/renderConfiguration';
|
||||
import { tankAverages } from '../../../website/src/core/blitzstars/tankAverages';
|
||||
import CommandWrapper from '../components/CommandWrapper';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import buttonLink from '../core/discord/buttonLink';
|
||||
@@ -221,7 +221,7 @@ async function playerListing(
|
||||
winningTeam: number,
|
||||
recordingPlayer = false,
|
||||
) {
|
||||
const awaitedTankAverages = await tankAverages;
|
||||
const awaitedTankAverages = await blitzStarsTankAverages;
|
||||
const awaitedTankDefinitions = await tankDefinitions;
|
||||
const tank = awaitedTankDefinitions[player.vehicle_descr];
|
||||
const blockAccent = recordingPlayer ? '_amber' : '';
|
||||
|
||||
@@ -9,7 +9,6 @@ import { escapeMarkdown, Locale } from 'discord.js';
|
||||
import { getAccountInfo } from '../../../website/src/core/blitz/getAccountInfo';
|
||||
import { getClanAccountInfo } from '../../../website/src/core/blitz/getClanAccountInfo';
|
||||
import getTankStats from '../../../website/src/core/blitz/getTankStats';
|
||||
import resolveTankId from '../../../website/src/core/blitz/resolveTankId';
|
||||
import { buildTechTreeLine } from '../../../website/src/core/blitzkit/buildTechTreeLine';
|
||||
import { emblemURL } from '../../../website/src/core/blitzkit/emblemURL';
|
||||
import { iconPng } from '../../../website/src/core/blitzkit/iconPng';
|
||||
@@ -17,6 +16,7 @@ import { resolveAncestry } from '../../../website/src/core/blitzkit/resolveAnces
|
||||
import { tankIconPng } from '../../../website/src/core/blitzkit/tankIconPng';
|
||||
import CommandWrapper from '../components/CommandWrapper';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import resolveTankId from '../core/blitz/resolveTankId';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import { ClanList } from '@blitzkit/core/src/blitz/clanList';
|
||||
import { Locale } from 'discord.js';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import fetchBlitz from '../../../website/src/core/blitz/fetchBlitz';
|
||||
@@ -9,7 +10,6 @@ import embedInfo from '../core/discord/embedInfo';
|
||||
import { localizationObject } from '../core/discord/localizationObject';
|
||||
import { translator } from '../core/localization/translator';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { ClanList } from '../types/clanList';
|
||||
|
||||
const DEFAULT_LIMIT = 25;
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ import { Locale } from 'discord.js';
|
||||
import { getAccountInfo } from '../../../website/src/core/blitz/getAccountInfo';
|
||||
import { getClanAccountInfo } from '../../../website/src/core/blitz/getClanAccountInfo';
|
||||
import { emblemURL } from '../../../website/src/core/blitzkit/emblemURL';
|
||||
import { filtersToDescription } from '../../../website/src/core/blitzkit/filtersToDescription';
|
||||
import { getBlitzStarsLinkButton } from '../../../website/src/core/blitzstars/getBlitzStarsLinkButton';
|
||||
import AllStatsOverview from '../components/AllStatsOverview';
|
||||
import CommandWrapper from '../components/CommandWrapper';
|
||||
import NoData from '../components/NoData';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import { filtersToDescription } from '../core/blitzkit/filtersToDescription';
|
||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||
import getStatsInPeriod from '../core/blitzstars/getStatsInPeriod';
|
||||
import addPeriodicFilterOptions from '../core/discord/addPeriodicFilterOptions';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { gameDefinitions } from '@blitzkit/core/src/blitzkit/gameDefinitions';
|
||||
import { getBlitzStarsLinkButton } from '../../../website/src/core/blitzstars/getBlitzStarsLinkButton';
|
||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||
import { addFilterOptions } from '../core/discord/addFilterOptions';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { TankClass, TreeType } from '@blitzkit/core';
|
||||
import { TREE_TYPE_ICONS } from '@blitzkit/core/src/blitzkit/tankDefinitions/constants';
|
||||
import { Percentile } from '@blitzkit/core/src/statistics/percentiles';
|
||||
import { createColors } from 'bepaint';
|
||||
import {
|
||||
@@ -6,7 +7,6 @@ import {
|
||||
GrayColor,
|
||||
PALETTES,
|
||||
} from '../../../core/radix/radixColors';
|
||||
import { TREE_TYPE_ICONS } from '../../Tanks/components/Item/constants';
|
||||
import { RowStat } from './RowStat';
|
||||
|
||||
export interface RowStatItem {
|
||||
@@ -82,8 +82,8 @@ export function Row({
|
||||
? treeType === 'collector'
|
||||
? theme.textLowContrast_blue
|
||||
: treeType === 'premium'
|
||||
? theme.textLowContrast_amber
|
||||
: theme.textHighContrast
|
||||
? theme.textLowContrast_amber
|
||||
: theme.textHighContrast
|
||||
: theme.textLowContrast,
|
||||
fontWeight: 900,
|
||||
fontSize: 16,
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import {
|
||||
TANK_ICONS,
|
||||
TANK_ICONS_COLLECTOR,
|
||||
TANK_ICONS_PREMIUM,
|
||||
TankClass,
|
||||
TreeType,
|
||||
} from '@blitzkit/core';
|
||||
|
||||
export const TREE_TYPE_NAMES: Record<TreeType, string> = {
|
||||
researchable: 'Tech tree',
|
||||
premium: 'Premium',
|
||||
collector: 'Collector',
|
||||
};
|
||||
export const TREE_TYPE_IMAGES: Record<TreeType, string> = {
|
||||
researchable: 'https://i.imgur.com/pJxO2XY.png',
|
||||
premium: 'https://i.imgur.com/mZzSwOU.png',
|
||||
collector: 'https://i.imgur.com/7A0RsG5.png',
|
||||
};
|
||||
export const TREE_TYPE_ICONS: Record<TreeType, Record<TankClass, string>> = {
|
||||
researchable: TANK_ICONS,
|
||||
premium: TANK_ICONS_PREMIUM,
|
||||
collector: TANK_ICONS_COLLECTOR,
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import { TankClass, TreeType } from '@blitzkit/core';
|
||||
import { TREE_TYPE_ICONS } from '@blitzkit/core/src/blitzkit/tankDefinitions/constants';
|
||||
import { theme } from '../../../../stitches.config';
|
||||
import { TREE_TYPE_ICONS } from './constants';
|
||||
|
||||
export interface ItemProps {
|
||||
tankType?: TankClass;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Tier } from '@blitzkit/core';
|
||||
import { TierWeightsRecord } from '@blitzkit/core/src/statistics/getTierWeights';
|
||||
import { theme } from '../stitches.config';
|
||||
|
||||
export type TierWeightsRecord = Partial<Record<Tier, number>>;
|
||||
|
||||
interface TierWeightsProps {
|
||||
weights: TierWeightsRecord;
|
||||
}
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@ import { tankDefinitions, tankNames } from '@blitzkit/core';
|
||||
import { Locale } from 'discord.js';
|
||||
import { go } from 'fuzzysort';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import { tankNamesTechTreeOnly } from '../../../../bot/src/core/discord/autocompleteTanks';
|
||||
import { translator } from '../../../../bot/src/core/localization/translator';
|
||||
import { UserError } from '../../hooks/userError';
|
||||
import { UserError } from '../../../../website/src/hooks/userError';
|
||||
import { tankNamesTechTreeOnly } from '../discord/autocompleteTanks';
|
||||
import { translator } from '../localization/translator';
|
||||
|
||||
export default async function resolveTankId(
|
||||
tank: string | number,
|
||||
+1
-1
@@ -5,7 +5,7 @@ import {
|
||||
TIER_ROMAN_NUMERALS,
|
||||
} from '@blitzkit/core';
|
||||
import { Locale } from 'discord.js';
|
||||
import { translator } from '../../../../bot/src/core/localization/translator';
|
||||
import { translator } from '../localization/translator';
|
||||
|
||||
export async function filtersToDescription(
|
||||
{ nation, tier, tankType, treeType, tank }: StatFilters,
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { usersDatabase } from '@blitzkit/core';
|
||||
import { client } from '../../../../bot/src/core/discord/client';
|
||||
import { client } from '../discord/client';
|
||||
|
||||
const EXIT_EVENTS = [
|
||||
'beforeExit',
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import buttonLink from '../../../../bot/src/core/discord/buttonLink';
|
||||
import { getAccountInfo } from '../blitz/getAccountInfo';
|
||||
import { getAccountInfo } from '../../../../website/src/core/blitz/getAccountInfo';
|
||||
import buttonLink from '../discord/buttonLink';
|
||||
|
||||
export async function getBlitzStarsLinkButton(
|
||||
region: Region,
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
import { Region, emptyAllStats } from '@blitzkit/core';
|
||||
import { getAccountInfo } from '../../../../website/src/core/blitz/getAccountInfo';
|
||||
import {
|
||||
GetHistoriesOptions,
|
||||
Histories,
|
||||
History,
|
||||
getHistoriesDefaultOptions,
|
||||
} from '../../../../bot/src/types/histories';
|
||||
import { getAccountInfo } from '../blitz/getAccountInfo';
|
||||
} from '../../types/histories';
|
||||
import { PlayerStats } from './getPlayerStats';
|
||||
|
||||
export default async function getPlayerHistories(
|
||||
@@ -22,7 +22,7 @@ export default async function getPlayerHistories(
|
||||
({
|
||||
all: history.statistics.all,
|
||||
last_battle_time: history.last_battle_time,
|
||||
} satisfies History),
|
||||
}) satisfies History,
|
||||
);
|
||||
let lastNonCompliantIndex = -1;
|
||||
let hasCompliedOnce = false;
|
||||
File renamed without changes.
@@ -1,4 +1,5 @@
|
||||
import { BlitzStats, emptyAllStats, Region } from '@blitzkit/core';
|
||||
import { DiffedTankStats } from '@blitzkit/core/src/statistics/filterStats';
|
||||
import { Locale } from 'discord.js';
|
||||
import getTankHistories, {
|
||||
TankHistories,
|
||||
@@ -14,11 +15,6 @@ const emptyTankHistoryNode: TankHistoryRaw = {
|
||||
all: emptyAllStats,
|
||||
};
|
||||
|
||||
export interface DiffedTankStats {
|
||||
diff: Record<number, BlitzStats>;
|
||||
order: number[];
|
||||
}
|
||||
|
||||
// BIG TODO: merge this neatly with diffNormalizedTankStats
|
||||
export default async function getStatsInPeriod(
|
||||
server: Region,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import searchClansAcrossRegions from '@blitzkit/core/src/blitz/searchClansAcrossRegions';
|
||||
import {
|
||||
ApplicationCommandOptionChoiceData,
|
||||
AutocompleteInteraction,
|
||||
CacheType,
|
||||
} from 'discord.js';
|
||||
import searchClansAcrossRegions from '../../../../../website/src/core/blitz/searchClansAcrossRegions';
|
||||
import { translator } from '../../localization/translator';
|
||||
import { DISCORD_CHOICES_MAX_NAME_SIZE, OVERFLOW_SUFFIX } from './constants';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { StatFilters, TreeType } from '@blitzkit/core';
|
||||
import { ChatInputCommandInteraction } from 'discord.js';
|
||||
import resolveTankId from '../../../../website/src/core/blitz/resolveTankId';
|
||||
import resolveTankId from '../blitz/resolveTankId';
|
||||
|
||||
export async function getFiltersFromCommand(
|
||||
interaction: ChatInputCommandInteraction,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import searchClansAcrossRegions from '@blitzkit/core/src/blitz/searchClansAcrossRegions';
|
||||
import { ChatInputCommandInteraction } from 'discord.js';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import searchClansAcrossRegions from '../../../../website/src/core/blitz/searchClansAcrossRegions';
|
||||
import { UserError } from '../../../../website/src/hooks/userError';
|
||||
import { translator } from '../localization/translator';
|
||||
import { serverAndIdPattern } from './resolvePlayerFromCommand/constants';
|
||||
|
||||
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
import { assertSecret } from '@blitzkit/core';
|
||||
import { registerProcesses } from '../../../website/src/core/blitzkit/processes';
|
||||
import { registerProcesses } from '../core/blitzkit/processes';
|
||||
import { client } from '../core/discord/client';
|
||||
|
||||
console.log(`🟡 Launching bot ${client.shard?.ids[0]}`);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"declaration": true
|
||||
},
|
||||
"extends": "../../tsconfig.json"
|
||||
}
|
||||
File renamed without changes.
@@ -1,9 +1,10 @@
|
||||
export * from './clans';
|
||||
export * from './constants';
|
||||
export * from './equipmentPrice';
|
||||
export * from './idToRegion';
|
||||
export * from './leagues';
|
||||
export * from './nations';
|
||||
export * from './permanentSkills';
|
||||
export * from './rating';
|
||||
export * from './regions';
|
||||
export * from './resolveNearPenetration';
|
||||
export * from './searchClansAcrossRegions';
|
||||
@@ -1,7 +0,0 @@
|
||||
export const LEAGUES = [
|
||||
{ name: 'diamond', minScore: 5000, index: 0 },
|
||||
{ name: 'platinum', minScore: 4000, index: 1 },
|
||||
{ name: 'gold', minScore: 3000, index: 2 },
|
||||
{ name: 'silver', minScore: 2000, index: 3 },
|
||||
{ name: 'bronze', minScore: -Infinity, index: 4 },
|
||||
];
|
||||
@@ -1,2 +1,79 @@
|
||||
export const FIRST_MINIMAL_ARCHIVED_RATING_SEASON = 49;
|
||||
import { RatingPlayer } from '../statistics';
|
||||
|
||||
export const LEAGUES = [
|
||||
{ name: 'diamond', minScore: 5000, index: 0 },
|
||||
{ name: 'platinum', minScore: 4000, index: 1 },
|
||||
{ name: 'gold', minScore: 3000, index: 2 },
|
||||
{ name: 'silver', minScore: 2000, index: 3 },
|
||||
{ name: 'bronze', minScore: -Infinity, index: 4 },
|
||||
];
|
||||
export type RatingInfo =
|
||||
| {
|
||||
detail: undefined;
|
||||
|
||||
title: string;
|
||||
icon: string | null;
|
||||
start_at: string;
|
||||
finish_at: string;
|
||||
current_season: number;
|
||||
updated_at: string;
|
||||
count: number;
|
||||
|
||||
rewards: RatingReward[];
|
||||
leagues: RatingLeague[];
|
||||
}
|
||||
| { detail: { error: string } };
|
||||
export interface RatingNeighbors {
|
||||
neighbors: RatingPlayer[];
|
||||
}
|
||||
export const FIRST_COMPREHENSIVE1_ARCHIVED_RATING_SEASON = 53;
|
||||
export const FIRST_MINIMAL_ARCHIVED_RATING_SEASON = 49;
|
||||
export interface LeagueTop {
|
||||
result: RatingPlayer[];
|
||||
}
|
||||
export interface RatingLeague {
|
||||
title: string;
|
||||
small_icon: string;
|
||||
big_icon: string;
|
||||
background: string;
|
||||
index: number;
|
||||
percentile: number;
|
||||
}
|
||||
export type RatingReward = {
|
||||
from_position: number;
|
||||
to_position: number;
|
||||
count: number;
|
||||
} & (
|
||||
| {
|
||||
type: 'vehicle';
|
||||
|
||||
vehicle: {
|
||||
id: number;
|
||||
name: string;
|
||||
nation: string;
|
||||
subnation: string;
|
||||
use_subnation_flag: boolean;
|
||||
type_slug: string;
|
||||
level: number;
|
||||
roman_level: string;
|
||||
user_string: string;
|
||||
image_url: string;
|
||||
preview_image_url: string;
|
||||
is_premium: boolean;
|
||||
is_collectible: boolean;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: 'stuff';
|
||||
|
||||
stuff: {
|
||||
name: string;
|
||||
count: number;
|
||||
title: string;
|
||||
image_url: string;
|
||||
type: string;
|
||||
|
||||
sizes: {};
|
||||
};
|
||||
}
|
||||
);
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import { ClanList } from '../../../../bot/src/types/clanList';
|
||||
import fetchBlitz from './fetchBlitz';
|
||||
import fetchBlitz from '../../../website/src/core/blitz/fetchBlitz';
|
||||
import { ClanList } from './clans';
|
||||
|
||||
export default async function searchClansAcrossRegions(
|
||||
search: string,
|
||||
@@ -1,4 +1,11 @@
|
||||
import { CrewMember, GunDefinition, ShellType, TankClass, Tier } from '.';
|
||||
import {
|
||||
CrewMember,
|
||||
GunDefinition,
|
||||
ShellType,
|
||||
TankClass,
|
||||
Tier,
|
||||
TreeType,
|
||||
} from '.';
|
||||
|
||||
export const SHELL_NAMES: Record<ShellType, string> = {
|
||||
ap: 'AP',
|
||||
@@ -70,3 +77,8 @@ export const flags: Record<string, string> = {
|
||||
european: '🇪🇺',
|
||||
other: '<:other:1218421572243558482>',
|
||||
};
|
||||
export const TREE_TYPE_ICONS: Record<TreeType, Record<TankClass, string>> = {
|
||||
researchable: TANK_ICONS,
|
||||
premium: TANK_ICONS_PREMIUM,
|
||||
collector: TANK_ICONS_COLLECTOR,
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export * from './tankAverages';
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
import { BlitzStats, tankDefinitions } from '@blitzkit/core';
|
||||
import { context } from '../blitzkit/context';
|
||||
import { context } from '../../../website/src/core/blitzkit/context';
|
||||
|
||||
interface SpecialStats {
|
||||
winrate: number;
|
||||
@@ -81,9 +81,9 @@ export interface IndividualTankAverage {
|
||||
|
||||
tankDefinitions;
|
||||
|
||||
export type TankAverages = Record<number, IndividualTankAverage>;
|
||||
export type BlitzStarsTankAverages = Record<number, IndividualTankAverage>;
|
||||
|
||||
export const tankAverages = fetch(
|
||||
export const blitzStarsTankAverages = fetch(
|
||||
context === 'website'
|
||||
? '/api/tank-averages'
|
||||
: 'https://www.blitzstars.com/api/tankaverages.json',
|
||||
@@ -91,7 +91,7 @@ export const tankAverages = fetch(
|
||||
.then((response) => response.json())
|
||||
.then((json) => {
|
||||
if (context === 'server') {
|
||||
const partialTankAverages: TankAverages = {};
|
||||
const partialTankAverages: BlitzStarsTankAverages = {};
|
||||
|
||||
(json as IndividualTankAverage[]).forEach((individualTankAverage) => {
|
||||
partialTankAverages[individualTankAverage.tank_id] =
|
||||
@@ -100,6 +100,6 @@ export const tankAverages = fetch(
|
||||
|
||||
return partialTankAverages;
|
||||
} else {
|
||||
return json as TankAverages;
|
||||
return json as BlitzStarsTankAverages;
|
||||
}
|
||||
});
|
||||
@@ -1,5 +1,6 @@
|
||||
export * from './blitz';
|
||||
export * from './blitzkit';
|
||||
export * from './blitzstars';
|
||||
export * from './databases';
|
||||
export * from './imgur';
|
||||
export * from './math';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
type Name =
|
||||
| `color-${'background' | `panel-${'solid' | 'translucent'}` | 'surface' | 'overlay'}`
|
||||
| `radius-${1 | 2 | 3 | 4 | 5 | 6 | 'full'}`
|
||||
| `space-${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`;
|
||||
| `space-${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`
|
||||
| string;
|
||||
|
||||
export function Var(name: Name) {
|
||||
return `var(--${name})`;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { RatingPlayer } from '../../../bot/src/commands/ratingLeaderboard';
|
||||
import { RatingStats } from '../../../website/src/core/blitz/getAccountInfo';
|
||||
import { BkrlSuperset1Entry } from '../streams/bkrl';
|
||||
|
||||
@@ -16,3 +15,16 @@ export function deltaBkrlBlitzStats(
|
||||
score: b2.score - a.score,
|
||||
} satisfies Omit<BkrlSuperset1Entry, 'id'>;
|
||||
}
|
||||
export interface RatingPlayer {
|
||||
spa_id: number;
|
||||
mmr: number;
|
||||
season_number: number;
|
||||
calibrationBattlesLeft: number;
|
||||
number: number;
|
||||
percentile: number;
|
||||
skip: boolean;
|
||||
updated_at: string;
|
||||
score: number;
|
||||
nickname: string;
|
||||
clan_tag: string;
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import { DiffedTankStats } from '../../../bot/src/core/blitzstars/getStatsInPeriod';
|
||||
import { SupplementaryStats } from '../../../website/src/core/blitz/getAccountInfo';
|
||||
import { tankAverages } from '../../../website/src/core/blitzstars/tankAverages';
|
||||
import { tankDefinitions, TreeType } from '../blitzkit/tankDefinitions';
|
||||
import { blitzStarsTankAverages } from '../blitzstars/tankAverages';
|
||||
import calculateWN8 from './calculateWN8';
|
||||
import { BlitzStats } from './compositeStats';
|
||||
import sumStats from './sumStats';
|
||||
|
||||
export interface StatFilters {
|
||||
@@ -21,7 +21,7 @@ export async function filterStats(
|
||||
if (filters.tank) filters = { tank: filters.tank };
|
||||
|
||||
const awaitedTankDefinitions = await tankDefinitions;
|
||||
const awaitedTankAverages = await tankAverages;
|
||||
const awaitedTankAverages = await blitzStarsTankAverages;
|
||||
const filteredOrder = order.filter((id) => {
|
||||
const entry = awaitedTankDefinitions[id];
|
||||
|
||||
@@ -72,3 +72,8 @@ export async function filterStats(
|
||||
|
||||
return { stats, supplementary, filteredOrder };
|
||||
}
|
||||
|
||||
export interface DiffedTankStats {
|
||||
diff: Record<number, BlitzStats>;
|
||||
order: number[];
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import { TierWeightsRecord } from '../../../bot/src/components/TierWeights';
|
||||
import { tankDefinitions } from '../blitzkit/tankDefinitions';
|
||||
import { tankDefinitions, Tier } from '../blitzkit/tankDefinitions';
|
||||
import { BlitzStats } from './compositeStats/constants';
|
||||
|
||||
export async function getTierWeights(
|
||||
@@ -20,3 +19,4 @@ export async function getTierWeights(
|
||||
|
||||
return tierWeights;
|
||||
}
|
||||
export type TierWeightsRecord = Partial<Record<Tier, number>>;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare module '*.proto' {
|
||||
const value: string;
|
||||
export default value;
|
||||
}
|
||||
@@ -8,13 +8,10 @@ import {
|
||||
RegionSubdomain,
|
||||
superCompress,
|
||||
} from '@blitzkit/core';
|
||||
import { RatingInfo, RatingNeighbors } from '@blitzkit/core/src/blitz/leagues';
|
||||
import { RatingPlayer } from '@blitzkit/core/src/statistics/deltaBkrlBlitzStats';
|
||||
import { chunk } from 'lodash';
|
||||
import { argv } from 'process';
|
||||
import {
|
||||
RatingInfo,
|
||||
RatingNeighbors,
|
||||
RatingPlayer,
|
||||
} from '../../bot/src/commands/ratingLeaderboard';
|
||||
import { getAccountInfo } from '../../website/src/core/blitz/getAccountInfo';
|
||||
import regionSubdomainToRegion from '../../website/src/core/blitz/regionSubdomainToRegion';
|
||||
import { patientFetchJSON } from '../../website/src/core/blitzkit/patientFetchJSON';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { blitzStarsTankAverages } from '@blitzkit/core/src/blitzstars/tankAverages';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { tankAverages } from '../../../core/blitzstars/tankAverages';
|
||||
|
||||
export async function GET() {
|
||||
return NextResponse.json(await tankAverages);
|
||||
return NextResponse.json(await blitzStarsTankAverages);
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
import { TankCharacteristics } from '@blitzkit/core';
|
||||
import { TankCharacteristics, Var } from '@blitzkit/core';
|
||||
import {
|
||||
CaretLeftIcon,
|
||||
CaretRightIcon,
|
||||
CaretSortIcon,
|
||||
} from '@radix-ui/react-icons';
|
||||
import { Flex, IconButton, Table, Text } from '@radix-ui/themes';
|
||||
import { theme } from '../../../../../../bot/src/stitches.config';
|
||||
import { StickyRowHeaderCell } from '../../../../components/StickyRowHeaderCell';
|
||||
import * as CompareEphemeral from '../../../../stores/compareEphemeral';
|
||||
import * as ComparePersistent from '../../../../stores/comparePersistent';
|
||||
@@ -103,8 +102,8 @@ export function CompareRow({
|
||||
const resolvedDisplayValue = display
|
||||
? display(stats[index])
|
||||
: decimals === undefined
|
||||
? value
|
||||
: value?.toFixed(decimals);
|
||||
? value
|
||||
: value?.toFixed(decimals);
|
||||
|
||||
return (
|
||||
<Table.Cell
|
||||
@@ -117,12 +116,12 @@ export function CompareRow({
|
||||
value === values[0]
|
||||
? undefined
|
||||
: (
|
||||
deltaType === 'higherIsBetter'
|
||||
? value > values[0]
|
||||
: value < values[0]
|
||||
)
|
||||
? `color-mix(in srgb, ${theme.colors.componentCallToActionInteractive_green} ${normalizedDeltaPercentage}%, ${theme.colors.componentCallToActionInteractive_green}00)`
|
||||
: `color-mix(in srgb, ${theme.colors.componentCallToActionInteractive_red} ${normalizedDeltaPercentage}%, ${theme.colors.componentCallToActionInteractive_red}00)`,
|
||||
deltaType === 'higherIsBetter'
|
||||
? value > values[0]
|
||||
: value < values[0]
|
||||
)
|
||||
? `color-mix(in srgb, ${Var('green-7')} ${normalizedDeltaPercentage}%, ${Var('green-3')})`
|
||||
: `color-mix(in srgb, ${Var('red-7')} ${normalizedDeltaPercentage}%, ${Var('red-3')})`,
|
||||
}}
|
||||
>
|
||||
<Flex
|
||||
@@ -149,8 +148,8 @@ export function CompareRow({
|
||||
deltaNominalDisplay
|
||||
? deltaNominalDisplay(delta)
|
||||
: decimals === undefined
|
||||
? delta
|
||||
: delta.toFixed(decimals)
|
||||
? delta
|
||||
: delta.toFixed(decimals)
|
||||
}`}
|
||||
)
|
||||
</Text>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
TankCharacteristics,
|
||||
Var,
|
||||
asset,
|
||||
availableProvisions,
|
||||
checkConsumableProvisionInclusivity,
|
||||
@@ -13,7 +14,6 @@ import { ComponentPlaceholderIcon } from '@radix-ui/react-icons';
|
||||
import { Button, Flex, Popover, Slider, Table, Text } from '@radix-ui/themes';
|
||||
import { debounce, times } from 'lodash';
|
||||
import { use } from 'react';
|
||||
import { theme } from '../../../../../../bot/src/stitches.config';
|
||||
import { BlitzkitButtonGrayIcon } from '../../../../components/BlitzkitButtonGrayIcon';
|
||||
import { ConsumablesManager } from '../../../../components/ConsumablesManager';
|
||||
import { CrewSkillManager } from '../../../../components/CrewSkillManager';
|
||||
@@ -83,12 +83,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
||||
<Popover.Root>
|
||||
<Popover.Trigger>
|
||||
<Button variant="ghost" radius="large">
|
||||
<Flex
|
||||
direction="column"
|
||||
style={{
|
||||
gap: 2,
|
||||
}}
|
||||
>
|
||||
<Flex direction="column" style={{ gap: 2 }}>
|
||||
{Object.entries(awaitedSkillDefinitions.classes).map(
|
||||
([tankClass, skills]) => (
|
||||
<Flex key={tankClass} style={{ gap: 2 }}>
|
||||
@@ -101,10 +96,10 @@ export function CompareTable({ stats }: CompareTableProps) {
|
||||
borderRadius: 2,
|
||||
backgroundColor:
|
||||
crewSkills[skill] === 0
|
||||
? theme.colors.textLowContrast
|
||||
? Var('gray-11')
|
||||
: permanentSkills.includes(skill)
|
||||
? theme.colors.textLowContrast_crimson
|
||||
: theme.colors.textLowContrast_amber,
|
||||
? Var('crimson-11')
|
||||
: Var('amber-11'),
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
@@ -381,9 +376,8 @@ export function CompareTable({ stats }: CompareTableProps) {
|
||||
height: 8,
|
||||
backgroundColor:
|
||||
equipment === -1
|
||||
? theme.colors
|
||||
.textLowContrast_crimson
|
||||
: theme.colors.textLowContrast,
|
||||
? Var('crimson-11')
|
||||
: Var('gray-11'),
|
||||
borderRadius: 2,
|
||||
}}
|
||||
/>
|
||||
@@ -393,9 +387,8 @@ export function CompareTable({ stats }: CompareTableProps) {
|
||||
height: 8,
|
||||
backgroundColor:
|
||||
equipment === 1
|
||||
? theme.colors
|
||||
.textLowContrast_crimson
|
||||
: theme.colors.textLowContrast,
|
||||
? Var('crimson-11')
|
||||
: Var('gray-11'),
|
||||
borderRadius: 2,
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Var } from '@blitzkit/core';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { theme } from '../../../../../../../bot/src/stitches.config';
|
||||
import { insertionMarkers } from './constants';
|
||||
|
||||
export function InsertionMarker({ index }: { index: number }) {
|
||||
@@ -28,7 +28,7 @@ export function InsertionMarker({ index }: { index: number }) {
|
||||
height: '75%',
|
||||
width: 2,
|
||||
borderRadius: 1,
|
||||
backgroundColor: theme.colors.textLowContrast_crimson,
|
||||
backgroundColor: Var('crimson-11'),
|
||||
position: 'absolute',
|
||||
right: 0,
|
||||
top: '50%',
|
||||
|
||||
@@ -6,7 +6,10 @@ import {
|
||||
Region,
|
||||
REGIONS,
|
||||
UNLOCALIZED_REGION_NAMES,
|
||||
Var,
|
||||
} from '@blitzkit/core';
|
||||
import { RatingInfo } from '@blitzkit/core/src/blitz/leagues';
|
||||
import { RatingPlayer } from '@blitzkit/core/src/statistics/deltaBkrlBlitzStats';
|
||||
import { blackA, orangeDark } from '@radix-ui/colors';
|
||||
import { MagnifyingGlassIcon } from '@radix-ui/react-icons';
|
||||
import {
|
||||
@@ -22,11 +25,6 @@ import { produce } from 'immer';
|
||||
import { debounce, range } from 'lodash';
|
||||
import { ChangeEvent, useEffect, useRef, useState } from 'react';
|
||||
import { create } from 'zustand';
|
||||
import {
|
||||
RatingInfo,
|
||||
RatingPlayer,
|
||||
} from '../../../../../bot/src/commands/ratingLeaderboard';
|
||||
import { theme } from '../../../../../bot/src/stitches.config';
|
||||
import PageWrapper from '../../../components/PageWrapper';
|
||||
import { Skeleton } from '../../../components/Skeleton';
|
||||
import fetchBlitz from '../../../core/blitz/fetchBlitz';
|
||||
@@ -1008,9 +1006,7 @@ export default function Page() {
|
||||
return (
|
||||
<Table.Row
|
||||
style={{
|
||||
backgroundColor: highlight
|
||||
? theme.colors.componentInteractiveActive_orange
|
||||
: 'unset',
|
||||
backgroundColor: highlight ? Var('orange-9') : 'unset',
|
||||
cursor: 'pointer',
|
||||
}}
|
||||
key={`${region}${season}${index}`}
|
||||
@@ -1023,14 +1019,14 @@ export default function Page() {
|
||||
<Flex gap="2">
|
||||
{names[region][id] === null
|
||||
? `Deleted player ${id}`
|
||||
: names[region][id]?.nickname ?? (
|
||||
: (names[region][id]?.nickname ?? (
|
||||
<Skeleton
|
||||
style={{
|
||||
height: 16,
|
||||
width: Math.random() * 128 + 128,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
))}
|
||||
{clan ? (
|
||||
<Text color="gray">{`[${clan}]`}</Text>
|
||||
) : (
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
idToRegion,
|
||||
tankDefinitions,
|
||||
} from '@blitzkit/core';
|
||||
import { blitzStarsTankAverages } from '@blitzkit/core/src/blitzstars/tankAverages';
|
||||
import {
|
||||
ArrowDownIcon,
|
||||
MagnifyingGlassIcon,
|
||||
@@ -45,7 +46,6 @@ import getTankStats from '../../../core/blitz/getTankStats';
|
||||
import searchPlayersAcrossRegions, {
|
||||
AccountListWithServer,
|
||||
} from '../../../core/blitz/searchPlayersAcrossRegions';
|
||||
import { tankAverages } from '../../../core/blitzstars/tankAverages';
|
||||
import * as Session from '../../../stores/session';
|
||||
|
||||
export default function Page({
|
||||
@@ -55,7 +55,7 @@ export default function Page({
|
||||
}) {
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const awaitedTankDefinitions = use(tankDefinitions);
|
||||
const awaitedTankAvearges = use(tankAverages);
|
||||
const awaitedTankAvearges = use(blitzStarsTankAverages);
|
||||
const [showSearch, setShowSearch] = useState(false);
|
||||
const [searching, setSearching] = useState(false);
|
||||
const [searchResults, setSearchResults] = useState<AccountListWithServer>([]);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { provisionDefinitions } from '@blitzkit/core';
|
||||
import { TREE_TYPE_ICONS } from '@blitzkit/core/src/blitzkit/tankDefinitions/constants';
|
||||
import { CaretRightIcon, UpdateIcon } from '@radix-ui/react-icons';
|
||||
import { Button, Dialog, Flex, Heading } from '@radix-ui/themes';
|
||||
import Link from 'next/link';
|
||||
@@ -6,8 +8,6 @@ import { pushTankopediaPath } from '../../../../../core/blitzkit/pushTankopediaP
|
||||
import { tankToDuelMember } from '../../../../../core/blitzkit/tankToDuelMember';
|
||||
import * as Duel from '../../../../../stores/duel';
|
||||
import { TankSearch } from '../../components/TankSearch';
|
||||
import { provisionDefinitions } from '@blitzkit/core';
|
||||
import { TREE_TYPE_ICONS } from '../../../../../../../bot/src/components/Tanks/components/Item/constants';
|
||||
|
||||
export function Title() {
|
||||
const awaitedProvisionDefinitions = use(provisionDefinitions);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import { RatingInfo } from '../../../../bot/src/commands/ratingLeaderboard';
|
||||
import { RatingInfo, Region } from '@blitzkit/core';
|
||||
import { context } from '../blitzkit/context';
|
||||
import { patientFetch } from '../blitzkit/patientFetch';
|
||||
import regionToRegionSubdomain from './regionToRegionSubdomain';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import {
|
||||
LeagueTop,
|
||||
RatingPlayer,
|
||||
} from '../../../../bot/src/commands/ratingLeaderboard';
|
||||
import { LeagueTop } from '@blitzkit/core/src/blitz/rating';
|
||||
import { RatingPlayer } from '@blitzkit/core/src/statistics/deltaBkrlBlitzStats';
|
||||
import { context } from '../blitzkit/context';
|
||||
import { patientFetch } from '../blitzkit/patientFetch';
|
||||
import regionToRegionSubdomain from './regionToRegionSubdomain';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import { RatingNeighbors } from '../../../../bot/src/commands/ratingLeaderboard';
|
||||
import { RatingNeighbors, Region } from '@blitzkit/core';
|
||||
import { patientFetch } from '../blitzkit/patientFetch';
|
||||
import { withCORSProxy } from '../blitzkit/withCORSProxy';
|
||||
import regionToRegionSubdomain from './regionToRegionSubdomain';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Region, asset } from '@blitzkit/core';
|
||||
import { RatingInfo } from '@blitzkit/core/src/blitz/leagues';
|
||||
import { superDecompress } from '@blitzkit/core/src/blitzkit/superDecompress';
|
||||
import { RatingInfo } from '../../../../bot/src/commands/ratingLeaderboard';
|
||||
|
||||
const cache: Record<
|
||||
Region,
|
||||
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare module '*.glsl' {
|
||||
const value: string;
|
||||
export default value;
|
||||
}
|
||||
Reference in new issue
Block a user