Jump to content
  • 0

BEC / BAT file


Line2.lv

Question

Hi guys, have a little problem with In-game client while my server restarts.

 

Well I made a day / night cycle using two different Hive`s (one - for day, second - for the night) and everything is working.

Then I just made a link via BEC scheduling <cmd>Link...</cmd> to following BAT file and like I said, everyhing is working.

 

But the problem is with the In - game client when the BAT file is killing the server process...

 

When BAT file kills server which is in progress at the moment, the players get RED chain and the message - connection with server is lost.

Then they Need to press Esc, wait 9 seconds till they back in the lobby which is not working. It`s kinda a stupid...

I want to change it to the following message so all the player get Session lost instead of the RED chain..

 

1_18_12_14_6_52_19.png

 

Here is my BAT file for the night:

 

I know that it is relaited to taskkill process but I do not know how to fix it. :(

@echo off

taskkill /f /fi "status eq not responding" /im arma2oaserver.exe
taskkill /f /im arma2oaserver.exe
timeout 3
 
cd L:\STEAM\SteamApps\common\Arma 2 Operation Arrowhead

start "arma2" /min "arma2oaserver.exe" -port=2302 "-config=config_11_NIGHT\config.cfg" "-cfg=config_11_NIGHT\basic.cfg" "-profiles=config_11_NIGHT" -name=config_11_NIGHT "-mod=@DayzOrigins179;@DayzOverwatch;@DayZ_Epoch1051;@DayZ_Epoch_Server;"
timeout 6

set becpath="L:\STEAM\SteamApps\common\Arma 2 Operation Arrowhead\BEC"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg

exit
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Let BEC kill the server process. Use 2 start.bat files, one for each hive and use task scheduling to launch the server with the correct cycles. I have a different .bat for BEC that just monitors it. When BEC shuts down the server BEC closes automatically. The bat detects that, sleeps for 1 minute then launches BEC again.

 

This is what i use for BEC

@echo off
color 0a
title Server Starter
:top
echo Launching And Watching BEC
ping 127.0.0.1 -n 30 >NUL
start /wait "" /min "H:\overpochinsServer\ServerTools\bec.exe" -f config.cfg
ping 127.0.0.1 -n 5 >NUL
echo Server has exited ... Restarting!
cls
goto top

The first time I used this, i got an error. Something about a file or folder (not sure which)  not being found... I noticed the file path from the error wasn't where the file was before i started using this .bat. So I moved it to the location in the error and it hasn't let me down since. This is launched manually and/or at startup in case of PC crash or power failure.

Link to comment
Share on other sites

  • 0

Well, I dont use different hives. So it wont really help to see. Both of my BATs look the same except the file path and a line in the BEC bat to make it wait 30 seconds before restarting. But here is what i use anyway.

 

 for server

@echo off
color 0a
title Server Starter
:top
echo Launching And Watching Server
start /wait "arma2" /min "H:\overpochinsServer\arma2oaserver.exe" -port=6660 "-bepath=H:\overpochinsServer\BattlEye" "-config=instance_13_Tavi\config.cfg" "-cfg=instance_13_Tavi\basic.cfg" "-profiles=instance_13_Tavi" -name=instance_13_Tavi "-mod=@Origins;@DayzOverwatch;@DayZ_Epoch;@DayZ_Epoch_Server;"
ping 127.0.0.1 -n 5 >NUL
echo Server has exited ... Restarting!
ping 127.0.0.1 -n 1 >NUL
cls
goto top

and for BEC

@echo off
color 0a
title Server Starter
:top
echo Launching And Watching BEC
ping 127.0.0.1 -n 30 >NUL
start /wait "" /min "H:\overpochinsServer\ServerTools\bec.exe" -f config.cfg
ping 127.0.0.1 -n 5 >NUL
echo Server has exited ... Restarting!
cls
goto top

 

What i was saying, is use windows task scheduler to launch the server.bat 1 min after BEC uses the #shutdown command. You can program the task scheduler to launch the day hive at certain times and the night hive at others.

 

The bat for BEC will restart BEC automatically without the use of task scheduling 30 seconds after the server goes down and wont stop trying until its connected.. Hope this is more helpful this time.

Link to comment
Share on other sites

  • 0

Now I understood :) Previous I didn`t get the part about Windows Scheduler...

Well, if nobody will answer to my problem in my way, maybe I will try to use your idea.

Just did not wanted to use Windows Scheduler also for this type of jobs.

 

My Windows Scheduler is already making DateBase backups.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...