Experienced Elementalist
- Joined
- Dec 7, 2006
- Messages
- 250
- Reaction score
- 2
Code:
ALTER PROCEDURE [dbo].[ACCOUNT_LOGIN]
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT
AS
----------------------------------Client Auto Account Registration---------------------------
--REMOVE /* & */ to enable
/*
select @nRet = count(straccountid) from tb_user where straccountid = @AccountID
if @nRet = 0
begin
insert into tb_user (straccountid, strpasswd, strSocNo, idays, strAuthority) values (@AccountID, @password, 1, '6', 1)
end
*/
-----------------------------------Process Login----------------------------------------
DECLARE @Nation tinyint, @CharNum smallint, @PremyName varchar(21), @Auth tinyint, @Charid char(21)
SET @Nation = 0
SET @CharNum = 0
DECLARE @pwd varchar(13)
SET @pwd = null
SELECT @pwd = strPasswd FROM TB_USER WHERE strAccountID = @AccountID and idays>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
------------------------------ Define Changes ------------------------------------------
update userdata set zone = 21 where zone = 202
exec RunDupeCheckInn @AccountID
exec RunDupeCheck @AccountID
exec RunDupeCheck2 @AccountID
--exec DupeDeleter @AccountID compatible only with ourko db
---------------------------------ban check----------------------------------------------
--some extra checks
select @Auth = strAuthority from TB_USER where strAccountID = @AccountID
IF @Auth = 255 -- Define login Blocked (TB_USER 'strAuthority')
BEGIN
SET @nRet = 4 -- Give Notice "Your Account is currently Blocked. Please contact customer Support"
RETURN
END
else IF @Auth = 1 -- Define Allowed Login (TB_USER 'strAuthority')
BEGIN
SET @nRet = @Nation+1
RETURN
END
------------------------------Successfull Transaction-----------------------------------
SELECT @Nation = bNation, @CharNum = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
IF @@ROWCOUNT = 0
BEGIN
SET @nRet = @Nation+1
RETURN
END
IF @CharNum = 0
BEGIN
SET @nRet = @Nation+1
RETURN
END
ELSE
BEGIN
SET @nRet = @Nation+1
RETURN
END
Tested and 100% working, credits to Zenocide for 80% of the procedure cant really tell howmuch% just guessing.
and credits to me for finding out the fix & adding more things.
Woot another epic release, lol.
:laugh: