Jump to content
  • 0

MySql script (cant explain here what i need) take a look :)


StiflersM0M

Question

Hey :)

ok, at first i want to do a Mysql cleanup which delete old objects in the object_data table.

i use this script now on my server

that tie the playeruid on buildables instead of the characterID.

now i want to cleanup objects where the lastLogin is older than 7 days in the character_data table.

so the script should look in the character_data table , find the Characters who are older than 7 days, copy the PlayerUID from theese characters go into the object_data table and search for the PlayerUID in the characterID column and delete the complete row.

i hope you could understand what i want to do :)

would be awesome if someone could help me out :D

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

allready looked in there and use some cleanups from you, but there is nothing what i mean, i want that the script check the last login from the player_data, not from the object_data cause i have no maintain script and dont want a maintain script.

Link to comment
Share on other sites

  • 0

So what you want is;

 

Search character_data for anything where lastlogin > 7 days and delete anything in the object_data table with a matching PlayerUID in the character_id column ?.

 

The problem I see is that character_data will have multiple records (generations) for a PlayerUID.

 

Player_login could be used in place of character_data if desired although if not housekept, it could be quite big.

 

Something like this...

(note this is not tested and written from memory so use at your own risk as it probably has a syntax error or two).

Delete object_data
where character_id in (select PlayerUID from player_login where DATE 
(`lastlogin`) < CURDATE() - INTERVAL 7 DAY)

I will look at 'fine tuning it' when home when I next get the chance.

 

RB

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