test workshop maps
This commit is contained in:
@@ -16,6 +16,23 @@ router.post('/api/setup-game', is_authenticated, async (req, res) => {
|
||||
const map = req.body.map;
|
||||
const game = req.body.game.toString();
|
||||
|
||||
switch(map){
|
||||
case "de_assembly":
|
||||
map = 3071005299;
|
||||
break;
|
||||
case "de_memento":
|
||||
map = 3165559377;
|
||||
break;
|
||||
case "de_palais":
|
||||
map = 3257582863;
|
||||
break;
|
||||
case "de_whistle":
|
||||
map = 3308613773;
|
||||
break;
|
||||
default:
|
||||
map = map;
|
||||
}
|
||||
|
||||
if (team1.trim() != "") {
|
||||
await rcon.execute_command(server_id, `mp_teamname_1 "${team1}"`);
|
||||
}
|
||||
@@ -61,7 +78,11 @@ router.post('/api/setup-game', is_authenticated, async (req, res) => {
|
||||
execute_cfg_on_server(server_id, './cfg/live_arms_race.cfg');
|
||||
}
|
||||
|
||||
await rcon.execute_command(server_id, `changelevel ${map}`);
|
||||
if (isNaN(map)) {
|
||||
await rcon.execute_command(server_id, `changelevel ${map}`);
|
||||
} else {
|
||||
await rcon.execute_command(server_id, `host_workshop_map ${map}`);
|
||||
}
|
||||
|
||||
// Adding 1 second delay in executing warmup.cfg to make it effective after map has been changed.
|
||||
if (game == "1" || game == "3" || game == "5") {
|
||||
|
||||
Reference in New Issue
Block a user