- Katılım
- 9 May 2023
- Mesajlar
- 165
- Tepkime puanı
- 56
- Puanları
- 0
Merhabalar, bu yazıda sizlere 7 gün içinde karakter silmeye çalıştığınızda eğer silinmiyorsa düzeltmeniz gereken prosedürleri paylaşacağım. Düzeltmeniz gereken 3 adet prosedür bulunmakta bunları aşağıya ekliyorum, doğrudan kendi SQL’inize okutabilirsiniz.
1.Prosedür
2. Prosedür
3. Prosedür
1.Prosedür
Kod:
SQL:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_DeleteCharPermanently] Script Date: 02/14/2012 12:54:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
--!!!CHECK!!!
ALTER PROCEDURE [dbo].[_DeleteCharPermanently] @charID as int
as
------------------------------------
-- ?? ??? ???? ?? ??!
------------------------------------
if (not exists(select charid from _deletedchar where charid = @charID))
begin
return -1
end
------------------------------------
-- ??? ??? ??? ?? 7?? ??? ?? (??? ?? ??? ??? ????...)
------------------------------------
declare @DeLeTed_date datetime
declare @cur_date datetime
declare @elapsed_min int
declare @userJID int
-- declare @DeLeTed_slot int
set @cur_date = getdate()
select @userJID = UserJID, / @DeLeTed_slot = CharSlot,*/ @DeLeTed_date = deleteddate from _deletedchar with (nolock) where charid = @charID
-- ????? 6? + 23?? ??? ?? ????? (1?? ??? ???? ??? ?? ??~)
set @elapsed_min = datediff(minute, @DeLeTed_date, @cur_date)
if @elapsed_min < ((60 * 24 * 6) + (60 * 23)))
begin
return -2
end
------------------------------------
-- ??? ??? ??? ???? ??
------------------------------------
declare @is_deleted tinyint
select @is_deleted = deleted from _Char where CharID = @charID
if (@is_deleted <> 1)
begin
return -3
end
------------------------------------
-- ?? ??? _User ? ?? CharID? ????? ??
------------------------------------
declare @char_id_to_check int
set @char_id_to_check = 0
/* -- commented by novice. for server integration.
if @DeLeTed_slot = 0)
begin select @char_id_to_check = CharID1 from _User where UserJID = @userJID end
else if @DeLeTed_slot = 1)
begin select @char_id_to_check = CharID2 from _User where UserJID = @userJID end
else if @DeLeTed_slot = 2)
begin select @char_id_to_check = CharID3 from _User where UserJID = @userJID end
else
begin
return -4
end
-- ?! ??? ???? ??? ?? ??? ???? ??!
if @char_id_to_check <> @charID)
begin
return -5
end
*/
-- start by novice.
select @char_id_to_check = CharID from _User where UserJID = @userJID and CharID = @charID
if @char_id_to_check = 0)
begin
-- ?? ???? _User ? ???
return -5
end
-- finish by novice.
begin transaction
declare @GuildID int
exec @GuildID = _DeleteCharPermanently_NoTX @userJID, @charID --, @DeLeTed_slot
if (@GuildID is null)
set @GuildID = -10000
if (@GuildID < 0)
begin
rollback transaction
return @GuildID
end
commit transaction
return @GuildID
2. Prosedür
Kod:
SQL:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_DeleteCharPermanently_NoTX] Script Date: 02/14/2012 12:54:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[_DeleteCharPermanently_NoTX]
@userJID INT
, @charID INT
AS
------------------------------------
-- Inventory¶û ±×¾È¿¡ °¡Áö°í ÀÖ´ø ¾ÆÀÌşÛµé ³¯·Á¹ö¸®ÀÚ...
------------------------------------
-------------- Æê ¼Òȯ ¾ÆÀÌşÛºÎşÍ ÀÏ´Ü »èÁ¦ ----------------
declare @result int
declare @slot tinyint
declare @refItemID int
declare pc_inv_cursor cursor fast_forward for
select inv.slot
from _Inventory as inv join _Items as it on inv.ItemID = it.ID64
where
(inv.CharID = @charID and inv.Slot >= 13 and inv.ItemID > 0) and -- Àåºñâ Á¦¿ÜÇÏ°í ¾ÆÀÌşÛ ÀÖ´Â ¼ø¼ö Àκ¥şä¸® ¾È¿¡ µé¾îÀÖÀ¸¸ç
(it.Data <> 0) and -- ¼Òȯ¼ö¸¦ °¡Áö°í ÀÖ´Â
(exists (select top 1 ID from _RefObjCommon where ID = it.RefItemID and TypeID1 = 3 and TypeID2 = 2)) -- Æê¼Òȯ ¾ÆÀÌşÛµé ã¾ÆÁà~
open pc_inv_cursor
fetch next from pc_inv_cursor into @slot
while @@fetch_status = 0
begin
exec @result = _STRG_DEL_ITEM_NoTX 1, @charID, @slot
if @result < 0)
begin
close pc_inv_cursor
deallocate pc_inv_cursor
return @result
end
fetch next from pc_inv_cursor into @slot
end
close pc_inv_cursor
deallocate pc_inv_cursor
------------------- ³²Àº ¾ÆÀÌşÛµé ¸ùâ »èÁ¦ -------------------
-- ¾ÆÀÌşÛÀÌ Çϳª¶óµµ ÀÖ´Ù¸é...
if (exists (select top 1 itemID from _Inventory where CharID = @charID AND ItemID <> 0))
begin
update _ItemPool Set InUse = 0
from _ItemPool as pool join _Inventory as inv on pool.ItemID = Inv.ItemID
where Inv.CharID = @charID and Inv.ItemID <> 0
end
----------- ¾ÆÀÌşÛµé ³¯·ÈÀ¸´Ï ÃÖÁ¾ÀûÀ¸·ç Àκ¥şä¸® »èÁ¦ ------------
delete from _Inventory where CharID = @charID
if (@@error <> 0)
begin
return -10001
end
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- APPLY_AVATAR_SYSTEM (Çã½Â¿í)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
------------------- ³²Àº ¾Æ¹Ùş¸ Àκ¥şä¸® ¾ÆÀÌşÛµé ¸ùâ »èÁ¦ -------------------
-- ¾ÆÀÌşÛÀÌ Çϳª¶óµµ ÀÖ´Ù¸é...
if (exists (select top 1 itemID from _InventoryForAvatar where CharID = @charID AND ItemID <> 0))
begin
update _ItemPool Set InUse = 0
from _ItemPool as pool join _InventoryForAvatar as InvAva on pool.ItemID = InvAva.ItemID
where InvAva.CharID = @charID and InvAva.ItemID <> 0
end
----------- ¾ÆÀÌşÛµé ³¯·ÈÀ¸´Ï ÃÖÁ¾ÀûÀ¸·ç ¾Æ¹Ùş¸ Àκ¥şä¸® »èÁ¦ ------------
delete from _InventoryForAvatar where CharID = @charID
if (@@error <> 0)
begin
return -10008
end
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- APPLY_AVATAR_SYSTEM (Çã½Â¿í)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
------------------------------------
-- COS »èÁ¦
------------------------------------
/*
declare @engaged_cos int
set @engaged_cos = 0
select @engaged_cos = EngagedCOS from _char with (nolock) where CharID = @charID
if (@engaged_cos = 0)
begin
-- ¿Ö ¹ß»ıÇÏ´Â Áö Àß ¸ğ¸£°ÚÁö¸¸... ¾ÆÁÖ µå¹°°Ô COS ¸¸ ³²¾ÆÀÖ´Â °æ¿ì°¡ ÀÖ´õ¶ó°í... -_-;
select @engaged_cos = ID from _CharCOS with (nolock) where OwnerCharID = @charID
if (@engaged_cos is null)
set @engaged_cos = 0
end
if (@engaged_cos is not null and @engaged_cos <> 0)
begin
declare @return_Del_COS int
exec @return_Del_COS = _DeleteCharCOS_NoTX @charID, @engaged_cos
if @return_Del_COS < 0)
begin
return -10002
end
end
*/
------------------------------------
-- Trijob µ¥ÀÌşÍ »èÁ¦
------------------------------------
delete from _CharTrijob where CharID = @charID
------------------------------------
-- ½ºş³ »èÁ¦
------------------------------------
delete _CharSkill where CharId = @charID
delete _CharSkillMastery where charId = @charID
------------------------------------
-- Äù½ºÆ® »èÁ¦
------------------------------------
delete _CharQuest where CharID = @charID
------------------------------------
-- ±æµå ¸â¹ö »èÁ¦
------------------------------------
-- !!! ¸¸¾à ¿©±â¼* Guild ¸â¹ö »èÁ¦°¡ ÀϾÁö ¾ÊÀ¸¸é ShardManager ¿¡¼*
-- _Guild_DelMember È£ÃâÇØ ÁÖµµ·Ï ¼öÁ¤ÇØ¾ß ÇÑ´Ù! Áö±İÀº ±× °úÁ¤Àº SkipÇÏ°í
-- ¸Ş¸ğ¸®¿¡¼* »èÁ¦¸¸ ÀϾ°Ô µÇ¾î ÀÖ°şµ¢...
declare @GuildID int
set @GuildID = 0
select @GuildID = GuildID from _char where charid = @charID
if (@GuildID is not null and @GuildID <> 0)
begin
if (not exists (select ID from _Guild where ID = @GuildID))
begin
update _Char set GuildID = 0 where CharID = @charID
end
else
begin
declare @return_Del_GuildMember int
exec @return_Del_GuildMember = _Guild_DelMember_NoTX @GuildID, @charID
if @return_Del_GuildMember < 0)
return -10003
end
end
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- APPLY_MENTOR_SYSTEM (ÃÖÀÎÈ£)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
DECLARE @campID INT
SET @campID = 0
SELECT @campID = CampID FROM _TrainingCampMember WHERE CharID = @charID
IF @campID IS NOT NULL AND @campID <> 0)
BEGIN
DECLARE @ret_DelCampMember INT
EXEC @ret_DelCampMember = _TRAINING_CAMP_DELMEMBER @campID, @charID, 0
IF @ret_DelCampMember < 0)
RETURN -10007
END
-- ÀÖÀ¸¸é Áö¿ö¹ö¸®ÀÚ~ ¹¹.
DELETE FROM _TrainingCampSubMentorHonorPoint WHERE CharID = @charID
-- °æÇèÄ¡ ¹öÇÁ ·¹Äڵ嵵~~ ¤»¤»
DELETE FROM _TrainingCampBuffStatus WHERE CampID = @campID
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- APPLY_MENTOR_SYSTEM (ÃÖÀÎÈ£)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-----------------------------------
-- Ä£±¸ ¸®½ºÆ® »èÁ¦ ( ³ªÀÇ Ä£±¸ ¸®½ºÆ® + Ä£±¸ÀÇ Ä£±¸ ¸®½ºÆ®Áß ³ª )
-----------------------------------
-- ³» Ä£±¸µé..
declare @FriendCharID int
declare @cursor_var cursor
set @cursor_var = cursor fast_forward
for
select FriendCharID
from _Friend
where CharID = @charID
open @cursor_var
fetch next from @cursor_var into @FriendCharID
while( @@FETCH_STATUS = 0 )
begin
delete _Friend where CharID = @FriendCharID and FriendCharID = @charID
fetch next from @cursor_var into @FriendCharID
end
close @cursor_var
deallocate @cursor_var
-- ³ª..
delete _Friend where CharID = @charID
-----------------------------------
-----------------------------------
-- ÂÊÁö »èÁ¦
-----------------------------------
delete _Memo where CharID = @charID
------------------------------------
-- TimedJob »èÁ¦Çϱâ
------------------------------------
delete _TimedJob where CharID = @charID
------------------------------------
-- Static Avatar Á¤º¸ »èÁ¦
------------------------------------
delete from _staticavatar where charid = @charID
------------------------------------
-- ±Ó¸» ºí·° Á¤º¸ »èÁ¦
------------------------------------
delete from _BlockedWhisperers where OwnerID = @charID
------------------------------------
-- _DeletedChar Entry »èÁ¦
------------------------------------
delete from _DeletedChar where CharID = @charID
if (@@error <> 0)
begin
return -10004
end
-- start by novice.
DELETE FROM _User WHERE UserJID = @userJID and CharID = @charID
-- finish by novice.
------------------------------------
-- commit !!!
------------------------------------
-- ş¬¶óÀ̾ğÆ®¿ë Äü½½·Ô Á¤º¸ ÀúÀå ş×ÀÌºí ³¯¸®±â!!!
exec _RemoveClientConfig @charID -- by novice...... for saving client configurations...
return @GuildID
3. Prosedür
Kod:
SQL:
USE [SRO_VT_ACCOUNT]
GO
/****** Object: StoredProcedure [dbo].[_ManageShardCharName] Script Date: 02/14/2012 12:56:27 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER procedure [dbo].[_ManageShardCharName]
@job tinyint,
@userJID int,
@ShardID smallint,
@charname varchar(64),
@oldName varchar(64)
as
-- add new char name
if (@job = 0)
begin
if (not exists(select * from SR_ShardCharNames where UserJID = @userJID and ShardID = @ShardID and CharName = @charname))
begin
insert SR_ShardCharNames values @userJID, @ShardID, @charname)
end
end
-- remove char name
else if (@job = 1)
begin
delete SR_ShardCharNames where UserJID = @userJID and ShardID = @ShardID and CharName = @charname
-- delete SR_CharAppoint where UserJID = @userJID and ShardID = @ShardID and CharID = @charname
end
-- rename previous one
else if (@job = 2)
begin
update SR_ShardCharNames set CharName = @charname where UserJID = @userJID and ShardID = @ShardID and CharName = @oldName
-- update SR_CharAppoint set CharID = @charname where UserJID = @userJID and ShardID = @ShardID and CharID = @oldName
end