Set telemetry server ID when creating Komodo servers
This commit is contained in:
@@ -100,7 +100,8 @@ function buildEnv(args: {
|
||||
// config afterward, then rotate. A separate exec avoids quoted values
|
||||
// in EXTRA_ARGS, which Plutainer splits on whitespace.
|
||||
{ variable: 'PLUTAINER_MAP_ROTATE', value: 'false' },
|
||||
{ variable: 'PLUTAINER_EXTRA_ARGS', value: `+exec ${MAP_CONFIG_FILE} +map_rotate` },
|
||||
// Give telemetry scripts the registry name before the first map starts.
|
||||
{ variable: 'PLUTAINER_EXTRA_ARGS', value: `+exec ${MAP_CONFIG_FILE} +set tws_server_id ${args.name} +map_rotate` },
|
||||
{ variable: 'PLUTO_SERVER_KEY', value: args.plutoKey },
|
||||
{ variable: 'PLUTAINER_RCON_PASSWORD', value: config.rcon.password }
|
||||
];
|
||||
|
||||
@@ -63,7 +63,7 @@ describe('server creation map selection', () => {
|
||||
const spec = vi.mocked(komodoCreateDeployment).mock.calls[0][0];
|
||||
const env = Object.fromEntries(spec.environment.map(({ variable, value }) => [variable, value]));
|
||||
expect(env.PLUTAINER_MAP_ROTATE).toBe('false');
|
||||
expect(env.PLUTAINER_EXTRA_ARGS).toBe('+exec electric_cherry_map.cfg +map_rotate');
|
||||
expect(env.PLUTAINER_EXTRA_ARGS).toBe(`+exec electric_cherry_map.cfg +set tws_server_id ${serverName} +map_rotate`);
|
||||
expect(await readFile(join(fixture.t5, serverName, 'configs', 'electric_cherry_map.cfg'), 'utf8'))
|
||||
.toContain('set sv_maprotation "map zombie_cosmodrome"');
|
||||
expect(env.PLUTAINER_CONFIG_FILE).toBe('dedicated_sp.cfg');
|
||||
|
||||
Reference in New Issue
Block a user