Jump to content
  • 0

Database deleting SOME parts of bases....


DangerRuss

Question

Ok sooooo let me first start by saying I suck with SQL events and the epoch database in general. Great now thats out of the way let me explain....

 

So I decided awhile back to add indestructible base building to the server. Good. Except of course as you all know it comes with a crap load of issues like players can't remove their own buildables.  So I attempted to do a few things to ease the pressure on me as an admin since Im running the show solo.  One of the things I found was (and Im using dayz.st as a host) that dayz.st has a page listing some commonly used or recommended SQL events. They are listed here.

 

http://dayz.st/w/Epoch_PBO_config_options_and_how_they_work#Server_Maintenance

 

So, I dont know if I did something wrong or what the deal is, but the some parts of certain peoples' bases disappeared on the following restart. Note, I do not have maintenance activated.  My base was completely gone except for a door. This led me to believe that only older sections of the bases were destroyed and any newer sections hadn't been cleaned up. Which makes sense considering thats what one of these SQL events does. Im guessing this one is the culprit but I Can't be sure.

 

 

Remove abandoned objects that are 2 weeks old and empty:

DROP EVENT IF EXISTS removeObjectEmpty;
CREATE EVENT removeObjectEmpty
   ON SCHEDULE EVERY 1 DAY
   COMMENT 'Removes abandoned storage objects and vehicles'
   DO
     DELETE FROM `Object_DATA` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 24 DAY) AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') OR (`Inventory` = '[[[],[]],[[],[]],[[],[]]]') )
;

Sooo in response I rolled back the server a day or so. Thinking that if I rolled it back past the time when I entered these SQL events that they would cease to exist. I guessed wrong. The next thing I tried is just the first part of those events "DROP EVENT IF EXISTS removeObjectEmpty;"   would that resolve the issue? thanks for any help Im pulling my hair out

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

In your database find event called setDamageOnAge

change 'Damage' = 0.1 to 'Damage' = 0.3

You will be able to maintain your indestructible bases again, resetting date of object creation and avoiding base decay event to kick in.

 

You can ofcourse run this Query manually as well to see this instantly (after restart)

UPDATE `Object_DATA` SET `Damage`=0.3 WHERE `ObjectUID` <> 0 AND `CharacterID` <> 0 AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY) AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') )

If you are doing rollback, make sure to temporary increase interval in code you posted earlier, so they don't get destroyed immediately and tell people to maintain their bases ASAP

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