conditionnal warmup for rounds
This commit is contained in:
parent
3c1c2d18e6
commit
a0ae297bf6
@ -31,10 +31,10 @@ router.post('/api/setup-game', is_authenticated, async (req, res) => {
|
|||||||
await rcon.execute_command(server_id, `game_mode 1`);
|
await rcon.execute_command(server_id, `game_mode 1`);
|
||||||
execute_cfg_on_server(server_id, './cfg/live_competitive_24.cfg');
|
execute_cfg_on_server(server_id, './cfg/live_competitive_24.cfg');
|
||||||
} else if (game == "3") {
|
} else if (game == "3") {
|
||||||
await rcon.execute_command(server_id, `game_mode 1`);
|
await rcon.execute_command(server_id, `game_mode 0`);
|
||||||
execute_cfg_on_server(server_id, './cfg/live_casual_16.cfg');
|
execute_cfg_on_server(server_id, './cfg/live_casual_16.cfg');
|
||||||
} else if (game == "4") {
|
} else if (game == "4") {
|
||||||
await rcon.execute_command(server_id, `game_mode 1`);
|
await rcon.execute_command(server_id, `game_mode 0`);
|
||||||
execute_cfg_on_server(server_id, './cfg/live_casual_24.cfg');
|
execute_cfg_on_server(server_id, './cfg/live_casual_24.cfg');
|
||||||
} else if (game == "5") {
|
} else if (game == "5") {
|
||||||
await rcon.execute_command(server_id, `game_mode 2`);
|
await rcon.execute_command(server_id, `game_mode 2`);
|
||||||
@ -44,9 +44,15 @@ router.post('/api/setup-game', is_authenticated, async (req, res) => {
|
|||||||
await rcon.execute_command(server_id, `changelevel ${map}`);
|
await rcon.execute_command(server_id, `changelevel ${map}`);
|
||||||
|
|
||||||
// Adding 1 second delay in executing warmup.cfg to make it effective after map has been changed.
|
// Adding 1 second delay in executing warmup.cfg to make it effective after map has been changed.
|
||||||
setTimeout(() => {
|
if (game == "1" || game == "3" || game == "5") {
|
||||||
execute_cfg_on_server(server_id, './cfg/warmup.cfg');
|
setTimeout(() => {
|
||||||
}, 1000)
|
execute_cfg_on_server(server_id, './cfg/warmup_16.cfg');
|
||||||
|
}, 1000)
|
||||||
|
} else if (game == "2" || game == "4") {
|
||||||
|
setTimeout(() => {
|
||||||
|
execute_cfg_on_server(server_id, './cfg/warmup_24.cfg');
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
return res.status(200).json({ message: 'Game Created!' });
|
return res.status(200).json({ message: 'Game Created!' });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user