Jump to content

Help with turning decay off


Recommended Posts

I for the life of me cannot figure out how to turn the decay feature off to prevent maintainance of buildables. I have the Hive set to -1 and have done the following info I found through another Epoch forum:

 

 

 

Prevent server cleanup of built objects:

We have already set the HiveExt.ini cleanup cycle for crafted items at -1, meaning it should not delete them in the default 6 days. However, sometimes the server code ignores this setting and does a cleanup anyways. To avoid losing any of your constructs, make sure you do the maintenance on them every week through the scroll-wheel menu for each item.

If you really don't want to worry about anything being deleted, you can run the following SQL in the database to auto-update the timestamp on everything everyday. This WILL lead to unused buildings staying on your server forever and causing lag and desync unless you go in the DB manually and prune things.


Use the following SQL code:

UPDATE `Object_DATA` SET `Datestamp`=CURRENT_TIMESTAMP WHERE `ObjectUID` <> 0 AND `CharacterID` <> 0 AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') )


Schedule it to run every day:

DROP EVENT IF EXISTS preventCleanup
CREATE EVENT preventCleanup

    ON SCHEDULE EVERY 1 DAY

    COMMENT 'prevents all cleanup by setting datestamp to current'

    DO

      UPDATE `Object_DATA` SET `Datestamp`=CURRENT_TIMESTAMP WHERE `ObjectUID` <> 0 AND `CharacterID` <> 0 AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') )


If you only want to keep objects build by players that have logged in the last week. Use the following scheduled event instead:

 DROP EVENT IF EXISTS preventCleanup
    CREATE EVENT preventCleanup
    ON SCHEDULE EVERY 1 DAY
    COMMENT 'prevents cleanup of objects build by active player by setting the timestamp to currect'
    DO

      UPDATE Object_DATA
      SET    Datestamp   = CURRENT_TIMESTAMP
      WHERE  ObjectUID   <> 0
      AND    CharacterID <> 0
      AND  ((Inventory IS NULL) OR (Inventory = '[]'))
      AND EXISTS (SELECT 1
                  FROM   Character_DATA c
                  WHERE  c.PlayerUID = (SELECT p.PlayerUID
                                        FROM   Player_DATA p,
                                               Character_DATA c2
                                        WHERE  p.PlayerUID = c2.PlayerUID
                                        AND    c2.CharacterID = Object_DATA.CharacterID)
                  AND    c.Alive = 1
                  AND    c.LastLogin   > NOW() - INTERVAL 1 WEEK)

 

everything I have tried still has things getting removed in 6 days, and the plot pole does not show a maintain option after 3 days. Does anyone know of a way I can add something different to my sql as an event to stop decay or a script I can install that will allow the plot pole to show the maintain so I can keep my buildables? Thanks in advance

Link to comment
Share on other sites

Just keep in mind that if you turn off the clean up SQL and other settings, if people abandon the server or decide to build a new base someplace else, your server could quickly become overrun with objects which can affect the performance of the server. I personally use the regular clean up SQL and have free maintenance. That way active players can maintain their base every day so it doesn't get cleaned up and anyone that leaves the server will automatically have their base cleaned up.

Link to comment
Share on other sites

  • 2 weeks later...

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