15-11-2018, 01:25 PM
|
#7
|
|
• الانـتـسـاب » Oct 2007
|
• رقـم العـضـويـة » 3854
|
• المشـــاركـات » 183
|
• الـدولـة »
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر »
|
• الـجـنـس »
|
• نقـاط التقييم » 10
|
|
|
رد: مشكلة فى مسح الاكونت بعد 7 ايام مش بيتمسح
اقتباس:
المشاركة الأصلية كتبت بواسطة Scrox
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
طيب ابعتلى برسودر _DeleteCharPermanently برسودر مش تابل كلامى واضح
|
كود:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_DeleteCharPermanently] Script Date: 11/15/2018 10:23:51 AM ******/
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
|
|
|