Jump to content

midgetgrimm

Recommended Posts

Hello, here are my files on how I run my start/restart and how I monitor the server. There are better ways to do it, but this has worked for me for the last year. I had also shared this on the ALRPG forums, you might have seen it there as i see some familiar names here. Anyways, I use a folder called arma3serverconfig, not the one that EPOCH recommends, but all the same applies, its all about directory paths anyways

 

In the folder where your battle and BEC are you'll want to create a few files. The first being

 

restartserver.bat

@echo off

taskkill /f /fi "status eq not responding" /im arma3server.exe
taskkill /f /im arma3server.exe
timeout 1

taskkill /f /fi "status eq not responding" /im arma3.exe
taskkill /f /im arma3.exe
timeout 1

taskkill /im Bec.exe
taskkill /f /im cmd.exe /fi "windowtitle eq servermonitor.bat"
timeout 2
echo Kill all instances for safety

timeout 6
::CHANGE THE DIRECTORY BELOW TO THE PROPER LOCATION
set becpath="C:\arma3serverconfig\Bec\"
cd /d %becpath%
start "" /min "Bec.exe" -f Config.cfg
timeout 1
echo Battleye has started.. 
timeout 1
echo Starting ARMA 3 Server...
::CHANGE THE DIRECTORY BELOW TO THE PROPER LOCATION
cd C:\Games\ArmA3\A3Master
timeout 1
start "arma3" /min /high "arma3server.exe" -port=2322 "-config=C:\arma3serverconfig\config.cfg" "-cfg=C:\arma3serverconfig\basic.cfg" "-profiles=C:\arma3serverconfig" -name=SC "-mod=@Epoch;@EpochHive;@AllInArmaTerrainPackLite;" -world=empty -nosplash -noSound -noPause -enableHT -malloc=system
timeout 5
echo ARMA 3 Server has started
::CHANGE THE DIRECTORY BELOW TO THE PROPER LOCATION
set ServerMonitorPath="C:\arma3serverconfig\"
cd /d %ServerMonitorPath%
start "" "servermonitor.bat"
echo Server Monitor has started. Have Fun
timeout 3
exit

Make sure you change your directory locations, then we need 3 more files

 

servermonitor.bat

::Made by eRazeri - edited by [midgetgrimm]
@echo off
title servermonitor.bat
:start
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
echo Server is not running, will be started now 
:: SET DIRECTORY TO PROPER LOCATION
start "" /min /wait "C:\arma3serverconfig\restartserver.bat" 
timeout 30
echo Server started succesfully
goto started
:loop
cls
echo Server is already running, running monitoring loop
:started
:: THESE ARE WERFAULT AND TASK KILLS
taskkill /f /im WerFault.exe /fi "WINDOWTITLE eq Arma 3"
C:\Windows\System32\timeout /t 80
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
goto start

Again make sure to chagne your file locations and all that noise... 2 more to go

 

next is stopserver.bat

@echo off
taskkill /f /fi "status eq not responding" /im arma3server.exe
taskkill /f /im arma3server.exe
timeout 1

taskkill /f /fi "status eq not responding" /im arma3server.exe
taskkill /f /im arma3server.exe
timeout 1

taskkill /im Bec.exe


timeout 3
exit

Now this we need to call via BEC through the scheduler, so make sure you add a task in the scheduler.xml, like this, make sure you set correct filepath and how many hours until it runs


	<job id='8'>
		<day>1,2,3,4,5,6,7</day>
		<start>040000</start>
		<runtime>040000</runtime>
		<loop>0</loop>
		<cmd>C:\arma3serverconfig\stopserver.bat</cmd>
	</job>

Now for the last is the log rotator. you can use the one Epoch kindly provides are use this

rotate_logs.bat - I didn't write this one, but make sure you change and edit the file directory.

@echo off
:: Based off of Server Launch Script by r4z0r49
:: Script Modified and fixed by Sykotix - http://dayz.sykotix.com
::
:: Usage: dayzsrv-log-rotater.bat servername
:: Example 1 - Will update using default profile: dayzsrv-log-rotater.bat 
:: Example 2 - Will update using profile for US6: dayzsrv-log-rotater.bat US6

:::::::::::::: CONFIG ::::::::::::::::::

:: Set your Arma2AO Base installation directory. LEAVE OFF THE ENDING \
set arma2srvpath=D:

:: Set your Default server profile name. This is the name of the directory that stores your server.cfg
:: This will be used in the case that you don't launch this script without the server param.
:: Example: cfgdayz, US6, Chicago13, ect
:: DEFAULTPROFILE
set srvname=arma3serverconfig

:: Delete Original log files after they have been rotated? This keeps your logs more organized and saves space.
:: This will not work unless the server is stopped first. This option works best set to 1 when using FireDaemon's Pre/Post Service tab
set deloriglogs=1

::::::::::: ADVANCED CONFIG ::::::::::::
:: Don't touch anything below this point unless you know what your doing.

:: Setting Server Profile to Use
IF "%1"=="" (
set servername=%srvname%
) else (
set servername=%1
)

TITLE  DayZ %servername% Server Log Rotater

:: Set Debug Mode
set debug=0
:: Set Debug Timeout in seconds
set dbsecs=10

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::  STOP EDITING ::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Display Debug output
if %debug% == 1 (
echo Server Name = %servername%
echo ArmaII Server Path = "%arma2srvpath%"
timeout %dbsecs%
)

:: Set Time and Date
SET HOUR=%time:~0,2%
SET dtStamp9=%date:~-4%%date:~4,2%%date:~7,2%_0%time:~1,1%%time:~3,2%_%time:~6,2%
SET dtStamp24=%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%_%time:~6,2%
::Make Date Stamp
if "%HOUR:~0,1%" == " " (SET dtStamp=%dtStamp9%) else (SET dtStamp=%dtStamp24%)
ECHO Todays Date and time (%date%)(%time%) / %dtStamp%
if %debug% == 1 (
timeout %dbsecs%
)

echo (%date%) (%time%) Starting Log Rotation.

:: Make the Rotated Log Directorys
if exist "D:\arma3serverconfig\RotatedLogs" goto maketsdir
mkdir "D:\arma3serverconfig\RotatedLogs"
:maketsdir
if exist "D:\arma3serverconfig\RotatedLogs\%dtStamp%" goto makebedir
mkdir "D:\arma3serverconfig\RotatedLogs\%dtStamp%"
:makebedir
if exist "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye" goto rotatelogs
mkdir "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye"

:rotatelogs
:: Starting Log Rotation. If there are any other logs, just follow the format below, and make sure to NOT touch any of the varibles.
copy "%arma2srvpath%\%servername%\arma3server.RPT" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\arma3server.RPT"
copy "%arma2srvpath%\%servername%\server_log.txt" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\server_log.txt"
copy "%arma2srvpath%\%servername%\BattlEye\attachto.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\attachto.log"
copy "%arma2srvpath%\%servername%\BattlEye\addbackpackcargo.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\addbackpackcargo.log"
copy "%arma2srvpath%\%servername%\BattlEye\addweaponcargo.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\addweaponcargo.log"
copy "%arma2srvpath%\%servername%\BattlEye\deletevehicle.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\deletevehicle.log"
copy "%arma2srvpath%\%servername%\BattlEye\remotecontrol.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\remotecontrol.log"
copy "%arma2srvpath%\%servername%\BattlEye\selectplayer.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\selectplayer.log"
copy "%arma2srvpath%\%servername%\BattlEye\setvariableval.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\setvariableval.log"
copy "%arma2srvpath%\%servername%\BattlEye\teamswitch.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\teamswitch.log"
copy "%arma2srvpath%\%servername%\BattlEye\waypointcondition.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\waypointcondition.log"
copy "%arma2srvpath%\%servername%\BattlEye\waypointstatement.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\waypointstatement.log"
copy "%arma2srvpath%\%servername%\BattlEye\scripts.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\scripts.log"
copy "%arma2srvpath%\%servername%\BattlEye\createvehicle.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\createvehicle.log"
copy "%arma2srvpath%\%servername%\BattlEye\mpeventhandler.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\mpeventhandler.log"
copy "%arma2srvpath%\%servername%\BattlEye\publicvariable.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\publicvariable.log"
copy "%arma2srvpath%\%servername%\BattlEye\publicvariableval.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\publicvariableval.log"
copy "%arma2srvpath%\%servername%\BattlEye\remoteexec.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\remoteexec.log"
copy "%arma2srvpath%\%servername%\BattlEye\setdamage.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\setdamage.log"
copy "%arma2srvpath%\%servername%\BattlEye\setpos.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\setpos.log"
copy "%arma2srvpath%\%servername%\BattlEye\setvariable.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\setvariable.log"
copy "%arma2srvpath%\%servername%\BattlEye\addmagazinecargo.log" "D:\arma3serverconfig\RotatedLogs\%dtStamp%\BattlEye\addmagazinecargo.log"
echo (%date%) (%time%) Logs are backed up now...
echo (%date%) (%time%) Removing original log files.
del /Q /F "%arma2srvpath%\%servername%\arma3server.RPT"
del /Q /F "%arma2srvpath%\%servername%\server_log.txt"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\attachto.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\addbackpackcargo.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\addweaponcargo.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\deletevehicle.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\remotecontrol.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\selectplayer.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\setvariableval.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\teamswitch.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\waypointcondition.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\waypointstatement.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\scripts.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\createvehicle.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\mpeventhandler.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\publicvariable.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\publicvariableval.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\remoteexec.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\setdamage.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\setpos.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\setvariable.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\addmagazinecargo.log"

if %debug% == 1 (
timeout %dbsecs%
)

:: We're done here.
exit

This is what I use and it works well. I saw 2 others on here that are nice too, but it's always nice to have options. Cheers

 

Then just run the restartserver.bat and you should see your logs rotate, then BEC starts, then A3 starts. Once all started that closes and starts the server monitor and just keeps in check until restart. Try to never shut down the database as it takes a few to finish syncing. Thanks, really loving epoch now, can't wait until it gets completely opened up!

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
  • 2 weeks later...

I know and the reason is brash and without fore-thought, he feels this "allows" monitization, rather, it "Regulates" it... Respect lost from this developer.

 

Anyway,

Just FYI,

 

All you have to do is block any request done to ibattle.org by Bec. either in your sw firewall (windows firewall) or on your router
Bec will work normally after that. with the exception of the reporter account and version checking.

 

There are some alternative BE Clients being prepared, hopefully one will surface soon before any arma 3 updates break this one seeing as there will not be any more updates.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...