08-05-2016, 02:15 AM
|
#3
|
مـديـر عـام
|
• الانـتـسـاب » Dec 2007
|
• رقـم العـضـويـة » 6993
|
• المشـــاركـات » 7,032
|
• الـدولـة » Cairo
|
• الـهـوايـة » Helping ppl
|
• اسـم الـسـيـرفـر » Private Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 92
|
|
|
رد: مشكله في مسح الاملات بعد سبع ايام؟
كود:
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
|
|
|