Jump to content
  • 0

Delete untouched vehicles after X number of days


BetterDeadThanZed

Question

Recommended Posts

  • 0

Installed Epoch on another Server, different host and have the same deal. That is 3 servers with the same.

 

ALTER TABLE `character_data`
    ADD `lastactive` timestamp on update current_timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;

 

ALTER TABLE `object_data`
    ADD `lastactive` timestamp on update current_timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;
 
This just simply does not work on any of the 3. It updates when I access a vehicle, but also updates all vehicles on server restart. :(
Link to comment
Share on other sites

  • 0

Would something like this work?

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 MONTH)

Then let the .ini do the cleanup instead of setting it to -1

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