Jump to content
  • 0

Base Maintain


BennyD101

Question

Recommended Posts

  • 0
Just now, BennyD101 said:

Hi Guys,

 

How would i set it so my base maintain is a 14 day period, and if they dont maintain it, it will start to decay after 14 days, do i need to do anything other than setting the hive.ext cleanup to 14 ?

14 days in hive cleanup  means remove everything after 14 days.

recomend you in hive use

CleanupPlacedAfterDays = -1

The thing that youre looking for is the damage on age sql function

-- ----------------------------
-- Fix inventory on maintainable objects.
-- ----------------------------
UPDATE `object_data`
SET `inventory` = '[]',`LastUpdated` = `LastUpdated`
WHERE `inventory` = '[[[],[]],[[],[]],[[],[]]]'
AND
`Classname` IN ('BagFenceRound_DZ','CinderWall_DZ','CinderWallDoorLocked_DZ','CinderWallDoorSmall_DZ','CinderWallDoorSmallLocked_DZ','CinderWallHalf_DZ','FireBarrel_DZ','GunRack_DZ','LightPole_DZ','MetalFloor_DZ','MetalPanel_DZ','OutHouse_DZ','TentStorage','TentStorageDomed','TentStorageDomed2','Sandbag1_DZ','Scaffolding_DZ','StickFence_DZ','StorageShed_DZ','WorkBench_DZ','WoodCrate_DZ','WoodFloor_DZ','WoodFloorQuarter_DZ','WoodLargeWall_DZ','WoodLargeWallWin_DZ','WoodShack_DZ','WoodSmallWall_DZ','WoodSmallWallThird_DZ','WoodSmallWallWin_DZ','Land_DZE_GarageWoodDoor','WoodFloorHalf_DZ','Fort_RazorWire','Land_DZE_LargeWoodDoorLocked','WoodStairsRails_DZ','WoodLadder_DZ','WoodStairsSans_DZ','M240Nest_DZ','Land_DZE_WoodDoor');

-- ----------------------------
-- Set 0.1 damage to objects daily.
-- ----------------------------
UPDATE `object_data`
SET `Damage` = IF( `Damage` = 0.0, 0.1, `Damage` + 0.1 )
WHERE `LastUpdated` <= DATE_SUB(NOW(), INTERVAL 1 DAY)
AND `ObjectUID` <> 0
AND `CharacterID` <> 0
AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );

-- ----------------------------
-- Set 0.1 damage doors/plots daily.
-- ----------------------------
UPDATE `object_data`
SET `Damage` = IF( `Damage` = 0.0, 0.1, `Damage` + 0.1 )
WHERE `Classname` IN ('Plastic_Pole_EP1_DZ','CinderWallDoorSmallLocked_DZ','CinderWallDoorLocked_DZ','CinderWallSmallDoorway_DZ','CinderWallDoorway_DZ','Land_DZE_WoodDoorLocked','CinderWallDoor_DZ','CinderWallDoorSmall_DZ','Land_DZE_WoodDoor','Land_DZE_GarageWoodDoor','Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_LargeWoodDoor','WoodLargeWallDoor_DZ')
AND `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 DAY)
AND `Inventory` != '[]';

(change the intervals days at your taste)

 

if ure not sure how to use it.. check this post

 

Link to comment
Share on other sites

  • 0
6 minutes ago, juandayz said:

14 days in hive cleanup  means remove everything after 14 days.

recomend you in hive use


CleanupPlacedAfterDays = -1

The thing that youre looking for is the damage on age sql function


-- ----------------------------
-- Fix inventory on maintainable objects.
-- ----------------------------
UPDATE `object_data`
SET `inventory` = '[]',`LastUpdated` = `LastUpdated`
WHERE `inventory` = '[[[],[]],[[],[]],[[],[]]]'
AND
`Classname` IN ('BagFenceRound_DZ','CinderWall_DZ','CinderWallDoorLocked_DZ','CinderWallDoorSmall_DZ','CinderWallDoorSmallLocked_DZ','CinderWallHalf_DZ','FireBarrel_DZ','GunRack_DZ','LightPole_DZ','MetalFloor_DZ','MetalPanel_DZ','OutHouse_DZ','TentStorage','TentStorageDomed','TentStorageDomed2','Sandbag1_DZ','Scaffolding_DZ','StickFence_DZ','StorageShed_DZ','WorkBench_DZ','WoodCrate_DZ','WoodFloor_DZ','WoodFloorQuarter_DZ','WoodLargeWall_DZ','WoodLargeWallWin_DZ','WoodShack_DZ','WoodSmallWall_DZ','WoodSmallWallThird_DZ','WoodSmallWallWin_DZ','Land_DZE_GarageWoodDoor','WoodFloorHalf_DZ','Fort_RazorWire','Land_DZE_LargeWoodDoorLocked','WoodStairsRails_DZ','WoodLadder_DZ','WoodStairsSans_DZ','M240Nest_DZ','Land_DZE_WoodDoor');

-- ----------------------------
-- Set 0.1 damage to objects daily.
-- ----------------------------
UPDATE `object_data`
SET `Damage` = IF( `Damage` = 0.0, 0.1, `Damage` + 0.1 )
WHERE `LastUpdated` <= DATE_SUB(NOW(), INTERVAL 1 DAY)
AND `ObjectUID` <> 0
AND `CharacterID` <> 0
AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );

-- ----------------------------
-- Set 0.1 damage doors/plots daily.
-- ----------------------------
UPDATE `object_data`
SET `Damage` = IF( `Damage` = 0.0, 0.1, `Damage` + 0.1 )
WHERE `Classname` IN ('Plastic_Pole_EP1_DZ','CinderWallDoorSmallLocked_DZ','CinderWallDoorLocked_DZ','CinderWallSmallDoorway_DZ','CinderWallDoorway_DZ','Land_DZE_WoodDoorLocked','CinderWallDoor_DZ','CinderWallDoorSmall_DZ','Land_DZE_WoodDoor','Land_DZE_GarageWoodDoor','Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_LargeWoodDoor','WoodLargeWallDoor_DZ')
AND `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 DAY)
AND `Inventory` != '[]';

(change the intervals days at your taste)

 

if ure not sure how to use it.. check this post

 

So if i set the interval for both to 14, this would start to decay after that if it wasnt maintaned?

Link to comment
Share on other sites

  • 0

@BennyD101

The tip is run one single sql with all included , damage on age, unlock vehicles, delete dead characters.. on each server restart.

this is the one that i was using.

NW_SERVER_MAINTAIN.sql

Spoiler

-- --------------------------------------------------------------------------------
-- --------------------------------Base Maintenance--------------------------------
-- --------------------------------------------------------------------------------

-- ----------------------------
-- Fix inventory on maintainable objects.
-- ----------------------------
UPDATE `object_data`
SET `inventory` = '[]',`LastUpdated` = `LastUpdated`
WHERE `inventory` = '[[[],[]],[[],[]],[[],[]]]'
AND
`Classname` IN ('Land_MBG_HeavyShelter','TK_WarfareBVehicleServicePoint_Base_EP1','BagFenceRound_DZ','CinderWall_DZ','CinderWallDoorLocked_DZ','CinderWallDoorSmall_DZ','CinderWallDoorSmallLocked_DZ','CinderWallHalf_DZ','FireBarrel_DZ','GunRack_DZ','LightPole_DZ','MetalFloor_DZ','MetalPanel_DZ','OutHouse_DZ','TentStorage','TentStorageDomed','TentStorageDomed2','Sandbag1_DZ','Scaffolding_DZ','StickFence_DZ','StorageShed_DZ','WorkBench_DZ','WoodCrate_DZ','WoodFloor_DZ','WoodFloorQuarter_DZ','WoodLargeWall_DZ','WoodLargeWallWin_DZ','WoodShack_DZ','WoodSmallWall_DZ','WoodSmallWallThird_DZ','WoodSmallWallWin_DZ','Land_DZE_GarageWoodDoor','WoodFloorHalf_DZ','Fort_RazorWire','Land_DZE_LargeWoodDoorLocked','WoodStairsRails_DZ','WoodLadder_DZ','WoodStairsSans_DZ','M240Nest_DZ','Land_DZE_WoodDoor');

-- ----------------------------
-- Set 0.1 damage to objects daily.
-- ----------------------------
UPDATE `object_data`
SET `Damage` = IF( `Damage` = 0.0, 0.1, `Damage` + 0.1 )
WHERE `LastUpdated` <= DATE_SUB(NOW(), INTERVAL 1 DAY)
AND `ObjectUID` <> 0
AND `CharacterID` <> 0
AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );

-- ----------------------------
-- Set 0.1 damage doors/plots daily.
-- ----------------------------
UPDATE `object_data`
SET `Damage` = IF( `Damage` = 0.0, 0.1, `Damage` + 0.1 )
WHERE `Classname` IN ('Land_MBG_HeavyShelter','TK_WarfareBVehicleServicePoint_Base_EP1','Plastic_Pole_EP1_DZ','CinderWallDoorSmallLocked_DZ','CinderWallDoorLocked_DZ','CinderWallSmallDoorway_DZ','CinderWallDoorway_DZ','Land_DZE_WoodDoorLocked','CinderWallDoor_DZ','CinderWallDoorSmall_DZ','Land_DZE_WoodDoor','Land_DZE_GarageWoodDoor','Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_LargeWoodDoor','WoodLargeWallDoor_DZ')
AND `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 DAY)
AND `Inventory` != '[]';

-- ----------------------------
-- Set safe combinations to 0000 after 3 days of inactivity.
-- ----------------------------
UPDATE `object_data`
SET `CharacterID` = 0
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY)
AND `CharacterID` > 0
AND `Classname` = "VaultStorageLocked"
AND `Inventory` <> '[]'
AND `Inventory` IS NOT NULL;

-- ----------------------------
-- Set lockbox combinations to RED00 after 3 days of inactivity.
-- ----------------------------
UPDATE `object_data`
SET `CharacterID` = 10000
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY)
AND `CharacterID` > 0
AND `Classname` = "LockboxStorageLocked"
AND `Inventory` <> '[]'
AND `Inventory` IS NOT NULL;

-- ----------------------------
-- Delete empty storage objects 2 days.
-- ----------------------------
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 2 DAY)
AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') OR (`Inventory` = '[[[],[]],[[],[]],[[],[]]]') )
AND `Classname` IN ('Wooden_shed_DZ','WoodShack_DZ', 'TentStorage', 'TentStorageDomed', 'TentStorageDomed2', 'WoodCrate_DZ', 'GunRack_DZ', 'OutHouse_DZ', 'StorageShed_DZ');

-- ----------------------------
-- Delete inactive storage objects.
-- ----------------------------
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 4 DAY)
AND `Classname` IN ('Wooden_shed_DZ','WoodShack_DZ', 'TentStorage', 'TentStorageDomed', 'TentStorageDomed2', 'WoodCrate_DZ', 'GunRack_DZ', 'OutHouse_DZ', 'StorageShed_DZ');

-- ----------------------------
-- Delete objects that have 1 damage.
-- ----------------------------
DELETE FROM `object_data`
WHERE Damage = 1;

-- ----------------------------
-- Delete plot poles and doors not being deleted.
-- ----------------------------
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 11 DAY)
AND `Classname` IN ('Land_MBG_HeavyShelter','TK_WarfareBVehicleServicePoint_Base_EP1','Plastic_Pole_EP1_DZ','CinderWallDoorSmallLocked_DZ','CinderWallDoorLocked_DZ','CinderWallSmallDoorway_DZ','CinderWallDoorway_DZ','Land_DZE_WoodDoorLocked','CinderWallDoor_DZ','CinderWallDoorSmall_DZ','Land_DZE_WoodDoor','Land_DZE_GarageWoodDoor','Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_LargeWoodDoor','WoodLargeWallDoor_DZ');

-- ----------------------------
-- Delete old stuff.
-- ----------------------------
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 12 DAY);

-- --------------------------------------------------------------------------------
-- ------------------------------Vehicle Maintenance-------------------------------
-- --------------------------------------------------------------------------------

-- ----------------------------
-- Delete Deployables by deployanything to be sure
-- ----------------------------
DELETE FROM `object_data`
WHERE `Classname` IN ('MMT_Civ','Old_bike_TK_CIV_EP1');


-- ----------------------------
-- Delete useless vehicles with keys.
-- ----------------------------
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY)
AND `CharacterID` > 0
AND `Classname` IN ('Ural_ZU23_INS','Skoda_DZE3','VolhaLimo_TK_CIV_EP1_DZE4','HMMWV_M2_DZ','HMMWV','HMMWV_Armored','HMMWV_Terminal_EP1','HMMWV_M1035_DES_EP1','car_hatchback_DZE4','HMMWV_DZ','Kamaz_DZE','Lada1_TK_CIV_EP1_DZE1','M1030_US_DES_EP1','GLT_M300_ST','LandRover_CZ_EP1','Old_moto_TK_Civ_EP1','TT650_Gue','Offroad_DSHKM_Gue_DZE3','datsun1_civil_1_open','datsun1_civil_2_covered_DZE2','Pickup_PK_GUE','SUV_PMC_BAF','policecar','S1203_TK_CIV_EP1','car_sedan','ArmoredSUV_PMC_DZ','SUV_Blue_DZE2','SUV_Camo_DZE4','SUV_Orange_DZE4','SUV_Red_DZE1','SUV_Silver','SUV_White','hilux1_civil_3_open_EP1','hilux1_civil_1_open_DZE','hilux1_civil_2_covered_DZE3','UAZ_CDF_DZE3','UAZ_Unarmed_TK_CIV_EP1','UAZ_MG_INS','LadaLM_DZE2','Ural_TK_CIV_EP1','KamazOpen_DZE4','V3S_Gue','pook_H13_gunship_CDF','AH6X_DZ','MH6J_DZ','UH60M_EP1_DZ','UH1H_DZE');

-- ----------------------------
-- Delete server spawned vehicles.
-- ----------------------------
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY)
AND `CharacterID` = '0'
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest|killhouse|villa|castle|pub|shelter|stodola|garage|MBG|warehouse|sara';

-- ----------------------------
-- Delete all vehicles not touched in 3 days.
-- ----------------------------
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 4 DAY)
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest|killhouse|villa|castle|pub|shelter|stodola|garage|MBG|warehouse|sara';

-- ----------------------------
-- Unlock purchased, inactive vehicles.
-- ----------------------------
UPDATE `object_data`
SET `CharacterID` = 0,`LastUpdated` = `LastUpdated`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY)
AND `CharacterID` > 0
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest|killhouse|villa|castle|pub|shelter|stodola|garage|MBG|warehouse|sara';


-- ----------------------------
-- Unlock vehicle's with no key.
-- ----------------------------
UPDATE `Object_DATA`
SET `Object_DATA`.`CharacterID` = 0,`LastUpdated` = `LastUpdated`
WHERE `Object_DATA`.`CharacterID` <> 0
AND`Object_DATA`.`CharacterID` <= 12500
AND`Object_DATA`.`Classname` NOT LIKE 'Tent%'
AND`Object_DATA`.`Classname` NOT LIKE '%Locked'
AND`Object_DATA`.`Classname` NOT LIKE 'Land%'
AND`Object_DATA`.`Classname` NOT LIKE 'Cinder%'
AND`Object_DATA`.`Classname` NOT LIKE 'Wood%'
AND`Object_DATA`.`Classname` NOT LIKE 'Metal%'
AND`Object_DATA`.`Classname` NOT LIKE '%Storage%'
AND`Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ')
AND FindVehicleKeysCount(Object_DATA.CharacterID) = 0;

-- --------------------------------------------------------------------------------
-- -------------------------------Player Maintenance-------------------------------
-- --------------------------------------------------------------------------------

-- ----------------------------
-- Delete player login data.
-- ----------------------------
DELETE FROM `player_login`;

-- ----------------------------
-- Delete dead characters.
-- ----------------------------
DELETE from Character_data
USING Character_data, Character_data as tempchartable
WHERE (Character_data.PlayerUID = tempchartable.PlayerUID)
AND (NOT Character_data.alive = tempchartable.alive)
AND (Character_data.alive = 0);

-- ----------------------------
-- Delete characters inactive for 5 days.
-- ----------------------------
DELETE FROM Character_DATA 
WHERE LastLogin < NOW() - INTERVAL 5 DAY;

 

You can call this file with your scheduler.xml or with a  windows function....

example how i call it:

a bunch of my scheduler.xml

Spoiler

<!-- 12:00 AM restart -->
<job id="0">
    <time>23:59:00</time>
    <delay>000000</delay>
    <day>1,2,3,4,5,6,7</day>
    <loop>0</loop>
    <cmd>say -1 This server will restart in 1 minute, Log out now!</cmd>
    <cmdtype>0</cmdtype>
</job>

<job id="1">
    <time>00:00:00</time>
    <delay>000000</delay>
    <day>1,2,3,4,5,6,7</day>
    <loop>0</loop>
    <cmd>#shutdown</cmd>
    <cmdtype>0</cmdtype>
</job>

<job id="2">
    <time>00:00:01</time>
    <delay>000000</delay>
    <day>1,2,3,4,5,6,7</day>
    <loop>0</loop>    
    <cmd>D:\epoch16\instance_1_takistan\BattlEye\Bec\AUTORESTART_FILES\NW_SHUTDOWN.bat</cmd>
    <cmdtype>1</cmdtype>
</job>

NW_SHUTDOWN.bat

Spoiler

@echo off
echo SHUTDOWN ARMA2OA SERVER
TIMEOUT /T 2 /NOBREAK
taskkill /F /IM arma2oaserver.exe
TIMEOUT /T 4 /NOBREAK
echo SHUTDOWN DEAD BEC
taskkill /f /im cmd.exe /fi "windowtitle eq NW_BEC_CONTROL
echo LOADING CLEAN UP FUNCTIONS

set cleanupfunction="D:\epoch16\instance_1_takistan\BattlEye\Bec\AUTORESTART_FILES"
cd /d %cleanupfunction%
start "" "NW_MAINTAIN.bat"
echo SUCCESS
timeout 3
exit

 

NW_MAINTAIN.bat

Spoiler


@echo off

set MYSQLHOST=127.0.0.1
:: Database Table Name (default is dm1)
set mysqlschema=jdz

:: Username to access the database
set mysqlpassword=jdz

:: Password to access the database
set mysqluser=jdz

:: Path to mysql.exe file (default)
set mysqlpath=C:\xampp\mysql\bin\

:: Path to cleanup script file (the file with all of the cleanup code in it)
set mysqlcleanup="D:\epoch16\instance_1_takistan\BattlEye\Bec\AUTORESTART_FILES\NW_SERVER_MAINTAIN.sql"

"%mysqlpath%\mysql.exe" -h %MYSQLHOST% --user=%mysqluser% --password=%mysqlpassword% --database=%mysqlschema%  < %mysqlcleanup%
::PAUSE
exit

 

 

r

Link to comment
Share on other sites

  • 0
Just now, BennyD101 said:

There has to be an easier way then doing all this?

but an easy way?

damageonage.bat

UPDATE `object_data` SET `Damage`=0.1 WHERE `Inventory` = '[]'

run manually each 14 days. or create a windowns function to run it each 14 days.

Not recomended but is the most easy and lazy way :rolleyes:

 

Link to comment
Share on other sites

  • 0
11 minutes ago, juandayz said:

but an easy way?

damageonage.bat


UPDATE `object_data` SET `Damage`=0.1 WHERE `Inventory` = '[]'

run manually each 14 days. or create a windowns function to run it each 14 days.

Not recomended but is the most easy and lazy way :rolleyes:

 

can i just run this NW_SERVER_MAINTAIN.sql bye itself?, without that other stuff in the scheduler? also what hour restarts are you running on your server?

 

Link to comment
Share on other sites

  • 0

@BennyD101 as salival said you..  heres my find vehicles without  keys function.

I run it one single time with HeidySQL or Navicat .. you paste the code and run it as query over your database.. then this function keep loaded.

-- ----------------------------
-- Function structure for FindVehicleKeysCount
-- ----------------------------
DROP FUNCTION IF EXISTS `FindVehicleKeysCount`;
DELIMITER ;;
CREATE FUNCTION `FindVehicleKeysCount`(`keyId` INT) RETURNS int(11)
BEGIN
    DECLARE totalKeys INT DEFAULT 0;
    DECLARE keyName VARCHAR(32) DEFAULT "";
    DECLARE keysInChar INT DEFAULT 0;
    DECLARE keysInObj INT DEFAULT 0;

    SET keyName = (CASE
        WHEN `keyId` < 2501 THEN CONCAT('ItemKeyGreen', `keyId`)
        WHEN `keyId` < 5001 THEN CONCAT('ItemKeyRed', `keyId` - 2500)
        WHEN `keyId` < 7501 THEN CONCAT('ItemKeyBlue', `keyId` - 5000)
        WHEN `keyId` < 10001 THEN CONCAT('ItemKeyYellow', `keyId` - 7500)
        WHEN `keyId` < 12501 THEN CONCAT('ItemKeyBlack', `keyId` - 10000)
        ELSE 'ERROR'
    END);

    SET keysInChar = (SELECT COUNT(*) FROM `Character_DATA` WHERE `Alive` = '1' AND (`Inventory` LIKE CONCAT('%', keyName, '%') OR `Backpack` LIKE CONCAT('%', keyName, '%')));
    SET keysInObj = (SELECT COUNT(*) FROM `Object_DATA` WHERE `Inventory` LIKE CONCAT('%', keyName, '%'));

    RETURN (keysInChar + keysInObj);
END

 

Link to comment
Share on other sites

  • 0

anyway i guess you feel confused.. but dont worry at times when i had my own server this was the last thing that i was able to understand. Took me almos 6 months to have it running on epoch 1.0.5.1.

Remember @theduke give  me this one.. ( when i could not understand it)

maybe help you same way as help me.

damageonage.sql

Spoiler


-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
-- EXECUTION FREQUENCY:         To be executed before each server restart (every 3 hours).
-- SUMMARY:                            Apply damage to all buildables that have not been updated for longer than 24 hours (i.e.: not maintained by the owner). 
--                                                If existing damage is none, apply 0.10 damage.
--                                                If existing damage is more than 0.10, apply 0.07 damage.
-- 
-- 
-- This is based on a 14 day maintenance server setup. 
-- 
-- 1st day = 10% damage
-- Remaining days = 7% damage 
-- 
-- (90% / 13 days =%6.92 damage per day, rounded up to %7.0 for additional days)
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
USE cherno;
UPDATE `object_data`
    SET `Damage` = IF( `Damage` = 0.0, 0.16, `Damage` + 0.06 )
    WHERE `LastUpdated` <= DATE_SUB(NOW(), INTERVAL 1 DAY)
        AND `Classname` REGEXP 'wall|floor|door|ladder|stair'
        AND `ObjectUID` <> 0
        AND `CharacterID` <> 0
        AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );
        
        
        
/* Delete all vehicles not touched in 21 days */
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 DAY)
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest';

/* Delete destroyed objects */
DELETE FROM `object_data`
WHERE Damage = 1;

 

clean.bat

Spoiler

@echo off

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: CONFIG - begin
set mysql_exe_path=C:\xampp\mysql\bin"
:: CONFIG - end
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Run MySQL database maintenance scripts
cd /d %mysql_exe_path%

:: Apply damage  to buildable objects
mysql.exe --user=juandayz --password=jdz--host=127.0.0.1 --port=3306 --database=epoch< D:\testserver\cleanserver\setDamage.sql
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


:: We're done here.
@exit

 

and you need run the .bat file with your scheduler.xml at moment when your server restart. or run it manually (Double click over clean.bat on each server restart) or create a windows sheduled task.

Link to comment
Share on other sites

  • 0
Just now, Runewulv said:

to simply deactivate this -1 cleanup in hive file is all that's necessary? Or do I have to edit the database to not cause damage as well?

the hive line just remove everything... for example your players mount a base with walls, doors etc... if u place:

CleanupPlacedAfterDays = 6

then after 6 days.. the server gonna remove everything .. dont care if they maintain or not.

if u place:

CleanupPlacedAfterDays = -1

 

this function stop to work,, and nothing is removed. then you can use the maintain function provided by plotmanagement and the damageOnAge sql query.

Then now, the damageOnage sql start to damage your walls,doors 0.1 per day (you can change this value) then when the damage is 1. the wall is deleted.

The maintain function of plotmanager .. restore this value at 0. so the wall is not deleted if you maintain it.

Link to comment
Share on other sites

  • 0

yeah I gotcha there. I dont want to have to maintain, i just like disabling base decay. 

 

Is this something new in 106? I've had A2 Epoch servers for years, and all you had to do to disable base decay before was the -1 cleanupafterdays. I never had to disable any damage in the database as well. Even hosts had instructed me in the past that this was the way to do it. Now they say check Epoch forums because things have changed and even they arent certain LOL

Link to comment
Share on other sites

  • 0
Just now, Runewulv said:

yeah I gotcha there. I dont want to have to maintain, i just like disabling base decay. 

 

Is this something new in 106? I've had A2 Epoch servers for years, and all you had to do to disable base decay before was the -1 cleanupafterdays. I never had to disable any damage in the database as well. Even hosts had instructed me in the past that this was the way to do it. Now they say check Epoch forums because things have changed and even they arent certain LOL

no, its like epoch 1.0.5.1 the hive comes by default with 6 days after remove.

the sql events comes by default but you need load it in your db.

So basically if u dont want use maintain .. just place -1 in hive.

if u want maintain... place -1 in hive and load the sql functions.

Link to comment
Share on other sites

  • 0
27 minutes ago, BennyD101 said:

I did disabled cleanup to -1, but it seemed to still delete base parts,  i looked online and they removed something from the self_actions or something to fix it, is that correct or could i have a script in already for base maintaince ?

No. The only thing in selfactions.sqf is the plotmanagement option when you aim to your plot.

Link to comment
Share on other sites

  • 0

Cheers, 

So if i run this i should be sweet?

 

-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
-- EXECUTION FREQUENCY:         To be executed before each server restart (every 3 hours).
-- SUMMARY:                            Apply damage to all buildables that have not been updated for longer than 24 hours (i.e.: not maintained by the owner). 
--                                                If existing damage is none, apply 0.10 damage.
--                                                If existing damage is more than 0.10, apply 0.07 damage.
-- 
-- 
-- This is based on a 14 day maintenance server setup. 
-- 
-- 1st day = 10% damage
-- Remaining days = 7% damage 
-- 
-- (90% / 13 days =%6.92 damage per day, rounded up to %7.0 for additional days)
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
USE cherno;
UPDATE `object_data`
    SET `Damage` = IF( `Damage` = 0.0, 0.16, `Damage` + 0.06 )
    WHERE `LastUpdated` <= DATE_SUB(NOW(), INTERVAL 1 DAY)
        AND `Classname` REGEXP 'wall|floor|door|ladder|stair'
        AND `ObjectUID` <> 0
        AND `CharacterID` <> 0
        AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );
        
        
        
/* Delete all vehicles not touched in 21 days */
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 DAY)
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest';

/* Delete destroyed objects */
DELETE FROM `object_data`
WHERE Damage = 1;
Link to comment
Share on other sites

  • 0
1 minute ago, juandayz said:

No. The only thing in selfactions.sqf is the plotmanagement option when you aim to your plot.

Cheers, 

So if i run this i should be sweet?

 

-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
-- EXECUTION FREQUENCY:         To be executed before each server restart (every 3 hours).
-- SUMMARY:                            Apply damage to all buildables that have not been updated for longer than 24 hours (i.e.: not maintained by the owner). 
--                                                If existing damage is none, apply 0.10 damage.
--                                                If existing damage is more than 0.10, apply 0.07 damage.
-- 
-- 
-- This is based on a 14 day maintenance server setup. 
-- 
-- 1st day = 10% damage
-- Remaining days = 7% damage 
-- 
-- (90% / 13 days =%6.92 damage per day, rounded up to %7.0 for additional days)
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
USE cherno;
UPDATE `object_data`
    SET `Damage` = IF( `Damage` = 0.0, 0.16, `Damage` + 0.06 )
    WHERE `LastUpdated` <= DATE_SUB(NOW(), INTERVAL 1 DAY)
        AND `Classname` REGEXP 'wall|floor|door|ladder|stair'
        AND `ObjectUID` <> 0
        AND `CharacterID` <> 0
        AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );
        
        
        
/* Delete all vehicles not touched in 21 days */
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 DAY)
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest';

/* Delete destroyed objects */
DELETE FROM `object_data`
WHERE Damage = 1;
Link to comment
Share on other sites

  • 0

@BennyD101

try this one:

Spoiler

-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
-- EXECUTION FREQUENCY:         To be executed before each server restart (every 3 hours).
-- SUMMARY:                            Apply damage to all buildables that have not been updated for longer than 24 hours (i.e.: not maintained by the owner). 
--                                                If existing damage is none, apply 0.10 damage.
--                                                If existing damage is more than 0.10, apply 0.07 damage.
-- 
-- 
-- This is based on a 14 day maintenance server setup. 
-- 
-- 1st day = 10% damage
-- Remaining days = 7% damage 
-- 
-- (90% / 13 days =%6.92 damage per day, rounded up to %7.0 for additional days)
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
USE cherno;
UPDATE `object_data`
    SET `Damage` = IF( `Damage` = 0.0, 0.16, `Damage` + 0.06 )
    WHERE `LastUpdated` <= DATE_SUB(NOW(), INTERVAL 1 DAY)
        WHERE `Classname` IN ('Plastic_Pole_EP1_DZ','CinderWallDoorSmallLocked_DZ','CinderWallDoorLocked_DZ','CinderWallSmallDoorway_DZ','CinderWallDoorway_DZ','Land_DZE_WoodDoorLocked','CinderWallDoor_DZ','CinderWallDoorSmall_DZ','Land_DZE_WoodDoor','Land_DZE_GarageWoodDoor','Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_LargeWoodDoor','WoodLargeWallDoor_DZ')
    AND `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 DAY)
    AND `Inventory` != '[]';
        
        
        
/* Delete all vehicles not touched in 21 days */
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 21 DAY)
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest';

/* Delete destroyed objects */
DELETE FROM `object_data`
WHERE Damage = 1;

 

 

Link to comment
Share on other sites

  • 0
41 minutes ago, juandayz said:

@BennyD101

try this one:

  Reveal hidden contents


-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
-- EXECUTION FREQUENCY:         To be executed before each server restart (every 3 hours).
-- SUMMARY:                            Apply damage to all buildables that have not been updated for longer than 24 hours (i.e.: not maintained by the owner). 
--                                                If existing damage is none, apply 0.10 damage.
--                                                If existing damage is more than 0.10, apply 0.07 damage.
-- 
-- 
-- This is based on a 14 day maintenance server setup. 
-- 
-- 1st day = 10% damage
-- Remaining days = 7% damage 
-- 
-- (90% / 13 days =%6.92 damage per day, rounded up to %7.0 for additional days)
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
USE cherno;
UPDATE `object_data`
    SET `Damage` = IF( `Damage` = 0.0, 0.16, `Damage` + 0.06 )
    WHERE `LastUpdated` <= DATE_SUB(NOW(), INTERVAL 1 DAY)
        WHERE `Classname` IN ('Plastic_Pole_EP1_DZ','CinderWallDoorSmallLocked_DZ','CinderWallDoorLocked_DZ','CinderWallSmallDoorway_DZ','CinderWallDoorway_DZ','Land_DZE_WoodDoorLocked','CinderWallDoor_DZ','CinderWallDoorSmall_DZ','Land_DZE_WoodDoor','Land_DZE_GarageWoodDoor','Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_LargeWoodDoor','WoodLargeWallDoor_DZ')
    AND `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 DAY)
    AND `Inventory` != '[]';
        
        
        
/* Delete all vehicles not touched in 21 days */
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 21 DAY)
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest';

/* Delete destroyed objects */
DELETE FROM `object_data`
WHERE Damage = 1;

 

 

Hey Mate, I have messaged you, should be easier than commenting all the time

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
  • Advertisement
  • Discord

×
×
  • Create New...