搜索
 找回密码
 加入

No Premium Block

ctgwglzc 2009-4-14 22:43:39 869
If you want to make a Pay 2 Play server, add this account login Procedure or Update your own:
  1. USE [KN_ONLINE]
  2. set ANSI_NULLSON
  3. set QUOTED_IDENTIFIERON
  4. ---------- //Created by Zenocide// ---------
  5. GO

  6. CREATE PROCEDURE [dbo].[ACCOUNT_LOGIN]

  7. @AccountID varchar(21),
  8. @Password varchar(13),
  9. @nRet smallintOUTPUT

  10. AS

  11. DECLARE @Nation tinyint, @CharNum smallint, @PremyName varchar(21)

  12. -----------------------------------Process Login----------------------------------------
  13. SET @Nation = 0
  14. SET @CharNum = 0
  15. DECLARE @pwd varchar(13)
  16. SET @pwd =null
  17. SELECT @pwd = strPasswd FROM TB_USER WHERE strAccountID = @AccountID and idays>0
  18. IF @pwd ISnull
  19. BEGIN

  20. --SET @nRet = 0
  21. SET @nRet = 4
  22. RETURN
  23. END
  24. ELSEIF @pwd <> @Password
  25. BEGIN
  26. --SET @nRet = 0
  27. SET @nRet = 3
  28. RETURN
  29. END
  30. ----------------------------Premium Check-----------------------------------------------
  31. select @PremyName = strAccountID from PremiumCheck where strAccountID = @AccountID
  32. IF @PremyName = @AccountID -- Define Premium Account Name Check
  33. BEGIN
  34. SET @nRet = 12 -- Give notice, edit in texts.tbl
  35. RETURN
  36. END

  37. ------------------------------Successfull Transaction-----------------------------------
  38. SELECT @Nation = bNation, @CharNum = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
  39. IF@@ROWCOUNT= 0
  40. BEGIN
  41. SET @nRet = 1
  42. RETURN
  43. END
  44. IF @CharNum = 0
  45. BEGIN
  46. SET @nRet = 1
  47. RETURN
  48. END
  49. ELSE
  50. BEGIN
  51. SET @nRet = 1
  52. RETURN
  53. END
复制代码
随机推荐

2 回复

ctgwglzc
2009-4-14 22:43:08
楼主
点击查看详情
Next you will need to add a new Table, add the Following.
  1. USE [KN_online]
  2. GO
  3. /****** Object:  Table [dbo].[PremiumCheck]    Script Date: 09/26/2008 11:07:28 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. SET ANSI_PADDING ON
  9. GO
  10. CREATE TABLE [dbo].[PremiumCheck](
  11. [strAccountID] [varchar](21) COLLATE Latin1_General_CI_AI NOT NULL
  12. ) ON [PRIMARY]
  13. GO
  14. SET ANSI_PADDING OFF
复制代码
ctgwglzc
2009-4-14 22:43:39
楼主
You now have a Pay 2 Play server, depending on the structure of your premium scripts/procedures you can add other checks e.g to auto insert a users id who buys premium and to Auto remove the user when they have no more premium days.

I will let you figure this one out, its quiet easy.

To block a user manually just simpily enter there accountid into the PremimCheck table.
高级模式
游客