Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 21:02

  • Please register to post and access all features, it's quick, easy and FREE!

 

[RELEASE] Remove Deleted Characters + Associated Assets

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2015
Posts: 205
Received Thanks: 220
[RELEASE] Remove Deleted Characters + Associated Assets

Sometimes your server begins to run slow after weeks of up-time and hundreds of users. A good deal of the cause can be directly related to garbage filled Telecaster tables, when a user deletes a character not only is that character NOT deleted, but neither is any of the assets (items, skills, quests, party, pets, summons) deleted either.

Today I bring to you a simple script that you point at your Telecaster and press 'GO' and it easily loops through all deleted characters and deletes them and their associated assets!

Code:
USE Telecaster -- Change my name to your Telecaster name

DECLARE @CUR INT,
		@MAX INT,
		@SID INT,
		@NAME NVARCHAR(50),
		@PETCUR INT,
		@PETMAX INT,
		@PETSID INT

SET @CUR = 0
SET @PETCUR = 0
SET @MAX = (SELECT COUNT(*) FROM dbo.Character WHERE name LIKE '%@%')

PRINT CONCAT(N'There are a total of ', @MAX, N' deleted characters')

WHILE @CUR < @MAX 
BEGIN
	SET @SID = (SELECT TOP(1) sid FROM dbo.Character WHERE name LIKE '%@%')
	SET @NAME = (SELECT TOP(1) name FROM dbo.Character WHERE sid = @SID)

	PRINT CONCAT(N'Processing entry ', @CUR, N' of ', @MAX,  N' with SID: ', @SID, N' and NAME: ', @NAME)
	
	DELETE FROM dbo.Character WHERE sid = @SID
	DELETE FROM dbo.Auction WHERE seller_id = @SID
	DELETE FROM dbo.Denials WHERE owner_id = @NAME OR denial_id = @NAME
	DELETE FROM dbo.EventAreaEnterCount WHERE player_id = @SID
	DELETE FROM dbo.Farm WHERE owner_id = @SID
	DELETE FROM dbo.Favor WHERE owner_id = @SID
	DELETE FROM dbo.Friends WHERE owner_id = @NAME or friend_id = @NAME
	DELETE FROM dbo.GuildMember WHERE player_id = @SID
	DELETE FROM dbo.Item WHERE owner_id = @SID
	DELETE FROM dbo.ItemCoolTime WHERE owner_id = @SID
	DELETE FROM dbo.ItemKeeping WHERE owner_id = @SID
	DELETE FROM dbo.Party WHERE leader_id = @SID
	DELETE FROM dbo.Quest WHERE owner_id = @SID
	DELETE FROM dbo.QuestCoolTime WHERE owner_id = @SID
	DELETE FROM dbo.RankingScore WHERE owner_id = @SID
	DELETE FROM dbo.Skill WHERE owner_id = @SID
	DELETE FROM dbo.State WHERE owner_id = @SID
	DELETE FROM dbo.Title WHERE owner_id = @SID
	DELETE FROM dbo.TitleCondition WHERE owner_id = @SID

	SET @PETMAX = (SELECT COUNT(*) FROM dbo.Summon WHERE owner_id = @SID)

	PRINT CONCAT(@PETMAX, N' Pets detected for this character.')
	
	WHILE @PETCUR < @PETMAX 
	BEGIN
		SET @PETSID = (SELECT TOP(1) sid FROM dbo.Summon WHERE owner_id = @SID)
		DELETE FROM dbo.Summon WHERE sid = @PETSID
		DELETE FROM dbo.Item WHERE summon_id = @PETSID
		DELETE FROM dbo.Skill WHERE summon_id = @PETSID
		DELETE FROM dbo.State WHERE summon_id = @PETSID

		SET @PETCUR = @PETCUR + 1

		PRINT CONCAT(N' Pet bearing sid ', @PETSID, N' and all related information deleted.')
	END

	PRINT N'Delete Successful'

	SET @CUR = @CUR + 1
END



SilentWisdom is offline  
Thanks
11 Users
Old   #2
 
elite*gold: 0
Join Date: May 2013
Posts: 129
Received Thanks: 12
thanks, good job ismoky


thund22222 is offline  
Thanks
1 User
Old   #3
 
elite*gold: 0
Join Date: Aug 2012
Posts: 312
Received Thanks: 252
WB ismoke
gr4ph0s is offline  
Thanks
3 Users
Old   #4
 
elite*gold: 0
Join Date: Apr 2012
Posts: 99
Received Thanks: 34
Nice to meet you here :-)
Thanks for the job !


nimoht is offline  
Old   #5
 
elite*gold: 0
Join Date: Jul 2010
Posts: 1,139
Received Thanks: 632
Quote:
Originally Posted by SilentWisdom View Post
Sometimes your server begins to run slow after weeks of up-time and hundreds of users. A good deal of the cause can be directly related to garbage filled Telecaster tables, when a user deletes a character not only is that character NOT deleted, but neither is any of the assets (items, skills, quests, party, pets, summons) deleted either.

Today I bring to you a simple script that you point at your Telecaster and press 'GO' and it easily loops through all deleted characters and deletes them and their associated assets!

Code:
USE Telecaster -- Change my name to your Telecaster name

DECLARE @CUR INT,
		@MAX INT,
		@SID INT,
		@NAME NVARCHAR(50),
		@PETCUR INT,
		@PETMAX INT,
		@PETSID INT

SET @CUR = 0
SET @PETCUR = 0
SET @MAX = (SELECT COUNT(*) FROM dbo.Character WHERE name LIKE '%@%')

PRINT CONCAT(N'There are a total of ', @MAX, N' deleted characters')

WHILE @CUR < @MAX 
BEGIN
	SET @SID = (SELECT TOP(1) sid FROM dbo.Character WHERE name LIKE '%@%')
	SET @NAME = (SELECT TOP(1) name FROM dbo.Character WHERE sid = @SID)

	PRINT CONCAT(N'Processing entry ', @CUR, N' of ', @MAX,  N' with SID: ', @SID, N' and NAME: ', @NAME)
	
	DELETE FROM dbo.Character WHERE sid = @SID
	DELETE FROM dbo.Auction WHERE seller_id = @SID
	DELETE FROM dbo.Denials WHERE owner_id = @NAME OR denial_id = @NAME
	DELETE FROM dbo.EventAreaEnterCount WHERE player_id = @SID
	DELETE FROM dbo.Farm WHERE owner_id = @SID
	DELETE FROM dbo.Favor WHERE owner_id = @SID
	DELETE FROM dbo.Friends WHERE owner_id = @NAME or friend_id = @NAME
	DELETE FROM dbo.GuildMember WHERE player_id = @SID
	DELETE FROM dbo.Item WHERE owner_id = @SID
	DELETE FROM dbo.ItemCoolTime WHERE owner_id = @SID
	DELETE FROM dbo.ItemKeeping WHERE owner_id = @SID
	DELETE FROM dbo.Party WHERE leader_id = @SID
	DELETE FROM dbo.Quest WHERE owner_id = @SID
	DELETE FROM dbo.QuestCoolTime WHERE owner_id = @SID
	DELETE FROM dbo.RankingScore WHERE owner_id = @SID
	DELETE FROM dbo.Skill WHERE owner_id = @SID
	DELETE FROM dbo.State WHERE owner_id = @SID
	DELETE FROM dbo.Title WHERE owner_id = @SID
	DELETE FROM dbo.TitleCondition WHERE owner_id = @SID

	SET @PETMAX = (SELECT COUNT(*) FROM dbo.Summon WHERE owner_id = @SID)

	PRINT CONCAT(@PETMAX, N' Pets detected for this character.')
	
	WHILE @PETCUR < @PETMAX 
	BEGIN
		SET @PETSID = (SELECT TOP(1) sid FROM dbo.Summon WHERE owner_id = @SID)
		DELETE FROM dbo.Summon WHERE sid = @PETSID
		DELETE FROM dbo.Item WHERE summon_id = @PETSID
		DELETE FROM dbo.Skill WHERE summon_id = @PETSID
		DELETE FROM dbo.State WHERE summon_id = @PETSID

		SET @PETCUR = @PETCUR + 1

		PRINT CONCAT(N' Pet bearing sid ', @PETSID, N' and all related information deleted.')
	END

	PRINT N'Delete Successful'

	SET @CUR = @CUR + 1
END

you was gone for long, wasn't you?
gavsta is offline  
Old   #6
 
elite*gold: 0
Join Date: Oct 2012
Posts: 124
Received Thanks: 12
this will make your Telecaster fully cleaned .
i like this .
MrStubborn is offline  
Old   #7

 
elite*gold: 44
Join Date: Sep 2014
Posts: 104
Received Thanks: 162
welcome back ,I like this query the official use it .


Ghost Informatics is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[Problem]Can not be deleted characters
Hi Community I use the ROC source, input error when deleting character. Please tell me how to fix it.:handsdown:
6 Replies - Flyff PServer - Discussions / Questions
[TUTORIAL]Log Deleted Characters
Ever wanted to ban a hacker that deletes his character, and changes his IP before you can ban him? Well, you can log what character he deletes,...
7 Replies - Dekaron Private Server
Deleted All Characters [ClupMt2]
Deleted All Characters==???
21 Replies - Metin2 PServer - Discussions / Questions



All times are GMT +2. The time now is 21:02.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.