搜索
 找回密码
 加入

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

ctgwglzc 2008-12-13 12:05:43 1255
  1. set ANSI_NULLS ON
  2. set QUOTED_IDENTIFIER ON
  3. GO
  4. ALTER PROCEDURE [dbo].[ACCOUNT_LOGIN]
  5. @AccountID        varchar(21),
  6. @Password        varchar(13),
  7. @nRet                smallint        OUTPUT

  8. AS

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

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

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

  15. -----------------------------------Process Login----------------------------------------

  16. DECLARE @Nation tinyint, @CharNum smallint, @PremyName varchar(21), @Auth tinyint, @Charid char(21)
  17. SET @Nation = 0
  18. SET @CharNum = 0
  19. DECLARE @pwd varchar(13)
  20. SET @pwd = null
  21. SELECT @pwd = strPasswd FROM TB_USER WHERE strAccountID = @AccountID  and  idays>0
  22. IF @pwd IS null
  23. BEGIN
  24.    
  25.     --SET @nRet = 0
  26.              SET @nRet = 4
  27.         RETURN
  28. END
  29. ELSE IF @pwd <> @Password
  30. BEGIN
  31.         --SET @nRet = 0
  32.              SET @nRet = 3
  33.         RETURN
  34. END

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

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

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

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

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

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

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

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

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

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

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

  55. BEGIN
  56.         SET @nRet = 1 -- Successfull Transaction
  57.         RETURN
  58. END

  59. ------------------------------Successfull Transaction-----------------------------------

  60. SELECT @Nation = bNation, @CharNum = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
  61. IF @@ROWCOUNT = 0
  62. BEGIN
  63.         SET @nRet = 1
  64.         RETURN
  65. END
  66. IF @CharNum = 0
  67. BEGIN
  68.         SET @nRet = 1
  69.         RETURN
  70. END
  71. ELSE
  72. BEGIN
  73. SET @nRet = 1
  74.         RETURN
  75. END
复制代码

2 回复

121
2008-12-13 11:02:51
点击查看详情
这个是2005数据库哦..有些地方要改改才能用饿..
121
2008-12-13 12:05:43
顶顶..让更多人能看到这个
高级模式
游客