This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
import { sha256Buffer } from '../fleet/files.js';
|
||||
import type { NativeLaunchInput } from './launch-preparation.js';
|
||||
import { choosePlacement, type PlacementOptions } from '../hosts/capacity.js';
|
||||
import { isPrivateConfigPath } from '../fleet/private-config.js';
|
||||
|
||||
parentPort!.on(
|
||||
'message',
|
||||
@@ -79,12 +80,16 @@ parentPort!.on(
|
||||
'electric_cherry_bank.cfg'
|
||||
);
|
||||
if (
|
||||
recipe.files.some(
|
||||
(file) =>
|
||||
posix.join(relDestForKind(file.kind, recipe.game), file.path) === bankPath
|
||||
recipe.files.some((file) =>
|
||||
isPrivateConfigPath(
|
||||
posix.join(relDestForKind(file.kind, recipe.game), file.path),
|
||||
recipe.game
|
||||
)
|
||||
)
|
||||
)
|
||||
throw new Error('electric_cherry_bank.cfg is reserved for instance credentials.');
|
||||
throw new Error(
|
||||
'Private configuration files are reserved for instance credentials.'
|
||||
);
|
||||
const payload = {
|
||||
...(input.activationId ? { stageId: input.activationId } : {}),
|
||||
name: instance.server,
|
||||
@@ -95,13 +100,14 @@ parentPort!.on(
|
||||
bindAddress: instance.bind_address,
|
||||
rconPassword: password,
|
||||
bank: { token: input.bankToken, configPath: bankPath },
|
||||
...(input.moderation ? { moderation: input.moderation } : {}),
|
||||
env: {
|
||||
PLUTAINER_SERVER_NAME: instance.server,
|
||||
PLUTAINER_PORT: String(instance.port),
|
||||
PLUTAINER_GAME: recipe.game === 't6' ? 't6zm' : 't5sp',
|
||||
PLUTAINER_CONFIG_FILE: recipe.configFile,
|
||||
PLUTAINER_MAP_ROTATE: 'false',
|
||||
PLUTAINER_EXTRA_ARGS: `+exec electric_cherry_map.cfg +exec electric_cherry_bank.cfg +set tws_server_id ${instance.server} +map_rotate`,
|
||||
PLUTAINER_EXTRA_ARGS: `+exec electric_cherry_map.cfg +exec electric_cherry_bank.cfg${input.moderation ? ' +exec electric_cherry_moderation.cfg' : ''} +set tws_server_id ${instance.server} +map_rotate`,
|
||||
PLUTO_SERVER_KEY: input.serverKey
|
||||
},
|
||||
files: recipe.files.map((file) => ({
|
||||
|
||||
Reference in New Issue
Block a user