Jump to content
  • 0
StiflersM0M

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

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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By Cyrus
      I have been finding that some people on my server has been losing base walls and floors even though DZE_godmodebase = true; , it has no effect on anything built inside the plot radius. So i have come to the conclusion that base items might receive damage on age and this ultimately being removed by server cleanup script. So my question is if I drop this event below will that stop me and others from losing base walls and floor? Or at the minimum update it without any cinder wall items?
      like this  and set damage to 0.001:
       
    • By anster3333
      ***PLEASE HELP*** 2017-12-13 16:25:01 HiveExt: [Information] HiveExt  2017-12-13 16:25:01 HiveExt: [Critical] Cannot create database: Error loading database module: DatabaseMySql   Ive tried changing the password to the database and user in the Hiveext.cfg For some reason whenever i join the server its all fine, but as soon as i log in as it says 'game started', it proceeds with the error 2017-12-13 16:25:01 HiveExt: [Information] HiveExt  2017-12-13 16:25:01 HiveExt: [Critical] Cannot create database: Error loading database module: DatabaseMySql then the server closes itself. I have no idea now how to fix this issue as no one else has posted about it from what ive seen and i could really do with any help if anyone knows how to fix this error, im probably just being stupid.   Thanks
    • By Thug
      I have setup many Epoch servers over the past 4 years. All of which were built on old PC's I have.
      Players have no problem getting into game.
      In the past month I built a Dedicated Server  Xeon, Server board, Server memory, etc 
      Installed Windows 2016 essentials on it.
      Set up a game server, one that has dinosaurs in it.    It works!
      Have the same Taviana Epoch server working on a nomal PC, Players can join!
      Now on with my problem
      Installed MySQL for Windows
      Installed all files for the Taviana Epoch Server
      Created a data base called tavi_2365
      Have port forwarded the port of 2365
      Setup new rules for inbound and outbound 2365 in the firewall
      When I start the server all goes as planned
      Server starts up
      Can see the server from my computer
      When I try to join, I get the lobby and click ok
      The loading screen comes up and the first white bar runs as normal
      The second white bar starts and says waiting for server to start authentication
      Then times out at 120 seconds
      On my second monitor I am watching the server load
      It gets to game started and it just sets there
      Database never starts, get the following error in server RPT
       2:09:23 "HIVE: Starting"
       2:09:24 Error in expression <erver_hiveReadWrite;
      _outcome = _result select 0;
      if (_outcome == "PASS") then {>
       2:09:24   Error position: <select 0;
      if (_outcome == "PASS") then {>
       2:09:24   Error select: Type String, expected Array,Config entry
       2:09:24 File z\addons\dayz_server\system\server_monitor.sqf, line 23
      Below are my Server RPT, Client RPT, HiveExt.ini, and server_monitor.sqf
      server RPT
      https://pastebin.com/6M9sG9RB
      client RPT
      https://pastebin.com/9ayVMXjF
      hiveext.ini
      https://pastebin.com/3wx9VDM9
      server_monitor.sqf
      https://pastebin.com/fUnU09Gp
      UPDATE   PROBLEM SOLVED
      Had to install all of the Visual C++  from 08 to 17   they were a little hard to find, but I did it.    Thanks to all that helped me.   @juandayz @icomrade  and more
      below is a pic of what I had to install to get it to work
      https://dl.dropboxusercontent.com/u/487376647/MS Visual C.PNG
      Here is a link to my drop box for a .rar and a .zip for all the MS Visual C++ that I used to get my dedicated server working.
      https://dl.dropboxusercontent.com/u/487376647/All Microsoft Visual C%2B%2B Redistributables.rar
      https://dl.dropboxusercontent.com/u/487376647/All Microsoft Visual C%2B%2B Redistributables.zip
    • By chargedlight1
      I've noticed dayz epoch arma 2 mod uses hives to connect to mysql databases
      I want to create a custom table in the MySQL database, will i be able to use the custom table if i create a new hive.. or is there another way?       or is it even possible to create a custom hive?
    • By SryImAnooB
      Hey guys, i need some help/answers.
      I have no clue about cleanup the server from loot when no one is around for a specific amount of time.
      I noticed that this was uncommented in server_function.sqf:
      server_systemCleanup = compile preprocessFileLineNumbers "\z\addons\dayz_server\system\server_cleanup.sqf"; so i removed the // and checked what happend...nothing :D
      Then i checked out the server_cleanup.sqf.
      In line 23 it says:
      if (_age > 20) then { changed to:
      if (_age > 2) then { cause i thought 20 = 20min ?! so 2 = 2min. Was a try nothing happend.
      I googled around and noticed that in 1.0.5.1 the server_cleanup was .fsm and not .sqf. Does this matter?
      And does anyone have a tip how to cleanup loot when for ex. a player is not in range from 500m for 5 mins?!
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...