搜索
 找回密码
 加入

谁有 ACCOUNT_NATION_CHECK 这个存储过程?

hackerneo 2008-12-3 13:56:40 1153
提示: 作者被禁止或删除 内容自动屏蔽

4 回复

ctgwglzc
2008-12-3 12:52:13
点击查看详情
  1. /****** Object:  Stored Procedure dbo.ACCOUNT_NATION_CHECK2    Script Date: 6/6/2006 6:03:33 PM ******/

  2. -- 팀장님 중국 재미있어요? --;
  3. -- 팀장님 땜에 전 이 고달픈 프로시져 짜야 되요 ㅠ.ㅠ

  4. CREATE PROCEDURE ACCOUNT_NATION_CHECK2 AS
  5. ------------------------------------------------------------------------------------------------
  6. -- 변수들을 선언하는 부분

  7. DECLARE @strAccountID char(31), @strCharID1 char(31), @strCharID2 char(31), @strCharID3 char(31)   
  8. DECLARE @bNation tinyint, @bCharNum tinyint, @row tinyint
  9. DECLARE @bNation1 tinyint, @bNation2 tinyint, @bNation3 tinyint -- 이건 국가 차이 ^^;

  10. SET @strAccountID = null
  11. SET @strCharID1 = null
  12. SET @strCharID2 = null
  13. SET @strCharID3 = null
  14. SET @bNation = 0
  15. SET @bCharNum = 0
  16. SET @bNation1 = 0
  17. SET @bNation2 = 0
  18. SET @bNation3 = 0
  19. SET @row = 0

  20. --------------------------------------------------------------------------------------------------
  21. -- 이 부분은 계정과 캐릭의 국가가 틀린 유저들을 임시 테이블에 넣는다.
  22. DECLARE Backup_Cursor CURSOR FOR                                       
  23.         SELECT strAccountID, bNation, bCharNum, strCharID1, strCharID2, strCharID3
  24.         FROM ACCOUNT_CHAR WHERE bCharNum > 0       

  25.         OPEN Backup_Cursor
  26.         FETCH NEXT FROM Backup_Cursor INTO @strAccountID, @bNation, @bCharNum,
  27.                         @strCharID1, @strCharID2, @strCharID3
  28.                                
  29. WHILE @@FETCH_STATUS = 0
  30. BEGIN       
  31.         SET @bNation1 = 0
  32.         SET @bNation2 = 0
  33.         SET @bNation3 = 0
  34. /*
  35.         SELECT @row = count(*)
  36.         FROM ACCOUNT_NATION_CHECK                 -- 이 테이블에다가 명단을 넣을 계획임
  37.         WHERE strAccountID = @strAccountID
  38. */
  39. -----------------------------------------------------------
  40. -- 비교될 캐릭들의 국가 정보 얻어온다 :)
  41.         SELECT @bNation1 = Nation                        -- 첫번째 비교 캐릭
  42.         FROM USERDATA WHERE strUserID = @strCharID1        
  43.        
  44.         SELECT @bNation2 = Nation                        -- 두번째 비교 캐릭
  45.         FROM USERDATA WHERE strUserID = @strCharID2        
  46.        
  47.         SELECT @bNation3 = Nation                        -- 세번째 비교 캐릭
  48.         FROM USERDATA WHERE strUserID = @strCharID3        
  49. ------------------------------------------------------------
  50.         IF (((@bNation <> @bNation1) AND @bNation1 > 0) OR ((@bNation <> @bNation2) AND @bNation2 > 0 )
  51.                 OR ((@bNation <> @bNation3)  AND @bNation3 > 0))
  52.         BEGIN
  53.                 INSERT INTO ACCOUNT_NATION_CHECK(strAccountID, byAC_Nation, byChar_N1, byChar_N2, byChar_N3, strChar_ID1, strChar_ID2, strChar_ID3)
  54.                 VALUES (@strAccountID, @bNation, @bNation1, @bNation2, @bNation3, @strCharID1, @strCharID2, @strCharID3 )               
  55.         END
  56.        
  57.         FETCH NEXT FROM Backup_Cursor INTO @strAccountID, @bNation, @bCharNum,
  58.                         @strCharID1, @strCharID2, @strCharID3
  59. END

  60. CLOSE Backup_Cursor
  61. DEALLOCATE Backup_Cursor


  62. GO
复制代码
demon2k
2008-12-3 13:01:20
我怀疑所谓的密码不对是因为有的端在读取数据库时对密码是采取了某些算法的,但是存储密码使用的使明码存储造成了这种现象
yangwx
2008-12-3 13:33:39
原帖由 demon2k 于 2008-12-3 13:01 发表
我怀疑所谓的密码不对是因为有的端在读取数据库时对密码是采取了某些算法的,但是存储密码使用的使明码存储造成了这种现象

登陆密码应该是由这个存储过程来判断滴

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 [dbo].[TB_USER] 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
demon2k
2008-12-3 13:56:40
谢谢,我去看一下 :)
高级模式
游客