Tally
10th February 2014, 15:43
I am writing a batch file with options to boot different types of server. I am stuck at booting first a dedicated server, then to parallel boot the client to that server. I am wondering if anyone knows the right syntax to do it.
This is what I have right now:
@echo off
set color=04e
color %color%
mode con: cols=80 lines=30
goto START
:START
echo __________________________________________________ ________
echo.
echo " _____ __ __ _ "
echo " | __ \ | \/ | | | "
echo " | | | | ___ _ __ ___ ___ _ __ | \ / | ___ __| | "
echo " | | | |/ _ \ '_ \` _ \/ _ \| '_ \| |\/| |/ _ \ / _ | "
echo " | |__| | __/ | | | | | (_) | | | | | | | (_) | (_| | "
echo " |_____/ \___|_| |_| |_|\___/|_| |_|_| |_|\___/ \__,_| "
echo " "
echo __________________________________________________ ________
goto MAKEOPTIONS
:MAKEOPTIONS
echo __________________________________________________ ________
echo.
echo Please select an option:
echo 1. Listen Server
echo 2. Dedicated Server
echo 3. Developers Server
echo.
echo 0. Exit
echo.
set /p make_option=:
set make_option=%make_option:~0,1%
if "%make_option%"=="1" goto LISTEN
if "%make_option%"=="2" goto DEDICATED & CLIENT
if "%make_option%"=="3" goto DEVELOPER
if "%make_option%"=="0" goto END
goto START
:LISTEN
echo.
echo.
@echo STARTING COD2 DEMONMOD LISTEN
@echo off
cd C:\Program Files (x86)\Activision\Call of Duty 2\
CoD2MP_s.exe +set fs_game mods/demon +exec mp-server.cfg +set sv_punkbuster 0 +map_rotate
goto END
:DEDICATED
echo.
echo.
@echo STARTING COD2 DEMOMOD DEDICATED
@echo off
cd C:\Program Files (x86)\Activision\Call of Duty 2\
CoD2MP_s.exe +set fs_game mods/demon +set dedicated 2 +set net_ip 86.26.148.175 +set net_port 28961 +exec mp-server.cfg +set sv_punkbuster 0 +map_rotate
:CLIENT
cd C:\Program Files (x86)\Activision\Call of Duty 2\
CoD2MP_s.exe +connect 86.26.148.175:28961
goto END
:DEVELOPER
echo.
echo.
@echo STARTING COD2 DEMOMOD DEVELOPER
@echo off
cd C:\Program Files (x86)\Activision\Call of Duty 2\
CoD2MP_s.exe +set fs_game mods/demon +set developer 1 +set developer_script 1 +exec mp-server.cfg +set sv_punkbuster 0 +map_rotate
goto END
:END
EXIT
What happens is, when I pick option 2, the dedicated server starts no problem, but I have to shut the server down before :CLIENT is executed.
Anyone know how to do it?
This is what I have right now:
@echo off
set color=04e
color %color%
mode con: cols=80 lines=30
goto START
:START
echo __________________________________________________ ________
echo.
echo " _____ __ __ _ "
echo " | __ \ | \/ | | | "
echo " | | | | ___ _ __ ___ ___ _ __ | \ / | ___ __| | "
echo " | | | |/ _ \ '_ \` _ \/ _ \| '_ \| |\/| |/ _ \ / _ | "
echo " | |__| | __/ | | | | | (_) | | | | | | | (_) | (_| | "
echo " |_____/ \___|_| |_| |_|\___/|_| |_|_| |_|\___/ \__,_| "
echo " "
echo __________________________________________________ ________
goto MAKEOPTIONS
:MAKEOPTIONS
echo __________________________________________________ ________
echo.
echo Please select an option:
echo 1. Listen Server
echo 2. Dedicated Server
echo 3. Developers Server
echo.
echo 0. Exit
echo.
set /p make_option=:
set make_option=%make_option:~0,1%
if "%make_option%"=="1" goto LISTEN
if "%make_option%"=="2" goto DEDICATED & CLIENT
if "%make_option%"=="3" goto DEVELOPER
if "%make_option%"=="0" goto END
goto START
:LISTEN
echo.
echo.
@echo STARTING COD2 DEMONMOD LISTEN
@echo off
cd C:\Program Files (x86)\Activision\Call of Duty 2\
CoD2MP_s.exe +set fs_game mods/demon +exec mp-server.cfg +set sv_punkbuster 0 +map_rotate
goto END
:DEDICATED
echo.
echo.
@echo STARTING COD2 DEMOMOD DEDICATED
@echo off
cd C:\Program Files (x86)\Activision\Call of Duty 2\
CoD2MP_s.exe +set fs_game mods/demon +set dedicated 2 +set net_ip 86.26.148.175 +set net_port 28961 +exec mp-server.cfg +set sv_punkbuster 0 +map_rotate
:CLIENT
cd C:\Program Files (x86)\Activision\Call of Duty 2\
CoD2MP_s.exe +connect 86.26.148.175:28961
goto END
:DEVELOPER
echo.
echo.
@echo STARTING COD2 DEMOMOD DEVELOPER
@echo off
cd C:\Program Files (x86)\Activision\Call of Duty 2\
CoD2MP_s.exe +set fs_game mods/demon +set developer 1 +set developer_script 1 +exec mp-server.cfg +set sv_punkbuster 0 +map_rotate
goto END
:END
EXIT
What happens is, when I pick option 2, the dedicated server starts no problem, but I have to shut the server down before :CLIENT is executed.
Anyone know how to do it?