Jump to content
  • 0

Turning off Decay of Buildables


lonewolfgaming

Question

I am currently running a server off my personal computer for personal use til I get the server like I want it. I am having issues with buildables decaying even with the indestructible script installed and remove damage sql files removed. I am not sure where else I need to look to have it where my buildables will not disappear after so many days. I have also tried the changing of the days to -1 as well as extending them to 365, but every 6 days things disappear. Any help would be great.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Make a new event in your DB to run every day, then paste in the code below.

 

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

 

 

Link to comment
Share on other sites

  • 0

Did some searching and found some more info:

 

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)

 

I am new to dealing with sql and scripting, I was able to get the first part with the UPDATE line to save, but when I try to add the DROP EVENT it comes up with errors. Does anyone know how I need to enter this into my database?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...