account deletion.
Posted: Mon Jan 11, 2010 12:59 am
People may add in some config time of account deletion.
many thanks
many thanks
It is best that you develop it who know the code and have less chance of error. is very delicate.janiii wrote:what do you mean?
- unused accounts with characters?
- unused accounts without characters?
- never logged in
- logged in but without chars
check IdFactory.java for cleaning up the db. you can run the queries from a daemon or other script (php, jython, ...). check forum for suggestions.
http://www.l2jserver.com/trac/browser/t ... a?rev=3799janiii wrote:but what has the variable with a config? nothing. that variable only says at the end of the cleanup how many entries got cleaned up. there is nothing to config on the variable.
you just did not answer my questions..
Code: Select all
[b]int cleanCount = 0; [/b]166 con = L2DatabaseFactory.getInstance().getConnection(); 167 stmt = con.createStatement(); 168 // Misc/Account Related 169 // Please read the descriptions above each before uncommenting them. If you are still 170 // unsure of what exactly it does, leave it commented out. This is for those who know 171 // what they are doing. :) 172 173 // Deletes only accounts that HAVE been logged into and have no characters associated 174 // with the account. 175 // cleanCount += 176 // stmt.executeUpdate("DELETE FROM accounts WHERE accounts.lastactive > 0 AND accounts.login NOT IN (SELECT account_name FROM characters);"); 177 178 // Deletes any accounts that don't have characters. Whether or not the player has ever 179 // logged into the account. 180 // cleanCount += 181 // stmt.executeUpdate("DELETE FROM accounts WHERE accounts.login NOT IN (SELECT account_name FROM characters);"); 182 183 // Deletes banned accounts that have not been logged into for xx amount of days 184 // (specified at the end of the script, default is set to 90 days). This prevents 185 // accounts from being deleted that were accidentally or temporarily banned. 186 // cleanCount += 187 // stmt.executeUpdate("DELETE FROM accounts WHERE accounts.accessLevel < 0 AND DATEDIFF(CURRENT_DATE( ) , FROM_UNIXTIME(`lastactive`/1000)) > 90;"); 188 // cleanCount += 189 // stmt.executeUpdate("DELETE FROM characters WHERE characters.account_name NOT IN (SELECT login FROM accounts);"); 190 191 // If the chacleanCount = 0racter does not exist...