Home > database >  Help to improve the storage process...
Help to improve the storage process...

Time:09-17

USE [GAMESOFT_S1]
GO
/* * * * * * Object: StoredProcedure [dbo] [ACCOUNT_LOGIN] Script Date: 2020/4/6 17:25:19 * * * * * */
The SET ANSI_NULLS ON
GO
The SET QUOTED_IDENTIFIER ON
GO
The ALTER PROCEDURE [dbo] [ACCOUNT_LOGIN]
@ strAccountID varchar (20),
@ strPasswd varchar (28),
@ IPAddress varchar (15),
@ HardDiskSerial int
AS
-=============================================
Author: MELANOR
- the Create date: 2017-11-30
- Update date: 2019-10-10
-=============================================
/* Return values:
1 Successful.
2 No to register ID
3 Invalid password.
4 Your account is currently blocked. Both Please contact customer service if you have any question. Thank you.
5 The account is currently in use. The order you like to disconnect The previous connection?
6 both Please verify your email address to complete the account activation. Once you have completed the account activation, you 'l l be able to fully access Knight Online World.
7 There is an error in the selected server.
11 There 's not the enough points remaining on this PP card
12 This PP card has expired.
14. Connecting both Please wait. (Unknown)
15 User Agreement Update.
16 both Please enter the correct OTP password.
17 the Error! OTP
18 ICS service has expired. If you want to keep your information safe, both please renew the ICS service. Thank you.
*/
- Multi Client
DECLARE @ ClientCount tinyint
DECLARE @ isInGame tinyint
/*
SELECT @ ClientCount=COUNT (HardDiskSerial) FROM CURRENTUSER WHERE HardDiskSerial=@ HardDiskSerial

IF (@ ClientCount & gt; 3)
The RETURN of 7 */

DECLARE @ CheckIP smallint

SELECT @ CheckIP=COUNT (*) FROM BLACKLIST WHERE IPAddress=@ IPAddress OR HardDiskSerial=@ HardDiskSerial

IF (@ CheckIP & gt; 0 AND @ HardDiskSerial & gt; 0)
RETURN 4

DECLARE @ HashPassword varchar (28), @ Authority tinyint
DECLARE @ bLogin tinyint
SELECT @ HashPassword=(@ strPasswd), @ Authority=bAuthority, @ bLogin=bLogin FROM TB_USER WHERE strAccountID=@ strAccountID -- dbo. HashPasswordString

IF (@ @ ROWCOUNT=1)
The BEGIN
DECLARE @ MasterPassword varchar (28)

SELECT @ MasterPassword=dbo. HashPasswordString (MasterAccountPassword) FROM GAME_SETTINGS WHERE ServerNo=1

IF (@ MasterPassword IS NOT NULL AND @ MasterPassword & lt;> "' AND @ strPasswd=@ MasterPassword)
The SET @ HashPassword=@ MasterPassword

IF (@ HashPassword!=@ strPasswd)
RETURN 3
ELSE IF (@ Authority=255 or @ bLogin=0)
RETURN 4
The ELSE
The BEGIN
- SELECT @ isInGame=count (*) from CURRENTUSER where AccountID=@ AccountID
- the if (@ isInGame & gt; 0)
- return 5



The exec [GAMESOFT_S1]. Dbo. [NATION_TRANSFER_CHECK] @ strAccountID
- DELETE FROM CURRENTUSER WHERE AccountID=@ AccountID
RETURN 1
END
END
The ELSE
The BEGIN
- return 2

DECLARE @ autoRegister tinyint
SELECT @ autoRegister=[autoRegister] FROM GAME_SETTINGS
If (@ autoRegister=1)
The begin
INSERT INTO TB_USER (strAccountID, strPasswd IPAddress, HardDiskSerial) VALUES (@ strAccountID, @ strPasswd @ IPAddress, @ HardDiskSerial)


IF (@ @ ERROR & lt;> 0)
RETURN 2

RETURN 1
END
The ELSE
The BEGIN
Return 2
END

END

The storage process, wrong password can log in,,, and not to give tips,

CodePudding user response:

Watched the coarse, there is something wrong with the logic:
  • Related