/**
 * Generate a JSON server config for Arma Reforger dedicated server.
 */
export function generateServerConfig(opts) {
    const port = opts.port ?? 2001;
    const a2sPort = opts.a2sPort ?? 17777;
    const config = {
        dedicatedServerId: "",
        region: "US",
        gameHostBindAddress: "",
        gameHostBindPort: port,
        gameHostRegisterBindAddress: "",
        gameHostRegisterPort: port,
        a2s: {
            address: "",
            port: a2sPort,
        },
        game: {
            name: opts.name,
            password: opts.password ?? "",
            scenarioId: opts.scenarioId ?? "",
            maxPlayers: opts.maxPlayers ?? 32,
            visible: opts.visible ?? false,
            gameProperties: {
                serverMaxViewDistance: 1600,
                serverMinGrassDistance: 50,
                fastValidation: true,
                battlEye: false,
            },
            mods: buildModList(opts),
        },
    };
    return JSON.stringify(config, null, 2);
}
function buildModList(opts) {
    if (!opts.modName && !opts.modId)
        return [];
    return [
        {
            modId: opts.modId ?? "",
            name: opts.modName ?? "",
            version: "",
        },
    ];
}
//# sourceMappingURL=server-config.js.map