Jump to content
Sign in to follow this  
Donnovan

Make Bec run a Server Script

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

Share this post


Link to post
Share on other sites
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%

Share this post


Link to post
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

Share this post


Link to post
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 

Share this post


Link to post
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 .

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Similar Content

    • By sjd6795
      Having issues with the epoch events, I don't seem to be getting my correct schedule timing the way I have it setup I should be getting an event spawn at 5 minutes and then another event spawn every 30, 5, and 20 minutes right?
       
      EpochEvents = [["any","any","any","any",5,"event1"],["any","any","any","any",35,"event1"],["any","any","any","any",5,"event2"],["any","any","any","any",10,"event2"],["any","any","any","any",5,"event3"],["any","any","any","any",25,"event3"]];
       
      So with event number 2 it seems to spawn the first one around 5 minutes and then the other one around 10 minutes but it doesn't continue to spawn after the first two initial ones.
       
       
    • By Brian Soanes
      To unlock vehicles left in your traders over a server restart, open your epoch_server.pbo

      In epoch_server\compile\epoch_vehicle\EPOCH_load_vehicles.sqf
      Find
      if (_allowDamage) then { Just above that, add this
      A3E_SafeZonePosArray = [ [[18451.9,14278.1,0]], //Altis East trader [[13333.5,14494.3,0]], //Altis Central trader [[6192.46,16834,0]] //Altis West trader ]; { if (_vehicle distance (_x select 0) < 200) then { _vehicle lock false; diag_log format["Vehicle %1 left in trader unlocked @ %2", _class, mapGridPosition _vehicle]; }; } forEach A3E_SafeZonePosArray; Pack pbo and you're good to go
    • By tyrant50187
      Im looking for the ability to add Script allowing Eyescan (retina scan) For Safe's and lockboxes, ether or, its something i havent found any script for but have found mentions and seen, any suggestions, links, or scripts are welcome, please Let me know!
    • By Bloodthirsty
      Hey I just need some files for this server, any and all you guys can come up with and think it deserve post that shit in chat rn. I want to see some crazy ideas and additions if you got em :) Lets see what you guys can come up with

    • By randall421
      The loot spawning on my server will respawn or cycle right infrnt of you if you move more than 5m away or if someone else near you moves 5ft away. I check player_spawncheck.sqf and it looks fine. 
      player_spawncheck.sqf 
      //player_spawncheck.sqf private ["_isWreck","_maxControlledZombies","_looted","_zombied","_doNothing","_spawnZedRadius","_serverTime","_age","_nearbyBuildings","_position","_speed","_radius","_maxlocalspawned","_maxWeaponHolders","_currentWeaponHolders","_maxtoCreate","_inVehicle","_isAir","_isLand","_isSea","_Controlledzeddivided","_totalcrew","_nearby","_type","_config","_canSpawn","_dis","_checkLoot","_islocal","_bPos","_zombiesNum"]; _age = -1; //_nearbyBuildings = []; _position = [player] call fnc_getPos; _speed = speed (vehicle player); _radius = 200; //150*0.707; Pointless Processing (106.5) _spawnZedRadius = 20; /* //Tick Time PVDZ_getTickTime = player; publicVariableServer "PVDZ_getTickTime"; */ //Total Counts _maxlocalspawned = round(dayz_spawnZombies); _maxControlledZombies = round(dayz_maxLocalZombies); _maxWeaponHolders = round(dayz_maxMaxWeaponHolders); _currentWeaponHolders = round(dayz_currentWeaponHolders); //Limits (Land,Sea,Air) _inVehicle = (vehicle player != player); /* _isAir = vehicle player iskindof "Air"; _isLand = vehicle player iskindof "Land"; _isSea = vehicle player iskindof "Sea"; if (_isLand) then { } else { }; if (_isAir) then { } else { }; if (_isSea) then { } else { }; */ _doNothing = false; if (_inVehicle) then { _Controlledzeddivided = 0; //exit if too fast if (_speed > 25) exitwith {_doNothing = true;}; //Crew can spawn zeds. _totalcrew = count (crew (vehicle player)); if (_totalcrew > 1) then { _Controlledzeddivided = 2; //Dont allow driver to spawn if we have other crew members. if (player == driver (vehicle player)) exitwith {_doNothing = true;}; } else { _Controlledzeddivided = 4; }; if (_Controlledzeddivided > 0) then { _maxControlledZombies = round(_maxControlledZombies / _Controlledzeddivided); r_player_divideinvehicle = _Controlledzeddivided; }; }; if (_doNothing) exitwith {}; /*if ("ItemMap_Debug" in items player) then { deleteMarkerLocal "MaxZeds"; deleteMarkerLocal "Counter"; deleteMarkerLocal "Loot30"; deleteMarkerLocal "Loot120"; deleteMarkerLocal "Agro80"; _markerstr = createMarkerLocal ["MaxZeds", _position]; _markerstr setMarkerColorLocal "ColorYellow"; _markerstr setMarkerShapeLocal "ELLIPSE"; _markerstr setMarkerBrushLocal "Border"; _markerstr setMarkerSizeLocal [_radius, _radius]; _markerstr1 = createMarkerLocal ["Counter", _position]; _markerstr1 setMarkerColorLocal "ColorRed"; _markerstr1 setMarkerShapeLocal "ELLIPSE"; _markerstr1 setMarkerBrushLocal "Border"; _markerstr1 setMarkerSizeLocal [_radius+100, _radius+100]; _markerstr2 = createMarkerLocal ["Agro80", _position]; _markerstr2 setMarkerColorLocal "ColorRed"; _markerstr2 setMarkerShapeLocal "ELLIPSE"; _markerstr2 setMarkerBrushLocal "Border"; _markerstr2 setMarkerSizeLocal [80, 80]; _markerstr2 = createMarkerLocal ["Loot30", _position]; _markerstr2 setMarkerColorLocal "ColorRed"; _markerstr2 setMarkerShapeLocal "ELLIPSE"; _markerstr2 setMarkerBrushLocal "Border"; _markerstr2 setMarkerSizeLocal [30, 30]; _markerstr3 = createMarkerLocal ["Loot120", _position]; _markerstr3 setMarkerColorLocal "ColorBlue"; _markerstr3 setMarkerShapeLocal "ELLIPSE"; _markerstr3 setMarkerBrushLocal "Border"; _markerstr3 setMarkerSizeLocal [120, 120]; diag_log ("LocalZombies: " +str(dayz_spawnZombies) + "/" +str(dayz_maxLocalZombies)); //Logging diag_log (format["%1 Local.Agents: %2/%3, NearBy.Agents: %8/%9, Global.Agents: %6/%7, W.holders: %10/%11, (radius:%4m %5fps).","SpawnCheck", _maxlocalspawned, _maxControlledZombies, _radius, round diag_fpsmin,dayz_currentGlobalZombies, dayz_maxGlobalZeds, dayz_CurrentNearByZombies, dayz_maxNearByZombies, _currentWeaponHolders,_maxWeaponHolders]); };*/ // nearObjects is faster than nearestObjects when sorting by distance isn't needed // "Building" includes House and all of its child classes (Crashsite, IC_Fireplace1, IC_Tent, etc.) _nearby = _position nearObjects ["Building",_radius]; _maxlocalspawned = _maxlocalspawned max floor(_maxControlledZombies*.8); if (_maxlocalspawned > 0) then { _spawnZedRadius = _spawnZedRadius * 3; }; //Spawn Zeds & loot in buildings { _type = typeOf _x; _config = missionConfigFile >> "CfgLoot" >> "Buildings" >> _type; _canSpawn = isClass (_config); if (_canSpawn) then { _dis = _x distance player; _checkLoot = (count (getArray (_config >> "lootPos"))) > 0; _islocal = _x getVariable ["", false]; // object created locally via TownGenerator. //Make sure wrecks always spawn Zeds _isWreck = _x isKindOf "CrashSite"; //Loot if (getNumber(_config >> "lootChance") > 0) then { if (_currentWeaponHolders < _maxWeaponHolders) then { //Basic loot check if ((_dis < 125) and (_dis > 30) and !_inVehicle and _checkLoot) then { _serverTime = serverTime; _looted = (_x getVariable ["looted",_serverTime]); _age = _serverTime - _looted; //Building refresh rate if (_age == 0 or (_age > getNumber(_config >> "lootRefreshTimer"))) then { _x setVariable ["looted",_serverTime,!_islocal]; _x call building_spawnLoot; if (!(_x in dayz_buildingBubbleMonitor)) then { dayz_buildingBubbleMonitor set [count dayz_buildingBubbleMonitor, _x]; }; //diag_log [ diag_tickTime, "new loot at",_x,"age:", _age, "serverTime:", _serverTime]; }/* else { diag_log [ diag_tickTime, "won't spawn loot at",_x,"age:", _age, "serverTime:", _serverTime]; }*/; }; }; }; //Zeds if (getNumber(_config >> "zombieChance") > 0) then { if (_dis > _spawnZedRadius) then { _serverTime = serverTime; _zombied = (_x getVariable ["zombieSpawn",_serverTime]); _age = _serverTime - _zombied; if ((_age == 0) or (_age > 300)) then { if (!_isWreck) then { if ((dayz_spawnZombies < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then { _bPos = getPosATL _x; _zombiesNum = count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]); if (_zombiesNum == 0) then { _x setVariable ["zombieSpawn",_serverTime,!_islocal]; if (!(_x in dayz_buildingBubbleMonitor)) then { //add active zed to var dayz_buildingBubbleMonitor set [count dayz_buildingBubbleMonitor, _x]; }; //start spawn [_x] call building_spawnZombies; }; //diag_log (format["%1 building. %2", __FILE__, _x]); }; } else { _bPos = getPosATL _x; _zombiesNum = count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 30)]); //Should be a wreck if (_zombiesNum == 0) then { [_x,_isWreck] call building_spawnZombies; }; }; }; }; }; }; } forEach _nearby; At first I thought it was a respawn timer issue or something like that but if you don't move the loot will stay, you have to back away from it or someone else has to get within range and its not like you have to run away for this to happen, you can just back up a few steps and watch the loot change right infront of you. I have been playing around with it just trying to see if i can figure it out but if anyone knows what i should do or can at least point me in the right direction it would be a huge help.
       
      Thanks
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...