fix const names

This commit is contained in:
shoopea
2024-10-29 20:25:01 +01:00
parent e9182933ca
commit 3133176813
3 changed files with 13 additions and 13 deletions

View File

@@ -13,8 +13,8 @@ router.post('/api/setup-game', is_authenticated, async (req, res) => {
const server_id = req.body.server_id;
const team1 = req.body.team1;
const team2 = req.body.team2;
const selected_map = req.body.selectedMap;
const game_sel = req.body.game_sel.toString();
const map = req.body.map;
const game = req.body.game.toString();
if (team1.trim() != "") {
await rcon.execute_command(server_id, `mp_teamname_1 "${team1}"`);
@@ -24,24 +24,24 @@ router.post('/api/setup-game', is_authenticated, async (req, res) => {
await rcon.execute_command(server_id, `mp_teamname_2 "${team2}"`);
}
if (game_sel == "1") {
if (game == "1") {
await rcon.execute_command(server_id, `game_mode 1`);
execute_cfg_on_server(server_id, './cfg/live_competitive_16.cfg');
} else if (game_sel == "2") {
} else if (game == "2") {
await rcon.execute_command(server_id, `game_mode 1`);
execute_cfg_on_server(server_id, './cfg/live_competitive_24.cfg');
} else if (game_sel == "3") {
} else if (game == "3") {
await rcon.execute_command(server_id, `game_mode 1`);
execute_cfg_on_server(server_id, './cfg/live_casual_16.cfg');
} else if (game_sel == "4") {
} else if (game == "4") {
await rcon.execute_command(server_id, `game_mode 1`);
execute_cfg_on_server(server_id, './cfg/live_casual_24.cfg');
} else if (game_sel == "5") {
} else if (game == "5") {
await rcon.execute_command(server_id, `game_mode 2`);
execute_cfg_on_server(server_id, './cfg/live_wingman.cfg');
}
await rcon.execute_command(server_id, `mp_warmup_pausetimer 1`);
await rcon.execute_command(server_id, `changelevel ${selected_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.
setTimeout(() => {