ctgwglzc 发表于 2008-12-13 00:40:37

ACCOUNT_LOGIN存储,需要的可以参考。淘气提供的

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE .
@AccountID        varchar(21),
@Password        varchar(13),
@nRet                smallint        OUTPUT

AS

----------------------------------Client Auto Account Registration(登陆器自动帐号注册)---------------------------

--select @nRet = count(straccountid) from tb_user where straccountid = @AccountID

--if @nRet = 0
--begin
--insert into tb_user (straccountid, strpasswd, strSocNo, idays, strAuthority) values (@AccountID, @password, 1, '6', 1)
--end

-----------------------------------Process Login----------------------------------------

DECLARE @Nation tinyint, @CharNum smallint, @PremyName varchar(21), @Auth tinyint, @Charid char(21)
SET @Nation = 0
SET @CharNum = 0
DECLARE @pwd varchar(13)
SET @pwd = null
SELECT @pwd = strPasswd FROM TB_USER WHERE strAccountID = @AccountIDandidays>0
IF @pwd IS null
BEGIN
   
    --SET @nRet = 0
             SET @nRet = 4
        RETURN
END
ELSE IF @pwd <> @Password
BEGIN
        --SET @nRet = 0
             SET @nRet = 3
        RETURN
END

------------------------------ Define Changes(限制70级) ------------------------------------------

update userdata set zone = 21 where zone = 202
Update userdata set level = 70, Exp = 500000000, strskill = 'z' , dex = 5, strong = 5, sta = 5, cha = 5, intel = 5 where level > 70
exec RunDupeCheckInn @AccountID

----------------------------Premium Check(神之祝福检查)-----------------------------------------------

select @PremyName = strAccountID from PREMIUM_CHECK where strAccountID = @AccountID

IF @PremyName = @AccountID -- Define Premium Account Name Block

BEGIN
         SET @nRet = 12 -- Give notice "Your Premium days have expired, Please visit the Panel to select Normal Account mode"
      
    RETURN
END

---------------------------------ban check(停权核查)----------------------------------------------

select @Auth = strAuthority from TB_USER where strAccountID = @AccountID

IF @Auth = 255 -- Define login Blocked (TB_USER 'strAuthority')

BEGIN
      SET @nRet = 4 -- Give Notice "Your Account is currently Blocked. Please contact customer Support"
      RETURN
END

else IF @Auth = 1 -- Define Allowed Login (TB_USER 'strAuthority')

BEGIN
      SET @nRet = 1 -- Successfull Transaction
      RETURN
END

------------------------------Successfull Transaction-----------------------------------

SELECT @Nation = bNation, @CharNum = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
IF @@ROWCOUNT = 0
BEGIN
        SET @nRet = 1
        RETURN
END
IF @CharNum = 0
BEGIN
        SET @nRet = 1
        RETURN
END
ELSE
BEGIN
SET @nRet = 1
        RETURN
END

121 发表于 2008-12-13 11:02:51

这个是2005数据库哦..有些地方要改改才能用饿..

121 发表于 2008-12-13 12:05:43

顶顶..让更多人能看到这个
页: [1]
查看完整版本: ACCOUNT_LOGIN存储,需要的可以参考。淘气提供的