mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: player count
This commit is contained in:
1 parent
1d112bb633
commit
db83ac40b4
10 files changed
+49
-45
No files matched your search
+10
-4
@@ -119,7 +119,7 @@ async function postWork() {
|
||||
`Generating statistics based off ${includedPlayers.toLocaleString()} players (${checkedPlayers.toLocaleString()} checked in total) and ${tankIds.length} tanks...`,
|
||||
);
|
||||
|
||||
const averages: AverageDefinitions = {};
|
||||
const averages: Record<number, AverageDefinitionsEntry> = {};
|
||||
|
||||
tankIds.forEach((id) => {
|
||||
const tanks = tanksSorted[id];
|
||||
@@ -170,14 +170,20 @@ async function postWork() {
|
||||
averages[id] = entry as AverageDefinitionsEntry;
|
||||
});
|
||||
|
||||
const averageDefinitions = {
|
||||
averages,
|
||||
players: includedPlayers,
|
||||
} satisfies AverageDefinitions;
|
||||
|
||||
commitAssets(
|
||||
'averages',
|
||||
[
|
||||
{
|
||||
path: 'definitions/averages.pb',
|
||||
content: await encodeToBase64('blitzkit.AverageDefinitions', {
|
||||
averages,
|
||||
}),
|
||||
content: await encodeToBase64(
|
||||
'blitzkit.AverageDefinitions',
|
||||
averageDefinitions,
|
||||
),
|
||||
encoding: 'base64',
|
||||
},
|
||||
],
|
||||
|
||||
@@ -7,14 +7,9 @@ import { getAccountInfo } from '../src/core/blitz/getAccountInfo';
|
||||
import { MIN_IDS, idToRegion } from '../src/core/blitz/idToRegion';
|
||||
import { asset } from '../src/core/blitzkit/asset';
|
||||
import { commitAssets } from '../src/core/blitzkit/commitAssets';
|
||||
import { DiscoverIdsDefinitions } from '../src/core/blitzkit/discoveredIdDefinitions';
|
||||
import { DidsReadStream, DidsWriteStream } from '../src/core/streams/dids';
|
||||
|
||||
export interface DiscoverIdsManifest {
|
||||
time: number;
|
||||
chunks: number;
|
||||
count: number;
|
||||
}
|
||||
|
||||
const CHUNK_SIZE = 2 ** 21;
|
||||
const RUN_TIME = 1000 * 60 * 60 * 5.5;
|
||||
const PROGRESS_UPDATE_FREQUENCY = 1000 * 60;
|
||||
@@ -31,7 +26,7 @@ const indexableRegions = [...REGIONS];
|
||||
let ids: number[] = [];
|
||||
const preDiscoveredManifest = (await fetch(
|
||||
asset('ids/manifest.json', !production),
|
||||
).then((response) => response.json())) as DiscoverIdsManifest;
|
||||
).then((response) => response.json())) as DiscoverIdsDefinitions;
|
||||
|
||||
console.log(
|
||||
`Fetching ${preDiscoveredManifest.chunks} pre-discovered chunks...`,
|
||||
@@ -163,7 +158,7 @@ function post() {
|
||||
chunks: idsChunked.length,
|
||||
count: ids.length,
|
||||
time: Date.now(),
|
||||
} satisfies DiscoverIdsManifest),
|
||||
} satisfies DiscoverIdsDefinitions),
|
||||
encoding: 'utf-8',
|
||||
path: 'ids/manifest.json',
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user