feat: migration 3

This commit is contained in:
TrèsAbhi committed 2024-09-06 23:26:35 -05:00
1 parent 6285f33989
commit 4055988478
110 files changed
+28 -76

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { Vector3Tuple } from 'three';
import { Tier } from '../core/blitzkit/tankDefinitions';
export const equipmentPriceMatrix: Record<Tier, Vector3Tuple> = {
1: [100, 200, 300],
2: [200, 300, 400],
3: [400, 500, 600],
4: [4000, 5000, 6000],
5: [40_000, 50_000, 60_000],
6: [100_000, 120_000, 140_000],
7: [150_000, 170_000, 190_000],
8: [200_000, 225_000, 250_000],
9: [250_000, 275_000, 300_000],
10: [300_000, 350_000, 400_000],
};
+5
View File
@@ -1,4 +1,9 @@
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';
+7
View File
@@ -0,0 +1,7 @@
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 },
];
+11
View File
@@ -0,0 +1,11 @@
export const NATION_IDS: Record<string, number> = {
ussr: 0,
germany: 1,
usa: 2,
china: 3,
france: 4,
uk: 5,
japan: 6,
other: 7,
european: 8,
};
+2
View File
@@ -0,0 +1,2 @@
export const FIRST_MINIMAL_ARCHIVED_RATING_SEASON = 49;
export const FIRST_COMPREHENSIVE1_ARCHIVED_RATING_SEASON = 53;
+22
View File
@@ -0,0 +1,22 @@
export const REGIONS = ['com', 'eu', 'asia'] as const;
export type Region = (typeof REGIONS)[number];
export type RegionSubdomain = 'na' | 'eu' | 'asia';
/**
* @deprecated
*/
export const UNLOCALIZED_REGION_NAMES: Record<Region, string> = {
com: 'North America',
asia: 'Asia',
eu: 'Europe',
};
/**
* @deprecated
*/
export const UNLOCALIZED_REGION_NAMES_SHORT: Record<Region, string> = {
com: 'NA',
asia: 'APAC',
eu: 'EU',
};
+1
View File
@@ -0,0 +1 @@
export * from './users';
+3
View File
@@ -0,0 +1,3 @@
import { PrismaClient } from '@prisma/client';
export const usersDatabase = new PrismaClient();
+2
View File
@@ -1,5 +1,6 @@
export * from './blitz';
export * from './blitzkit';
export * from './databases';
export * from './imgur';
export * from './math';
export * from './patreon';
@@ -7,4 +8,5 @@ export * from './protobuf';
export * from './radix';
export * from './statistics';
export * from './streams';
export * from './types';
export * from './zustand';
+1
View File
@@ -0,0 +1 @@
export * from './tanksStats';
+4
View File
@@ -0,0 +1,4 @@
declare module '*.proto' {
const value: string;
export default value;
}
+38
View File
@@ -0,0 +1,38 @@
import { emptyAllStats } from '@blitzkit/core/src/blitzstars/getStatsInPeriod/constants';
import { BlitzStats } from '../core/statistics/compositeStats/constants';
export interface IndividualTankStats {
all: BlitzStats;
last_battle_time: number;
account_id: number;
max_xp: number;
in_garage_updated: number;
max_frags: number;
frags: number | null;
mark_of_mastery: number;
battle_life_time: number;
in_garage: number | null;
tank_id: number;
}
export interface TanksStats {
[accountId: number]: null | IndividualTankStats[];
}
export interface NormalizedTankStats {
[tankId: number]: IndividualTankStats;
}
export const emptyIndividualTankStats: IndividualTankStats = {
all: emptyAllStats,
last_battle_time: 0,
account_id: 0,
max_xp: 0,
in_garage_updated: 0,
max_frags: 0,
frags: 0,
battle_life_time: 0,
in_garage: 0,
tank_id: 0,
mark_of_mastery: 0,
};