Add T6 Zombies fleet support with Plutainer configuration

This commit is contained in:
2026-09-17 18:03:12 -04:00
parent 1350e6df7c
commit 9dcf4ac1d3
28 changed files with 492 additions and 146 deletions
+5 -4
View File
@@ -14,7 +14,7 @@
// - Line endings default to \n for the composed output. Baseline CRLF is
// preserved if the baseline uses CRLF throughout.
import { T5_ZOMBIE_MAPS } from './map-aliases.js';
import { selectedZombieMap, mapRotation } from './map-aliases.js';
interface CfgLine {
kind: 'set' | 'raw';
@@ -130,17 +130,18 @@ export function composeServerCfg(
baselineText: string,
overlays: OverlayInput[],
game: string | null,
map: string | null
map: string | null,
mapSlug?: string | null
): string {
const composed = composeCfg(baselineText, overlays);
const selected = game === 't5' ? T5_ZOMBIE_MAPS.find((entry) => entry.canonical === map) : undefined;
const selected = selectedZombieMap(game, map, mapSlug);
// Legacy/unrecognized servers retain their existing config semantics.
if (!selected) return composed;
const eol = parseCfg(composed).eol;
const lines = composed.split(/\r?\n/);
lines.pop(); // composeCfg always emits a trailing newline.
const rotation = `set sv_maprotation "map ${selected.canonical}"`;
const rotation = `set sv_maprotation "${mapRotation(selected)}"`;
// Dvars are case-insensitive. Remove duplicate assignments, including
// seta and bare forms, so old map-choice overlays cannot undo selection.
const isRotation = /^\s*(?:(?:set|seta)\s+)?sv_maprotation\s+/i;