Add T6 Zombies fleet support with Plutainer configuration
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { parseServerName, T5_ZOMBIE_MAPS } from '../map-aliases.js';
|
||||
import { parseServerName, T5_ZOMBIE_MAPS, T6_ZOMBIE_MAPS, zombieMaps } from '../map-aliases.js';
|
||||
|
||||
export function mapTitle(map: string | null | undefined): string {
|
||||
return T5_ZOMBIE_MAPS.find((entry) => entry.canonical === map?.toLowerCase())?.friendly ?? map ?? '—';
|
||||
return [...T5_ZOMBIE_MAPS, ...T6_ZOMBIE_MAPS].find((entry) => entry.canonical === map?.toLowerCase())?.friendly ?? map ?? '—';
|
||||
}
|
||||
|
||||
export function serverTitle(name: string): string {
|
||||
const parsed = parseServerName(name);
|
||||
if (!parsed || parsed.game.toLowerCase() !== 't5' ||
|
||||
if (!parsed || !['t5', 't6'].includes(parsed.game.toLowerCase()) ||
|
||||
(parsed.gameMode !== null && parsed.gameMode !== 'zombie') || !parsed.mapCanonical) {
|
||||
return name;
|
||||
}
|
||||
const title = mapTitle(parsed.mapCanonical);
|
||||
const title = zombieMaps(parsed.game).find((entry) => entry.slug === parsed.mapSlug)?.friendly ?? mapTitle(parsed.mapCanonical);
|
||||
return parsed.lobby === null ? title : `${title} · Lobby ${parsed.lobby}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user