Jump to content

Make Bec run a Server Script


Donnovan

Recommended Posts

7 hours ago, Donnovan said:

Hi,

I'm trying to do a force save all on DB before the server restarts.

The best situation is make Bec starts the save process 1 minute before restart.

There is any way to make Bec run a server scipt?

Thankyou!

You can try run server script when server UPtime variable have count 2h59m

Link to comment
Share on other sites

  • 2 months later...
On Monday, February 01, 2016 at 5:28 PM, Donnovan said:

Linux,

This is a nice solution, but if for some reason you need to restart the server outside the normal restart times, this solution will not work.

To be honest it will not work for one restart after that it will go back on schedule . That's seems better then nothing . If it works 95% off the time is better then 0%

Link to comment
Share on other sites

My server restart looks like this. It seems to work quite well. Run from BEC to restart the server.

@echo off
echo.
echo KILL arma2oaserver.exe
set serverkill="C:\DayZ"
cd /d %serverkill%
taskkill /im arma2oaserver.exe
echo.
echo Kill Bec.exe
set beckill="C:\DayZ\BEC"
cd /d %beckill%
taskkill /im bec.exe

Start  C:\Dayz\instance_24_Napf\rotate_logs.bat

start  C:DayZ\Dayzbackup\dayzbackup.bat

timeout 10

echo.
echo Starting Dayz Server
:: start the server..
set dayzpath="C:\DayZ"
cd /d %dayzpath%
start "" "DayZ_Epoch_instance_24_Napf.bat"
echo.
echo Starting Bec
timeout 30
:: start bec
set becpath="C:\DayZ\BEC"
cd /d %becpath%
start "" "bec.exe" -f Config.cfg
echo.
echo Server Started 100%

cls

@exit

 

And the  C:DayZ\Dayzbackup\dayzbackup.bat  looks like this.

 

REM [at] echo off

for /f "skip=1 tokens=1-6" %%G in ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') do (
  if "%%~L"=="" goto s_done
  set _yyyy=%%L
  set _mm=00%%J
  set _dd=00%%G
  set _hour=00%%H
  set _minute=00%%I
)
:s_done

set _mm=%_mm:~-2%
set _dd=%_dd:~-2%
set _hour=%_hour:~-2%
set _minute=%_minute:~-2%

set _isodate=%_mm%-%_dd%-%_yyyy%.%_hour%-%_minute%

"C:\xampp\mysql\bin\mysqldump" -u root -r "C:\DayZ\Dayzbackup\dayz_epoch.%_isodate%.sql" dayz_epoch

Link to comment
Share on other sites

2 hours ago, Phail said:

My server restart looks like this. It seems to work quite well. Run from BEC to restart the server.

@echo off
echo.
echo KILL arma2oaserver.exe
set serverkill="C:\DayZ"
cd /d %serverkill%
taskkill /im arma2oaserver.exe
echo.
echo Kill Bec.exe
set beckill="C:\DayZ\BEC"
cd /d %beckill%
taskkill /im bec.exe

Start  C:\Dayz\instance_24_Napf\rotate_logs.bat

start  C:DayZ\Dayzbackup\dayzbackup.bat

timeout 10

echo.
echo Starting Dayz Server
:: start the server..
set dayzpath="C:\DayZ"
cd /d %dayzpath%
start "" "DayZ_Epoch_instance_24_Napf.bat"
echo.
echo Starting Bec
timeout 30
:: start bec
set becpath="C:\DayZ\BEC"
cd /d %becpath%
start "" "bec.exe" -f Config.cfg
echo.
echo Server Started 100%

cls

@exit

 

And the  C:DayZ\Dayzbackup\dayzbackup.bat  looks like this.

 

REM [at] echo off

for /f "skip=1 tokens=1-6" %%G in ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') do (
  if "%%~L"=="" goto s_done
  set _yyyy=%%L
  set _mm=00%%J
  set _dd=00%%G
  set _hour=00%%H
  set _minute=00%%I
)
:s_done

set _mm=%_mm:~-2%
set _dd=%_dd:~-2%
set _hour=%_hour:~-2%
set _minute=%_minute:~-2%

set _isodate=%_mm%-%_dd%-%_yyyy%.%_hour%-%_minute%

"C:\xampp\mysql\bin\mysqldump" -u root -r "C:\DayZ\Dayzbackup\dayz_epoch.%_isodate%.sql" dayz_epoch

We are not discussing server restarts but the ability to trigger in game scripts with bec . Other then that your restarts look pretty good mate 

Link to comment
Share on other sites

He is trying to force update on characters so no gear will be lost etc.

Coins also has some issue's with when players dont logg off in time they are gone from the character_data .

When players do disconnect in time , the disconnecting will force an update of the character to the database .

Link to comment
Share on other sites

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...