USE [BR_AccountTest]
GO
/****** Object: StoredProcedure [dbo].[_CertifyTB_User] Script Date: 12/28/2011 18:22:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- 4. ALTER PROCEDURE _CertifyTB_User
ALTER PROCEDURE [dbo].[_CertifyTB_User]
@szUserID varchar(25),
@szPassword varchar(50)
AS
if exists (
select
''
from _Punishment with ( nolock )
where SerialNo = (
select
max( SerialNo ) from _BlockedUser with ( nolock )
where UserJID = ( SELECT JID FROM TB_User WHERE StrUserID = @szUserID ) and
Type = 99 and getdate() between timeBegin and timeEnd ) )
begin
select convert( tinyint, 3), ( select JID from TB_User where StrUserID = @szUserID ), convert( tinyint, 0), convert( tinyint, 0)
return
end
if exists (select 1 from TB_User where StrUserID=@szUserID and block=1 and expired>=GETDATE())
begin
select convert( tinyint, 3), ( select JID from TB_User where StrUserID = @szUserID ), convert( tinyint, 0), convert( tinyint, 0)
return
end
declare @nUserJID int
declare @sec_primary tinyint
declare @sec_content tinyint
set @nUserJID = 0
set @sec_primary = 0
set @sec_content = 0
-- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- ?????? ?????????? ???????? ??????
declare @ApplyType tinyint
declare @AccPlayTime int
declare @LatestUpdateTime_ToPlayTime int
set @ApplyType = 0 -- ?????? ?????????? ???????? ?????????? ???????? ???? ?????????? ???? ??????
set @AccPlayTime = 0
set @LatestUpdateTime_ToPlayTime = 0
-- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- ?????? ?????? ???? ????
-- select @nUserJID = JID, @sec_primary = sec_primary, @sec_content = sec_content from TB_User
SELECT @nUserJID = JID, @sec_primary = sec_primary, @sec_content = sec_content
, @AccPlayTime = AccPlayTime, @LatestUpdateTime_ToPlayTime = LatestUpdateTime_ToPlayTime FROM TB_User
WHERE StrUserID = @szUserID and password = @szPassword
--and AT=1
-- Edit For fatigue system
-- Please, fill value to @ApplyType ( 1 : TEEN USER , 2 : ADULT USER ) from your web database
-- ex ) @ApplyType = exec web.proc.certify
if( @nUserJID = 0 or @nUserJID is null or @@error <> 0 or @@rowcount = 0)
begin
-- ?????? ?????? ???? ????
select convert( tinyint, 1), convert( int, 0), convert( tinyint, 0), convert( tinyint, 0)
--select convert( tinyint, 1), convert( int, 0), convert( tinyint, 0), convert( tinyint, 0), convert(tinyint, 0), convert(int, 0), convert(int, 0)
return
end
if( exists( select Type from _BlockedUser where UserJID = @nUserJID and Type = 1 and getdate() between timeBegin and timeEnd))
begin
-- ?????? ?????? ???? ????
select convert( tinyint, 3), @nUserJID, convert( tinyint, 0), convert( tinyint, 0)
--select convert( tinyint, 3), @nUserJID, convert( tinyint, 0), convert( tinyint, 0), convert(tinyint, 0), convert(int, 0), convert(int, 0)
return
end
-- ?????? ?????? ???? ????
select convert(tinyint, 0), @nUserJID, @sec_primary, @sec_content
--select convert(tinyint, 0), @nUserJID, @sec_primary, @sec_content, @ApplyType, @AccPlayTime, @LatestUpdateTime_ToPlayTime
return