sxy 发表于 2008-10-26 12:47:52

提示密码错误分析

当我删除 ACCOUNT_LOGIN 然后在查询分析器里输入下面的内容 F5 后 再次进入游戏 提示密码 错误 是不是这个过程有什么问题呢?
CREATE PROCEDURE ACCOUNT_LOGIN
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT

AS


DECLARE @Nation tinyint, @CharNum smallint
SET @Nation = 0
SET @CharNum = 0

DECLARE @pwd varchar(13)

SET @pwd = null

SELECT @pwd = strPasswd FROM . WHERE strAccountID = @AccountID and idays=6
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

DECLARE @gokhantasci varchar(21)
select @gokhantasci = count(straccountid) FROM premium_service WHERE strAccountID = @AccountID

if @gokhantasci = 0
begin
insert into PREMIUM_SERVICE (strAccountID, strType, nDays) VALUES (@AccountID, 1, 3)
end

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 = @Nation+1
--SET @nRet = 1
RETURN
END
GO

[ 本帖最后由 sxy 于 2008-10-26 13:38 编辑 ]

sxy 发表于 2008-10-26 13:12:56

谁能对这段有什么错误的地方指正一下啊

网络红尘 发表于 2008-10-26 13:24:36

回复 2# 的帖子

我现在换个库就是卡号的毛病 1次能进 2次就卡的看不见角色3次看的见角色也开始不了一直这样    你看下我的login存储过程是这个

CREATE PROCEDURE ACCOUNT_LOGIN
@AccountID        varchar(21),
@Password        varchar(13),
@nRet                smallint        OUTPUT

AS


DECLARE @Nation tinyint, @CharNum smallint
SET @Nation = 0
SET @CharNum = 0

DECLARE @pwd varchar(13)

SET @pwd = null

SELECT @pwd = strPasswd FROM . 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

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 = @Nation+1
             --SET @nRet = 1
        RETURN
END
GO


希望对你有帮助不防复制过去看下

sxy 发表于 2008-10-26 13:39:22

不提示密码错误的存储过程

CREATE PROCEDURE ACCOUNT_LOGIN         
@AccountID        varchar(21),
@Password        varchar(13),
@nRet                smallint        OUTPUT
AS
DECLARE @Nation tinyint, @CharNum smallint
SET @Nation = 0
SET @CharNum = 0
DECLARE @pwd varchar(13)
SET @pwd = null

SELECT @pwd = strPasswd FROM . 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
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
GO

sxy 发表于 2008-10-26 13:54:12

通过实验其他错误的地方更改无影响 当插入下面的语句 提示密码错误
DECLARE @gokhantasci varchar(21)
select @gokhantasci = count(straccountid) FROM premium_service WHERE strAccountID = @AccountID

if @gokhantasci = 0
begin
insert into PREMIUM_SERVICE (strAccountID, strType, nDays) VALUES (@AccountID, 1, 3)
end

ymhuang 发表于 2008-10-27 09:45:31

原帖由 sxy 于 2008-10-26 13:54 发表 http://www.kofans.cn/bbs/static/image/common/back.gif
通过实验其他错误的地方更改无影响 当插入下面的语句 提示密码错误
DECLARE @gokhantasci varchar(21)
select @gokhantasci = count(straccountid) FROM premium_service WHERE strAccountID = @AccountID

if @ ...
事实上,我觉得和ACCOUNT_LOGIN的关系不是很大,主要还是研究下ACCOUNT_LOGOUT吧。
你这个存储过程,是查询是否有‘神之祝福’的用户,如果没有就给3天神之祝福。
个人观点,说的不对的多多指教。

sxy 发表于 2008-10-27 12:42:42

谢谢 提醒 本人不知道这个是什么意思 回头再看看你说的那个有什么不同
页: [1]
查看完整版本: 提示密码错误分析