Apply selected server maps automatically without config overlays

This commit is contained in:
2026-09-17 11:05:01 -04:00
parent 1cd4eb6f09
commit 3f0d6dd87d
12 changed files with 431 additions and 59 deletions
+6 -1
View File
@@ -32,6 +32,11 @@ export const T5_ZOMBIE_MAPS: readonly T5MapEntry[] = Object.freeze([
const BY_SLUG: ReadonlyMap<string, T5MapEntry> = new Map(
T5_ZOMBIE_MAPS.map((m) => [m.slug, m])
);
// Older folder names used friendly names (shi_no_numa) instead of engine
// slugs (sumpf). Keep deriving their canonical map from the same catalog.
const BY_FRIENDLY_SLUG: ReadonlyMap<string, T5MapEntry> = new Map(
T5_ZOMBIE_MAPS.map((m) => [m.friendly.toLowerCase().replace(/[^a-z0-9]/g, ''), m])
);
export function t5ZombieMapBySlug(slug: string): T5MapEntry | undefined {
return BY_SLUG.get(slug.toLowerCase());
@@ -81,6 +86,6 @@ export function parseServerName(name: string): ParsedServerName | null {
if (slugParts.length === 0) return null;
const mapSlug = slugParts.join('').toLowerCase();
const mapCanonical = BY_SLUG.get(mapSlug)?.canonical ?? null;
const mapCanonical = (BY_SLUG.get(mapSlug) ?? BY_FRIENDLY_SLUG.get(mapSlug))?.canonical ?? null;
return { game, gameMode, mapSlug, mapCanonical, lobby };
}