-
Notifications
You must be signed in to change notification settings - Fork 0
/
KF_Server_Launcher_9727_KFLV93.bat
68 lines (47 loc) · 1.81 KB
/
KF_Server_Launcher_9727_KFLV93.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@echo off
:: batch title and logs
title= KFLv93
set "_runStat="
set _servBat=KFserver
set _servLog=.\logs\%_servBat%.bat.log
set _gameLog=.\logs\%_servBat%.log
:: server command line
set _gameCmd=ucc server KF-Anschar.rom?game=KFLv93.KFLGameType?VACSecured=true?Mutator=KFLv93.MutLoader?MaxPlayers=6?AdminName=raiden4242?AdminPassword=password?ini=KillingFloorKFLV93_9727.ini -nolog
set _gameCmd=%_gameCmd% -log=%_gameLog%
echo ::
echo :: This batch will autorun %_servBat%.
echo :: -to restart %_servBat%, end the ucc server task.
echo :: -to shut down %_servBat%, ctrl-c or close this window.
echo ::
if exist ucc.exe (echo :: %_servBat% initializing...) else (echo :: ucc server not found! & echo :: This batch is to be run in the KF system directory. & goto:eof)
:: log server start/create batch log
echo ::
echo :: Output logged to %_servLog%
if exist %_servLog% (echo ::%_servBat% Start:: >>%_servLog%) else (md logs & echo ::%_servBat% Start:: >%_servLog%)
echo %_gameCmd% >>%_servLog%
:: start/restart server
:start
:: backup last server log
echo ::
echo :: Backup %_gameLog:.\logs\=%...
set _logTime=%_servBat%-%DATE:/=-%_%TIME:~0,2%.%TIME:~3,2%.log
set _logTime=%_logTime: =0%
if exist %_gameLog% (ren %_gameLog% %_logTime% & echo :: %_logTime% & echo :: Backup complete.) else (echo :: No log to backup.)
echo ::
:: log batch restart
if defined _runStat (echo :: Restart %_servBat%)
echo :: %date%
echo :: %time: =0%
echo ::
if defined _runStat (echo :Restart %_servBat%: >>%_servLog%)
if exist .\logs\%_logTime% (echo %_logTime% >>%_servLog%) else (echo No log to backup. >>%_servLog%)
echo %date% >>%_servLog%
echo %time: =0% >>%_servLog%
set "_logTime="
:: run the server
call %_gameCmd%
set _runStat=1
:: restart on exit/error
timeout 60
goto start
::