• 0
kryptedbbkick

Arma 3 Exile Logging issue

Question

Hello there everyone!

So i am having a little bit of an issue im hoping someone here can help me with.

So i use to use TADST to always start up my server and get it going but doing this meant i would have to go back and stop it and restart it. This got very frustrating so i came up with a new idea. In the server_config.pbo i put tru for auto restart and the restart timer for how long it took to let the server load before it accepted players. Doing this worked for about 3 restarts so that was another issue and to add on to that one the server clock would keep counting down so once it hit 00:00 for the first time and did its restart it would keep going and saying -00:01, -00:02, -00:03 etc... so to fix this i put these settings.

class RCON
	{
		/*
			Note that for this to work you need to have serverCommandPassowrd defined in config.cfg and BE enabled
		*/

		// This needs to match config.cfg serverCommandPassword
		serverPassword = "Darkally7";

		// Autolocks server until its ready to accept players
		useAutoLock = 1;

		// Server will autoLock at that time before restart (minutes)
		restartAutoLock = 2;

		/*
			Number of hours and minutes of your restart period.

			Examples:

			{4, 0} = Every 4 hours
			{1, 30} = Every one and a half hour (who the hell would do this?)
		*/
		restartTimer[] = {4, 0};

		/*
			Kicks players before restart to prevent gear loss.
			We strongely recommend to use this!

			0 = off
			1 = on
		*/
		useAutoKick = 1;

		/*
			Number of minutes before the server kicks players that did
			not disconnect before the restart. Should at least be two
			minutes!
		*/
		kickTime = 2;

		/*
			Self-explanatory

			0 = off
			1 = on
		*/
		useRestartMessages = 1;

		/*
			Number of minutes before the restart to inform your players.

			Only use full minutes here. Value like 5.5 have not been tested.
		*/
		restartWarningTime[] = {15, 10, 5, 3}; 

		/* 
			If set to 1 server will execute '#shutdown',
			to try to shutdown the server
		*/

		useShutdown = 1;
	};

Now after putting all of that the server would restart every 4 hours. At the bottom i put "useShutdown =1;" this would combat my clock issue i had allowing the server to have a fresh restart. To launch the server back up i used a custom ".bat" file like this.

@echo off
cls

color 0A

set gameserver=Arma Exile

title %gameserver% Auto Restart / Process Checker

:start


REM Time till Auto Restart.
set hours="4"
set minutes="0"
set seconds="0"

REM // Launch parameters
start "Exile" /high "arma3server.exe" -port=2302 "-mod=@Exile;@CUP Units;@CUP Vehicles;@CUP Weapons;@CBA_A3;@Ryanzombies;@Arma Enhanced Movement" "-config=C:\Users\steph\Desktop\Arma 3 Server\TADST\default\TADST_config.cfg""-cfg=C:\Users\steph\Desktop\Arma 3 Server\TADST\default\TADST_basic.cfg" "-profiles=C:\Users\steph\Desktop\Arma 3 Server\TADST\default" -netlog -filePatching -pid=pid.log -ranking=ranking.log "-mod=@Exile;@CUP Units;@CUP Vehicles;@CUP Weapons;@CBA_A3;@Ryanzombies;@Arma Enhanced Movement" -autoInit -filePatching -servermod=@AdminToolkitServer;@ExileServer;



REM Pull, display and create some time functions
for /f "delims=" %%G IN ('powershell "(get-date %time%).AddHours(%hours%).AddMinutes(%minutes%).AddSeconds(%seconds%).ToString('yyyyMMddHHmmss')"') do set endtime=%%G
for /f "delims=" %%G IN ('powershell "(get-date %time%).ToString('HH:mm:ss')"') do set nowtimeclean=%%G
for /f "delims=" %%G IN ('powershell "(get-date %time%).AddHours(%hours%).AddMinutes(%minutes%).AddSeconds(%seconds%).ToString('HH:mm:ss')"') do set endtimeclean=%%G

echo %time% - %gameserver% Server started at %nowtimeclean% and will restart at %endtimeclean%

:checkarma

for /f "delims=" %%G IN ('powershell "(get-date %time%).ToString('yyyyMMddHHmmss')"') do set nowtime=%%G

REM ////////// TIMER CHECK ///////////
if "%nowtime%" gtr "%endtime%" (
echo %time% - It is time to restart %gameserver%!
echo.
echo.
goto restartarma
)
REM ////////// END TIMER CHECK ///////////

REM ////////// PROCESS CHECK ///////////
tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | find /I /N "arma3server.exe">NUL
if "%ERRORLEVEL%"=="1" (
echo %time% - The process is not running, restart %gameserver%!
echo.
echo.
goto restartarma
)
REM ////////// END PROCESS CHECK ///////////


REM restart not needed. Check again in 3 seconds.
TIMEOUT /T 3 /NOBREAK >NUL
goto checkarma


:restartarma
REM Either the server crashed or it is time for a restart. Kill the process and go to start.
START taskkill /f /im arma3server.exe 2>nul
TIMEOUT /T 3 /NOBREAK >NUL
goto start


@if exist net.log goto rotatelog else end

:rotatelog
set str=%date%
set tme=%time%
rem echo."%str%" "%tme%"
for /f "tokens=1,2,3* delims=." %%i in ("%str%") do set str=%%k%%j%%i
for /f "tokens=1,2,3* delims=:." %%i in ("%tme%") do set tme=%%i%%j%%k
rem echo."%str%" "%tme%"
move net.log .\NetLogs\%str%_%tme%_net.log
set str=
set tme=

REM This will activate -netlog.
:end
"C:\Users\steph\Desktop\Arma 3 Server\arma3server.exe" "-mod=@Exile;@CUP Units;@CUP Vehicles;@CUP Weapons;@CBA_A3;@Ryanzombies;@Arma Enhanced Movement" "-config=C:\Users\steph\Desktop\Arma 3 Server\TADST\default\TADST_config.cfg""-cfg=C:\Users\steph\Desktop\Arma 3 Server\TADST\default\TADST_basic.cfg" "-profiles=C:\Users\steph\Desktop\Arma 3 Server\TADST\default" -netlog -filePatching -pid=pid.log -ranking=ranking.log "-mod=@Exile;@CUP Units;@CUP Vehicles;@CUP Weapons;@CBA_A3;@Ryanzombies;@Arma Enhanced Movement" -autoInit -filePatching -servermod=@AdminToolkitServer;@ExileServer;

What this will do is when the Arma3Server.exe is no longer running the server will relaunch it using the startup parameter inside of the launch parameter filed.

This was going to be used incase the server crashes but also the .bat file will wait every 4 hours to force shut down on the Arma3Server.exe incase the  

"useShutdown =1;" fails to work. So in the end the entire program works just like the TADST of course using the extracted setup files from TADST. Now that you know the work around at the end of the .bat file 

starting from "@if exist net.log goto rotatelog else end" and down this 16 lines of code is used to save the "LOG" files from the console. It works but unlike the TADST where it would save the next log file as a higher number for example 1, 2, 3, 4, 5, etc. My bat file saves it as 2, 8, 5, 7, 9, 1, etc... is there anyone that can look over this and help me out.

Share this post


Link to post
Share on other sites

0 answers to this question

There have been no answers to this question yet

Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.