Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 25.02.2006, 01:39   #1
nucer
Архивный участник
 
Join Date: May 2005
Posts: 117
Default [small share]Script for clear database

This stored procedure will clear unused characters with their items, skills and quests.
Code:
CREATE PROCEDURE [DBO].[lin_DeleteOldChars]  
@days INT
AS  
SET NOCOUNT ON  
  
DECLARE @ToDeleteCharacter CURSOR  
DECLARE @char_id INT  
SET @ToDeleteCharacter = CURSOR FAST_FORWARD FOR
  
SELECT char_id  FROM user_data  WHERE account_id <= 0  OR ( logout>login AND logout<GETDATE()-@days)
OPEN @ToDeleteCharacter  
FETCH FROM @ToDeleteCharacter INTO @char_id  
  
WHILE @@FETCH_STATUS = 0  
BEGIN  
 DELETE FROM user_item WHERE char_id=@char_id
 DELETE FROM user_skill WHERE char_id=@char_id
 DELETE FROM Quest WHERE char_id=@char_id

 FETCH NEXT FROM @ToDeleteCharacter INTO @char_id  
END  
  
CLOSE @ToDeleteCharacter   
DEALLOCATE @ToDeleteCharacter

DELETE  FROM user_data  WHERE account_id <= 0  OR ( logout>login AND logout<GETDATE()-@days)
GO
nucer is offline  
Old 25.02.2006, 01:41   #2
sct
Архивный участник
 
Join Date: Nov 2005
Posts: 70
Default

I would never do something like that... heh.
sct is offline  
Old 25.02.2006, 01:42   #3
drzoom
Архивный участник
 
Join Date: Aug 2005
Posts: 428
Default

ВАЙП-ВАЙП-ВАЙП!!! ))))
drzoom is offline  
Old 25.02.2006, 01:47   #4
nucer
Архивный участник
 
Join Date: May 2005
Posts: 117
Default

If you have 1000+ online you may need do this clear every several months...
nucer is offline  
Old 25.02.2006, 04:34   #5
kgptzac
Архивный участник
 
Join Date: Jan 2006
Posts: 363
Default

Quote:
Originally Posted by nucer
If you have 1000+ online you may need do this clear every several months...
can you give me some names of the private servers that has 1000+ online average?
kgptzac is offline  
Old 25.02.2006, 04:37   #6
Megatronpt
Архивный участник
 
Join Date: Jan 2006
Posts: 584
Default

THere are quite a few

And this script can come in handy.. with a change here and there..

Thanks Nucer!
Megatronpt is offline  
Old 25.02.2006, 19:08   #7
nucer
Архивный участник
 
Join Date: May 2005
Posts: 117
Default

Quote:
can you give me some names of the private servers that has 1000+ online average?
Ggg lol

http://l2online.ru/
http://la2.ru/
http://lineageii.ru/
http://lineage2.su/
http://la2.raid.ru/
http://splendor.ru/
http://warsmith.ru/
http://line2.ru/
http://elmore.ru/
http://l2server.ru/
http://la2world.ru/
http://www.lineage2.kiev.ua/
http://www.lineage2.wnet.ua/
http://lineage.trifle.net/

This is not full list of russian servers
nucer is offline  
Old 25.02.2006, 19:31   #8
OnlyOne
Архивный участник
 
Join Date: Apr 2005
Posts: 98
Default

LT servers:
http://reborn.bfd.lt about 1k-1.1k
beyondc3 (pvp server) 1.5-2.8k
OnlyOne is offline  
Old 25.02.2006, 21:06   #9
archy
Архивный участник
 
Join Date: Mar 2005
Posts: 280
Default

Quote:
Originally Posted by kgptzac
Quote:
Originally Posted by nucer
If you have 1000+ online you may need do this clear every several months...
can you give me some names of the private servers that has 1000+ online average?
I would have to say.... you just got owned....
archy is offline  
Old 26.02.2006, 00:22   #10
kgptzac
Архивный участник
 
Join Date: Jan 2006
Posts: 363
Default

not really.... i just wonder why those sites didn't make it to top200
kgptzac is offline  
Old 26.02.2006, 01:50   #11
Megatronpt
Архивный участник
 
Join Date: Jan 2006
Posts: 584
Default

Top200 isn't everything.. but don't make me talk, otherwise someone wouldn't like it. ^^

Megatronpt is offline  
Old 26.02.2006, 03:35   #12
2Rain
Архивный участник
 
Join Date: Aug 2005
Posts: 194
Default

Anybody can apply these SQL at PHP-body (with input account_id or char_id form)? Be amazing!
2Rain is offline  
Old 26.02.2006, 06:04   #13
Co0L
Архивный участник
 
Join Date: Dec 2005
Posts: 120
Default

В десятке 8) :lol:
Co0L is offline  
Old 27.02.2006, 09:02   #14
demon
Архивный участник
 
Join Date: May 2005
Posts: 367
Default

there is ALREADY proc for delete such things in SERVER

lin_deleteghostdata or something

i guess you never looked ? huh ?
demon is offline  
Old 27.02.2006, 13:27   #15
srh
Архивный участник
 
Join Date: Aug 2005
Posts: 145
Default

lin_CleanUpGhostData
exec in lin_DeleteNotOwnedItem

but nucer delete "expired" users, as i see chars that not used N days from now. i'm right?
srh is offline  
Old 09.03.2006, 11:15   #16
Tear
Архивный участник
 
Join Date: Feb 2006
Posts: 4
Default

also must delete from
Code:
 DELETE FROM user_friend WHERE char_id=@char_id
 DELETE FROM user_history WHERE char_id=@char_id
 DELETE FROM user_deleted WHERE char_id=@char_id
 DELETE FROM user_log WHERE char_id=@char_id
 DELETE FROM user_punish WHERE char_id=@char_id
 DELETE FROM user_surrender WHERE char_id=@char_id
 DELETE FROM user_blocklist WHERE char_id=@char_id
 DELETE FROM user_ban WHERE char_id=@char_id
 DELETE FROM user_ActiveSkill WHERE char_id=@char_id
 DELETE FROM shortcut_data WHERE char_id=@char_id
Tear is offline  
Old 12.04.2006, 17:24   #17
vandalheart
Архивный участник
 
Join Date: Feb 2005
Posts: 24
Default

Quote:
Originally Posted by OnlyOne
LT servers:
http://reborn.bfd.lt about 1k-1.1k
beyondc3 (pvp server) 1.5-2.8k
LOL , PVP server beyondc3 ? with rates x6 ?
vandalheart is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 17:12.