Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Очиста БД от чаров не заходивших n-дней
#1
Есть у кого скрипт который всю инфу о чарах удаляет, которые не заходили в игру n-ое кол-во дней.

Сборка l2jfree Gracia. Может у кого хоть какой есть, я там уж под себя подправлю..

Спасибо
Ответ
#2
пробуйте
Код:
UPDATE characters SET online=0;
DELETE FROM characters WHERE lastAccess < 1191211200;
DELETE FROM accounts WHERE lastactive < 1191211200;
DELETE FROM characters WHERE level < 75;
DELETE FROM characters WHERE account_name NOT IN (SELECT login FROM accounts);
DELETE FROM accounts WHERE login NOT IN (SELECT account_name FROM characters);
DELETE FROM clan_data WHERE leader_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM clan_privs WHERE clan_id NOT IN (SELECT clan_id FROM clan_data);
DELETE FROM clan_subpledges WHERE clan_id NOT IN (SELECT clan_id FROM clan_data);
DELETE FROM clan_wars WHERE clan1 NOT IN (SELECT clan_id FROM clan_data);
DELETE FROM clan_wars WHERE clan2 NOT IN (SELECT clan_id FROM clan_data);
DELETE FROM auction_bid WHERE bidderId NOT IN (SELECT clan_id FROM clan_data);
DELETE FROM clanhall_functions WHERE hall_id NOT IN (SELECT ID FROM clanhall WHERE ownerId <> '0');
UPDATE clanhall SET paidUntil='0' WHERE ownerId NOT IN (SELECT clan_id FROM clan_data);
UPDATE clanhall SET ownerId='0' WHERE ownerId NOT IN (SELECT clan_id FROM clan_data);
DELETE FROM account_data WHERE account_name NOT IN (SELECT login FROM accounts);
DELETE FROM account_data WHERE account_name NOT IN (SELECT account_name FROM characters);
DELETE FROM account_data WHERE value NOT IN (SELECT obj_Id FROM characters);
DELETE FROM items WHERE loc <> 'clanwh' and owner_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM items WHERE loc = 'clanwh' and owner_id NOT IN (SELECT clan_id FROM clan_data);
DELETE FROM character_skills WHERE char_obj_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM character_skills_save WHERE char_obj_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM character_shortcuts WHERE char_obj_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM character_recipebook WHERE char_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM character_quests WHERE char_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM character_macroses WHERE char_obj_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM character_hennas WHERE char_obj_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM character_friends WHERE char_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM character_subclasses WHERE char_obj_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM couples WHERE player1Id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM couples WHERE player2Id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM pets where item_obj_id not in (SELECT object_id FROM items);
DELETE FROM seven_signs WHERE char_obj_id NOT IN (SELECT obj_Id FROM characters);
DELETE FROM forums WHERE forum_owner_id <> '0' AND forum_owner_id NOT IN (SELECT clan_id FROM clan_data);
Ответ
#3
Спасибо.. А где и как указывать кол-во дней? Что-то не вижу (
Ответ
#4
Доброго времени суток.
тут
singer;24088 Написал:DELETE FROM characters WHERE lastAccess < 1191211200;
DELETE FROM accounts WHERE lastactive < 1191211200;
Время указанно в секундах от летоисчесления.

С уважением sw.Devil.

З.Ы. Тут указывать уровень
Цитата:DELETE FROM characters WHERE level < 75;
Ответ
#5
Доброго.

Спасибо, но

Про время что-то не понял Sad
Ответ
#6
Это юникс время, вот здесь можешь конвертировать это время на понятное _http://www.unixtimestamp.com/index.php
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  Геройство на определенное количество дней. MegaPvP 2 2,480 09-19-2011, 07:31 PM
Последний пост: MegaPvP
  Завышенные статы у чаров serg5777 4 2,571 11-24-2010, 06:55 PM
Последний пост: Place

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)