[GUIDE] How to setup BEC for notifications and auto restarts

  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;
Hello Wastelanders!

NB: This guide assumes you have access to your server dedicated box! As many hosted environments are different, please check with your provider should you not have access to your machine for supporting BEC.

Right ! Let's get started ! If anyone sees anything missing here - please add ;>

I thought I'd make a quick post and share my experience over the last day or so setting up a dedicated box with Battleye Extended Controls using the Scheduler to notify and auto restart !

I will try and make everything as clear as possible, however, you will be required to edit a few files in order to ensure everything starts up and is looking at the right directories!

BEC INSTALLATION AND SETUP

1) Okay!  grab BEC here - http://ibattle.org and extract it to where you want to run it from. I've put mine in my Arma 3 server root under \BEC
2) Once you have the BEC files there , you will need to edit the \BEC\Config\config.cfg ( use something like notepad++ )
3) Change all the parameters here that you require for your server , ports etc and unremark the Scheduler.xml part to ensure that the scheduler is parsed at startup. - read through the different options in the Config file.
4) Once you have made all the changes here, you can go look at the BEC\Config\Scheduler.xml ( again use Notepad++ ) Important to remember is that you HAVE to maintain the correct syntax here else your Scheduler will fail at initialization.
5) Add your admins to the BEC\Config\Admins.xml

Here is my Scheduler.xml - I announce 10,5 and 1 Minute before restarts, and restart at 12am,6am,12pm,6pm

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Scheduler>

<!-- this job will start after 2 minutes and run forever with a 15 minutes interval between the jobs -->
<job id='0'>
<day>1,2,3,4,5,6,7</day>
<start>000120</start>
<runtime>001500</runtime>
<loop>-1</loop>
<cmd>say -1 This server auto restarts 4 times per day, 06:00, 12:00, 18:00 and 00:00</cmd>
</job>

<!-- 06:00 restart -->
<job id='1'>
<day>1,2,3,4,5,6,7</day>
<start>05:50:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>say -1 The server will auto restart in 10 minutes.</cmd>
</job>

<job id='2'>
<day>1,2,3,4,5,6,7</day>
<start>05:55:00</start>
<runtime>000025</runtime>
<loop>5</loop>
<cmd>say -1 The server will auto restart in 5 minutes.</cmd>
</job>

<job id='3'>
<day>1,2,3,4,5,6,7</day>
<start>05:59:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>say -1 The server will auto restart in 60 seconds.</cmd>
</job>

<!-- 12:00 restart -->
<job id='4'>
<day>1,2,3,4,5,6,7</day>
<start>11:50:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>say -1 The server will auto restart in 10 minutes.</cmd>
</job>

<job id='5'>
<day>1,2,3,4,5,6,7</day>
<start>11:55:00</start>
<runtime>000025</runtime>
<loop>5</loop>
<cmd>say -1 The server will auto restart in 5 minutes.</cmd>
</job>

<job id='6'>
<day>1,2,3,4,5,6,7</day>
<start>11:59:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>say -1 The server will auto restart in 60 seconds.</cmd>
</job>

<!-- 18:00 restart -->
<job id='7'>
<day>1,2,3,4,5,6,7</day>
<start>17:50:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>say -1 The server will auto restart in 10 minutes.</cmd>
</job>

<job id='8'>
<day>1,2,3,4,5,6,7</day>
<start>17:55:00</start>
<runtime>000025</runtime>
<loop>5</loop>
<cmd>say -1 The server will auto restart in 5 minutes.</cmd>
</job>

<job id='9'>
<day>1,2,3,4,5,6,7</day>
<start>17:59:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>say -1 The server will auto restart in 60 seconds.</cmd>
</job>

<!-- 24:00 restart -->
<job id='10'>
<day>1,2,3,4,5,6,7</day>
<start>23:50:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>say -1 The server will auto restart in 10 minutes.</cmd>
</job>

<job id='11'>
<day>1,2,3,4,5,6,7</day>
<start>23:55:00</start>
<runtime>000025</runtime>
<loop>5</loop>
<cmd>say -1 The server will auto restart in 5 minutes.</cmd>
</job>

<job id='12'>
<day>1,2,3,4,5,6,7</day>
<start>23:59:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>say -1 The server will auto restart in 60 seconds.</cmd>
</job>

<job id='13'>
<day>1,2,3,4,5,6,7</day>
<start>06:00:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>C:\Dedicated Servers\Games\A3Wasteland Stratis\Server.cmd</cmd>
</job>

<job id='14'>
<day>1,2,3,4,5,6,7</day>
<start>12:00:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>C:\Dedicated Servers\Games\A3Wasteland Stratis\Server.cmd</cmd>
</job>

<job id='15'>
<day>1,2,3,4,5,6,7</day>
<start>18:00:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>C:\Dedicated Servers\Games\A3Wasteland Stratis\Server.cmd</cmd>
</job>

<job id='16'>
<day>1,2,3,4,5,6,7</day>
<start>00:00:00</start>
<runtime>000000</runtime>
<loop>0</loop>
<cmd>C:\Dedicated Servers\Games\A3Wasteland Stratis\Server.cmd</cmd>
</job>

</Scheduler>

Note the last 4 entries are where you will call your server restart script which I will post in a minute here ... You will need to amend this Scheduler.xml to point to your file paths.

BATCH FILE INSTALLATION AND SETUP - Thanks LouD for posting your batch files

I use a combination of 5 batch files which I have customized slightly to suit my requirements - feel free to add or amend to these. All my batch files are in my arma3 root.

Use the single batch file provided a few posts below ^_^;

1) Make sure to edit each of these files and ensure all your file paths are correct for your installation.

Here are the files and their purpose:
server.cmd - This Starts Everything (ALWAYS run as administrator )
servermonitor.cmd - Monitors the arma3server.exe process and restarts if it's down
becmonitor.cmd - Monitors the bec.exe process and restarts if it's down
restartbec.cmd - Is called by the becmonitor.cmd if the server is not responding
restartserver.cmd Is called by the servermonitor.cmd if the server is not responding

Once you have done that you should have a better understanding of using the scheduler and the required files. When you run the server.cmd file, it will close arma3server and any monitors you have open, and restart them along with BEC. Make sure when your BEC starts that it says Scheduling xx Tasks after it connects to your server.If you have errors in your Schedule.xml, it will show you there in the BEC console.

If you're still stuck - drop me a PM or reply to this post!
CP out !






- from the grassy knoll -
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #1 posted: Jan 19, 2015, 10:28 AM »
Thanks for making this guide for starting server hosters. I think it will help them a lot :)

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #2 posted: Jan 27, 2015, 11:00 PM »
just wondering why you are running 5 different files rather then 1 bat file, any gains to doing it this way?
  • Offline JoSchaap
  • Developer
  • Mercenary
  • ******
  • Posts: 481
  • Had a life.. Got a modem.. (~1996)

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #3 posted: Jan 28, 2015, 04:28 PM »
all-in-1-batch :)

Code: [Select]
@echo off
d:
:start
c:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | c:\Windows\System32\find /I /N "arma3.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
echo Arma3 server not found, will be started now!
d:
cd d:\ARMASERVERFOLDER\A3Files\BEC
start "" /min d:\ARMASERVERFOLDER\A3Files\bec\bec.exe -f Config.cfg
cd "d:\ARMASERVERFOLDER\A3Files\"
start "" /HIGH /min /wait "D:\ARMASERVERFOLDER\A3Files\arma3server.exe" -profiles=d:\ARMASERVERFOLDER\A3Master -config=A3Server.cfg -maxMem=7168 -bepath=d:\ARMASERVERFOLDER\A3Files\be -world=empty -noSound
echo Server started succesfully
goto started
:loop
cls
echo Server is already running, running monitoring loop
:started
c:\Windows\System32\timeout /t 10
c:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | c:\Windows\System32\find /I /N "arma3.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
c:\Windows\System32\taskkill /im arma3server.exe
goto start

d:\SERVERDIR and d: need to be changed to reference your installation, just as all the other path's :)


BEC should do a #shutdown at restart times :) this will make the batch trigger itself again launching BEC and the server as soon as it notices the Arma3server proccess is missing :)

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #4 posted: Jan 28, 2015, 05:56 PM »
Lets say that I am using a Linux server (because linux > windows) and want a script like this one. As far as I know, linux does not support batch. Is there a simple way of transcribing this into linux?

Thank you.
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #5 posted: Jan 28, 2015, 07:45 PM »
Lets say that I am using a Linux server (because linux > windows) and want a script like this one. As far as I know, linux does not support batch. Is there a simple way of transcribing this into linux?

Thank you.

You will have to do a shell script with some CRON jobs ...

I am sure if you google , you might find something useful ;)

- from the grassy knoll -

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #6 posted: Feb 08, 2015, 09:02 AM »
I have rented server. Server host does not have BEC installation option... is it still possible to set it up?

So i have only FTP access and root folder is \
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #7 posted: Feb 08, 2015, 01:45 PM »
I have rented server. Server host does not have BEC installation option... is it still possible to set it up?

So i have only FTP access and root folder is \

Probably not :(

- from the grassy knoll -
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #8 posted: Feb 18, 2015, 01:56 PM »
The B.E.C. service has been terminated. Read more here: http://forums.bistudio.com/showthread.php?180125-B-E-C-quot-Battleye-Extended-Controls-quot-Admin-tool-for-dedicated-servers

This means BEC will shutdown automaticly. There is a work around for this. Add this to your hosts file:

Code: [Select]
127.0.0.1 ibattle.org
127.0.0.1 www.ibattle.org
  • Offline Richie
  • Fresh Spawn
  • *
  • Posts: 17

A fix for BEC

« Reply #9 posted: Feb 18, 2015, 01:58 PM »
Hello fellow server admins,

Some of you might be aware that BEC is now broke, you can read why Here

Quote
As a protest against Bis for allowing Server monetization i am terminating all services associated with Bec.
Good bye Bis it has been a great time.

Regards.
Nuxil

So to fix it and have BEC working again just edit your hosts file and add the following :

Code: [Select]
127.0.0.1 ibattle.org
127.0.0.1 www.ibattle.org

This will make scheduled restarts and messages work again, reporter accounts will still not work.

Required addons are @Epoch & @allinarmaterrainpack
  • Offline Richie
  • Fresh Spawn
  • *
  • Posts: 17

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #10 posted: Feb 18, 2015, 01:59 PM »
You're welcome LouD :)

Required addons are @Epoch & @allinarmaterrainpack
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #11 posted: Feb 18, 2015, 02:25 PM »
You're welcome LouD :)
I love you too  8)
  • Offline JoSchaap
  • Developer
  • Mercenary
  • ******
  • Posts: 481
  • Had a life.. Got a modem.. (~1996)

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #12 posted: Feb 18, 2015, 03:02 PM »
Just to add some more elaboration, nillix allready spoke out about servers using BEC to do slot limitting to paying users is against BEC terms of use. (see page 18 of the monetization thread).

He warned about this on Febr 15th, and as far as i can read, it was ignored by everyone. So I get why he's doing this.

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #13 posted: Feb 18, 2015, 05:17 PM »
To be clear the host file is in %SYSTEMROOT%\System32\drivers\etc\ normally your

C:\Windows\System32\drivers\etc\

just add those lines below the last #

BEC will complain a bit that it cannot check for updates but seems to work otherwise

Re: [GUIDE] How to setup BEC for notifications and auto restarts

« Reply #14 posted: Mar 04, 2015, 02:31 PM »
Anyone have the BEC files willing to share? I'm having issues finding a DL for it now.