Creating character problem.

11/08/2014 12:36 Dotzie#1
Problem:
Creating a character on a ()New created) account and it dissconnect the game (not the server)

Now to the fun part..
After loging in to the account again and recreating same character Bam it works.

But sometimes it ends up Locking the account saying "Your account is blocked now"

I have to runito the server DB and change the "leave state form "1" to "0" and then the account works once again and everything is fine.

The problem is the server is going public.. And i dont have time to sitt inside the DB and change the row "leave" 24/7for 100,1000 Of players lol

Any conclusion on the error? If so please let me know! I really apperciate it (: //Dotzie
11/08/2014 13:15 SnickQ#2
Code:
UPDATE PS_GameData.dbo.Chars SET LoginStatus = 0, LeaveDate = GETDATE() WHERE UserUID = @UserUID
put in usp_Try_GameLogout_R
11/08/2014 13:27 Dotzie#3
A little problem running it, Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@UserUID".

Are you sure its under Character? I would think its under PS_UserData.dbo.Usersmaster
11/08/2014 13:33 SnickQ#4
PS_UserData-->Stored Procedure --> usp_Try_GameLogout_R
11/08/2014 13:34 Dotzie#5
And shouldnt the Triger Update the DB everytime? If so where do i get the prusedure for it lol

Now im lost. I can see the stored Prosedure usp_Try_GameLogout_R however The query you sent does not seem to be completed..
11/08/2014 13:44 SnickQ#6
After log out
[Only registered and activated users can see links. Click Here To Register...]

EDIT:
Try this:
Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER OFF
GO
/****** Object: Stored Procedure dbo.usp_Try_GameLogin_Taiwan Script Date: 2008-6-7 18:34:05 ******/

/*================================================= =
@date 2007-12-04
@brief Login Proc( Taiwan )
================================================== */

ALTER Proc [dbo].[usp_Try_GameLogin_Taiwan]

@UserID varchar(18),
@InPassword varchar(32),

@SessionID bigint,
@UserIP varchar(15),

-- 罹晦梱雖 ?蹂? 檣濠, 釭該雖朝 頂睡 滲熱

@UserUID int = -1,
@LoginType smallint = 1,
@LoginTime datetime = NULL

AS

SET NOCOUNT ON

DECLARE



@Leave tinyint,
@Status smallint,

@CompanyIP varchar(15),
@TempIP varchar(15),
@Check int,
@LeaveDate datetime

/*================================================= =
-1 Invalid ID and Password
-2 Can't connect with the account since it's not selected as free challenger
-3 Account doesn't exist
-4 ID inprocess of termination follwing user's request.
-5 Your account is blocked now. You can't log into the game.
-6 Your account is blocked now. You can't log into the game.
-7 Account still restricted
================================================== */

SET @Status = -1
SET @LoginTime = GETDATE()

--------------------------------------------------
SET @CompanyIP = '61.107.81'
SET @UserIP = LTRIM( RTRIM(@UserIP) )
--------------------------------------------------
SET @Check = 0
--------------------------------------------------

SELECT @UserUID=[UserUID], @Status=[Status], @Leave=[Leave], @LeaveDate=LeaveDate
FROM Users_Master
WHERE UserID = @UserID AND Pw = @InPassword

-- NotExist User OR Leave User
IF( @UserUID = 0)
BEGIN
SET @Status = -3
END
ELSE IF (@Leave = 1) --This blocks a logged in account from being kicked
BEGIN
SET @Status = -5
END
ELSE IF (DATEDIFF(SECOND, @LeaveDate, GETDATE()) < 6)--This is the time delay
BEGIN
SET @Status = -7
END

-- BlockUser Check
IF( (@Status >= 2) AND (@Status <= 6) )
BEGIN
-- Get Block Limit Date AND Replace date text
DECLARE @BlockEndDate datetime
SELECT @BlockEndDate = BlockEndDate FROM Users_Block WHERE UserUID = @UserUID
IF ( @@ROWCOUNT <> 0 )
BEGIN
-- Block Release
IF ( @BlockEndDate <= @LoginTime )
BEGIN
SET @Status = 0
UPDATE Users_Master SET Status = @Status WHERE UserUID = @UserUID
END
END
END

-- Admin IP Check(2006-02-21)
/*
IF( @Status = 16 OR @Status = 32 OR @Status = 48 OR @Status = 64 OR @Status = 80 )
BEGIN
SET @TempIP = LEFT(@UserIP, 9)
IF( @TempIP <> @CompanyIP )
BEGIN
SET @Status = -999
END
END
*/

-- Select
SELECT @Status AS Status, @UserUID AS UserUID

-- Log Insert
IF( @Status = 0 OR @Status = 16 OR @Status = 32 OR @Status = 48 OR @Status = 64 OR @Status = 80 )
BEGIN
UPDATE Users_Master SET Leave = 0, JoinDate = GETDATE() WHERE UserUID = @UserUID
END
SET NOCOUNT OFF
11/08/2014 13:52 Dotzie#7
Worked, However what about UPDATE PS_GameData.dbo.Chars SET LoginStatus = 0, LeaveDate = GETDATE() WHERE UserUID = @UserUID

Do i need to still do something about this?
11/08/2014 13:55 SnickQ#8
If your account still have leave 1 after log out then yes u need
11/08/2014 13:58 Dotzie#9
Thanks alot SnickQ it solved the problem!
11/09/2014 13:06 ShaiyaDeadlyBreath#10
Dotzie SnickQ isn't the reall fix .

If you will use the Dupe fix your items will be dispear....

This is the right line replace it with SnickQ line (at end after IF Statment
UPDATE Users_Master SET Leave =1 , JoinDate = GETDATE() WHERE UserUID = @UserUID

The Procedure Game log out R isn't well if you leave parameter doesn't go back to 0.

Add it to Try_GameLogOut_R
UPDATE Users_Master SET Leave = 0, LeaveDate = GETDATE() WHERE UserUID = @UserUID
Between IF Statment to
SET @Sql = N'