Night on every third restart?

spectrez

Member
Staff member
ive been looking for ways to make a good day/night cycle on a server with a short restart, without using a accelerater script.

CPC apparently uses such a system that im looking for, but wether its custom made or something old that isnt around anymore i dno.

have anyone heard of this? the closest i got to a possible way of making it work was with 2 hivi.ini's
 
I take it this means we can't write conditionals to the hiveExt.ini? was going to set up a few arrays to match the server reboot hour and tell it what starting time to use...
 
I use the two hive.ini method. It works nicely. You need BEC and root access to arma2 or server install folder for this though.

First you have to set your Scheduler.xml to the restart times you want. I have mine set for 3 hour restarts at 3,6,9,12. At 21:00:00 (9PM) I have it set to run a special .bat file to make it night. At all other restarts I have it set to run the regular .bat file to make it day. Like this:

Day:
Code:
<job id="21">
    <time>12:00:00</time>
    <day>1,2,3,4,5,6,7</day>
    <loop>1</loop>
    <cmd>A:\restartserver.bat</cmd>
    <cmdtype>1</cmdtype>
</job>

Night:
Code:
<job id="54">
    <time>21:00:00</time>
    <day>1,2,3,4,5,6,7</day>
    <loop>1</loop>
    <cmd>A:\restartservernight.bat</cmd>
    <cmdtype>1</cmdtype>
</job>

And here are the corresponding .bat files:

Day:
Code:
@echo off

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

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

taskkill /im Bec.exe
timeout 1

cd A:\cfgdayz
start "" "rotate_logs.bat"
timeout 5

xcopy /Y A:\cfgdayz\day\HiveExt.ini A:\cfgdayz\
timeout 1

cd A:\Arma2\SteamApps\common\Arma 2 Operation Arrowhead

start "arma2" /high "Expansion\beta\arma2oaserver.exe" -port=2302 "-config=A:\config.cfg" "-cfg=A:\basic.cfg" "-profiles=A:\cfgdayz" -name=cfgdayz "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;" -nosplash -noSound -noPause -bandwidthAlg=2
timeout 6

set becpath="A:\Bec\"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg

Night:
Code:
@echo off

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

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

taskkill /im Bec.exe
timeout 1

cd A:\cfgdayz
start "" "rotate_logs.bat"
timeout 5

xcopy /Y A:\cfgdayz\night\HiveExt.ini A:\cfgdayz\
timeout 5

cd A:\Arma2\SteamApps\common\Arma 2 Operation Arrowhead

start "arma2" /high "Expansion\beta\arma2oaserver.exe" -port=2302 "-config=A:\config.cfg" "-cfg=A:\basic.cfg" "-profiles=A:\cfgdayz" -name=cfgdayz "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;" -nosplash -noSound -noPause -bandwidthAlg=2
timeout 3

set becpath="A:\Bec\"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg
timeout 1

As you can see they are identical except one overwrites the HiveExt.ini file for day and the other for night. The HiveExt.ini files are also identical except the time settings:

In day HiveExt.ini (starts at Noon):
Code:
[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Static
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 12

In night HiveExt.ini (starts at 8PM):
Code:
[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Static
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 20







1. Question: Can i make it run with having only full ftp-access?

I think root is not the same like fpt isnt it ?

2.Question: Do i have to edit the path : <cmd>A:\restartserver.bat</cmd>
Could be : <cmd>C:/Desktop/restartserver.bat</cmd> ??

3.Question: Why is in the night.bat in the last line this : timeout 1 ??
 
Last edited:
Back
Top