Jump to content

Recommended Posts

Posted

 

Delete characters with level 20(or less) and 2 months of inactive

DELETE FROM character_friends WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM character_subclasses WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM character_hennas WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM character_macroses WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM character_quests WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM character_recipebook WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM character_shortcuts WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM character_skills WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM character_skills_save WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM character_subclasses WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM items WHERE owner_id in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20);
DELETE FROM characters WHERE lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(51840000))*1000) and accesslevel<=0 and level<=20;

 

Delete banned accounts

UPDATE characters SET `accesslevel` = '-99' where account_name in (select login from accounts WHERE `accessLevel` < 0) AND account_name NOT IN (SELECT `account` FROM `l2_bannedontime`);
DELETE FROM character_friends WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel < 0);
DELETE FROM character_subclasses WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM character_hennas WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM character_macroses WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM character_quests WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM character_recipebook WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM character_shortcuts WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM character_skills WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM character_skills_save WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM character_subclasses WHERE charId in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM items WHERE owner_id in (select charId from characters where lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0);
DELETE FROM characters WHERE lastaccess<((UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-(30*24*3600))*1000) and accesslevel<0;

Posted

Thanks for share, but I'll pass.

only the first is good. the second is useless . why? because maybe you want to give second chance to banned members or they pay to get unbanned ..!

anyway thnx

 

+

  • 3 months later...
Posted

This is ok but I think there will be errors with the items. I mean these characters that are deleted own some items so there will be errors in the gameserver (i think).

 

The same happens if you delete NPC's without deleting their spawns.

Posted

This is ok but I think there will be errors with the items. I mean these characters that are deleted own some items so there will be errors in the gameserver (i think).

 

The same happens if you delete NPC's without deleting their spawns.

 

Wrong, when you delete a character from the database everything associated with it will be deleted from the database next time you reboot the server. L2j cores were written to check the player ID's against the other tables, when it does not find an active one it removes it from the database.

 

On some if you watch the server starting up you will see something like "X Items cleaned from database." or something like that.

 

Deleting NPC's is not the same as deleting characters, NPC's have set ID's that the server needs when loading. If you delete an NPC from the NPC table then yes, you will have problems as many NPC's have their own skill lists, drops, html texts, etc.

 

As for the script to delete banned character I think it a bad idea as a players can once again create the same character. However if you do this and then restart the server then anything associated with the deleted character(s) will be deleted upon server load so even if they make the same character they will start from scratch (or however you have your server set).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

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



  • Posts

    • Hi players ! Meet our project Lineage 2 Hiro Classic ! A low rate classic pvp oriented with many features. No pay to win, RB/AoE, group clan pvp castle etc ...  Dynamic rates, RB Xp 4x and soon massive update with auto farm ! Join now !  https://www.lineage2hiro.com/ Can't wait to see you online !
    • To all first time buyers we give a bonus + 10% of the order. 
    • 🔥 Looking for a powerful, clean, and player-friendly Auction House system for your Lineage 2 server? This fully-featured module is ready to plug into your project and provide your players with a modern, centralized marketplace!   💼 What is it? A complete Auction House system designed for fixed-price item sales between players. Forget about private stores and spammed zones—this system offers a smooth, secure, and offline-friendly way to buy and sell items across your server.   Photo Library: https://imgur.com/a/zLlUQbW   ✅ Main Features: 🔹 Fixed-Price Listings Only: Players list items at a set price. No bidding, no delays—just fast, clean trades. 🔹 Multi-Currency Support: Works with Adena, event coins, custom currencies—fully configurable. 🔹 Dynamic Interface: Players can filter items by name, type, and price. Easy-to-use HTML layout with smooth pagination. 🔹 Sell While Offline: Post items and receive payments even if you're not online—true passive trading. 🔹 Safety First: Full validation: no equipped/augmented/restricted items unless allowed. Prevents scams, mispricing, and listing errors. 🔹 Expiration Timer (Optional): Set listing time limits. Expired items go to warehouse/mail automatically. 🔹 Spam & Duplication Protection: Prevents multiple listings of identical items and unnecessary database load. 🔹 Performance Optimized: Clean, indexed SQL structure. No lag or bloating even with thousands of listings.   ⚙️ Plug & Play Clean Java code (compatible with aCis & derivatives). Easy setup with full instructions and sample configurations. Includes SQL, HTML files, and all Java classes – fully working out of the box.   💰 Pricing & Contact 📦 50 euro - One-time purchase with full support for setup & basic customization. 💬 Contact me here via PM or on Discord: @Luminous 🔐 Serious buyers only – source is clean, secure, and tested on live servers.     Give your server the next-level economy it deserves. No more chaotic trade zones. No more confusion. Just clean, efficient, server-wide trading.
    • We are certainly not an ambulance, but we will definitely cure you of blacklists and empty pockets. Live freely with SX! Each of you will receive a trial version of SX to familiarize yourself with the product, all you have to do is post in this thread
  • Topics

×
×
  • Create New...