This commit is contained in:
tresabhi committed 2026-08-09 16:12:26 -05:00
1 parent f45b24f7ab
commit b52c1fc2d9
1 file changed
+13 -8
+13 -8
View File
@@ -16,7 +16,7 @@ interface RegionDescriptor {
domain: string; domain: string;
seed: number; seed: number;
max: number; max: number;
streak: number; dry_streak: number;
} }
export interface QuickInfo { export interface QuickInfo {
@@ -110,9 +110,9 @@ if (discoveredChunks.length === manifest.chunks) {
} }
const regions: RegionDescriptor[] = [ const regions: RegionDescriptor[] = [
{ domain: "eu", seed: 5e8, max: 10e8 - 1, streak: 0 }, { domain: "eu", seed: 5e8, max: 10e8 - 1, dry_streak: 0 },
{ domain: "com", seed: 10e8, max: 20e8 - 1, streak: 0 }, { domain: "com", seed: 10e8, max: 20e8 - 1, dry_streak: 0 },
{ domain: "asia", seed: 20e8, max: 31e8 - 1, streak: 0 }, { domain: "asia", seed: 20e8, max: 31e8 - 1, dry_streak: 0 },
]; ];
console.log("Finding new seed ids..."); console.log("Finding new seed ids...");
@@ -192,15 +192,16 @@ let regionI = 0;
function fillQueue() { function fillQueue() {
if (queue.length >= 1) return; if (queue.length >= 1) return;
while (regions.length > 0) {
regionI = (regionI + 1) % regions.length; regionI = (regionI + 1) % regions.length;
const region = regions[regionI]; const region = regions[regionI];
if (region.streak >= MAX_DRY_STREAK) { if (region.dry_streak >= MAX_DRY_STREAK) {
console.log( console.log(
`Removing region ${region.domain} removed due to ${region.streak} dry streak...`, `Removing region ${region.domain} removed due to ${region.dry_streak} dry streak...`,
); );
regions.splice(regionI, 1); regions.splice(regionI, 1);
return; continue;
} }
const id0 = region.seed; const id0 = region.seed;
@@ -224,6 +225,9 @@ function fillQueue() {
); );
regions.splice(regionI, 1); regions.splice(regionI, 1);
} }
return;
}
} }
function sleep() { function sleep() {
@@ -274,8 +278,9 @@ while (withinTimeLimit() && regions.length > 0) {
} }
if (foundIds === 0) { if (foundIds === 0) {
request.region.streak += request.size; request.region.dry_streak += request.size;
} else { } else {
request.region.dry_streak = 0;
// console.log(`Found ${foundIds} ids in ${request.region.domain}`); // console.log(`Found ${foundIds} ids in ${request.region.domain}`);
} }
} }