Register for your free account! | Forgot your password?

You last visited: Today at 01:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



How to add 1 AP Per Min

Discussion on How to add 1 AP Per Min within the Shaiya PServer Guides & Releases forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
.Shaco.'s Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 171
Received Thanks: 295
[Release] How to add 1 AP Per Min

Code:
USE [PS_UserData]
GO

/****** Object:  Table [dbo].[UserLoginStatus]    Script Date: 07/14/2012 11:09:27 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[UserLoginStatus](
	[UserUid] [int] NOT NULL,
	[Userid] [char](18) NOT NULL,
	[LoginStatus] [tinyint] NOT NULL,
	[LoginTime] [datetime] NULL,
	[LogoutTime] [datetime] NULL,
	[LoginSession] [bigint] NULL,
	[LogoutSession] [bigint] NULL,
	[LastPlayTime] [int] NULL,
	[LastIP] [varchar](15) NULL,
 CONSTRAINT [PK_UserLoginStatus] PRIMARY KEY CLUSTERED 
(
	[UserUid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


Code:
USE [PS_UserData]
GO

/****** Object:  Table [dbo].[UserOnlineTimeLog]    Script Date: 07/14/2012 11:12:11 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[UserOnlineTimeLog](
	[UserUID] [int] NOT NULL,
	[OldPoint] [int] NOT NULL,
	[Addpoint] [int] NOT NULL,
	[LoginTime] [datetime] NOT NULL,
	[LogoutTime] [datetime] NOT NULL,
	[SessionID] [bigint] NOT NULL,
	[UserIP] [varchar](15) NOT NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


Code:
USE [PS_UserData]
GO
/****** Object:  StoredProcedure [dbo].[usp_Try_GameLogout_R]    Script Date: 05/11/2013 11:25:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/****** Object: Stored Procedure dbo.usp_Try_GameLogout_R Script Date: 2008-6-7 18:34:05 ******/
ALTER Proc [dbo].[usp_Try_GameLogout_R]

/* 
Created by humanws, 2005-10-18
???? ?? ??
*/

 [MENTION=2805776]UserU[/MENTION]ID int,
@SessionID bigint,
@LogoutType smallint = 0,
@ErrType int = 0

AS

SET NOCOUNT ON

DECLARE @LogTime datetime
DECLARE @Sql nvarchar(4000)
DECLARE [MENTION=319663]yyyy[/MENTION] varchar(4)
DECLARE @mm varchar(2)
DECLARE @dd varchar(2)
DECLARE @LogType bit	-- Login:0, Logout:1

SET @LogType = 1
SET @LogTime = GETDATE()
SET [MENTION=319663]yyyy[/MENTION] = DATEPART(yyyy, @LogTime)
SET @mm = DATEPART(mm, @LogTime)
SET @dd = DATEPART(dd, @LogTime)

IF( LEN(@mm) = 1 )
BEGIN
SET @mm = '0' + @mm
END

IF( LEN(@dd) = 1 )
BEGIN
SET @dd = '0' + @dd
END
UPDATE Users_Master SET Leave = 0, LeaveDate = GETDATE() WHERE UserUID = [MENTION=2805776]UserU[/MENTION]ID

SET @Sql = N'
INSERT INTO PS_GameLog.dbo.UserLog
(SessionID, UserUID, LogType, LogTime, LogoutType, ErrType)
VALUES(@SessionID, [MENTION=2805776]UserU[/MENTION]ID, @LogType, @LogTime, @LogoutType, @ErrType)'

EXEC sp_executesql @Sql, 
N'@SessionID bigint, [MENTION=2805776]UserU[/MENTION]ID int, @LogType bit, @LogTime datetime, @LogoutType smallint, @ErrType int',
@SessionID, [MENTION=2805776]UserU[/MENTION]ID, @LogType, @LogTime, @LogoutType, @ErrType
update PS_userdata.dbo.UserLoginStatus
set loginstatus=0,LogoutTime=@LogTime,LogoutSession=@SessionID,LastPlayTime=datediff(minute,LoginTime,@LogTime)
where useruid [MENTION=2805776]UserU[/MENTION]id

DECLARE @LoginTime datetime
DECLARE @LastPlayTime int
DECLARE @OldPoint int
DECLARE @LoginSession bigint
SET @LoginSession=(select LoginSession from PS_userdata.dbo.UserLoginStatus where useruid [MENTION=2805776]UserU[/MENTION]id)
SET @LastPlayTime=(select LastPlayTime from PS_userdata.dbo.UserLoginStatus where useruid [MENTION=2805776]UserU[/MENTION]id)
SET @LoginTime=(select LoginTime from PS_userdata.dbo.UserLoginStatus where useruid [MENTION=2805776]UserU[/MENTION]id)
SET @OldPoint=(select Point from PS_userdata.dbo.Users_Master where useruid [MENTION=2805776]UserU[/MENTION]id)
IF (@SessionID=@LoginSession)
BEGIN
Update PS_userdata.dbo.Users_Master
SET point=point +1
WHERE useruid [MENTION=2805776]UserU[/MENTION]id
INSERT INTO PS_userdata.dbo.UserOnlineTimeLog(UserUid,OldPoint ,Addpoint,LoginTime,LogoutTime,SessionID)
values [MENTION=2805776]UserU[/MENTION]id,@OldPoint,@LastPlayTime,@LoginTime ,@LogTime,@SessionID)
end
SET NOCOUNT OFF


Code:
USE [PS_UserData]
GO
/****** Object:  StoredProcedure [dbo].[usp_Try_GameLogin_Taiwan]    Script Date: 05/11/2013 11:26:09 ******/
SET ANSI_NULLS ON
GO
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]

 [MENTION=831308]userid[/MENTION] 	varchar(18),
@InPassword	varchar(32),

@SessionID 	bigint,
 [MENTION=5805117]userip[/MENTION] 	varchar(15),

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

 [MENTION=2805776]UserU[/MENTION]ID 	int = 0,
@LoginType 	smallint = 1, 
@LoginTime 	datetime = NULL

AS

SET NOCOUNT ON

DECLARE 

@Leave 		tinyint,
@Status 		smallint,

@CompanyIP 	varchar(15),
 [MENTION=986605]tempi[/MENTION]P 	varchar(15),
@Check		int

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

--------------------------------------------------
SET @CompanyIP = 	'61.107.81'
SET [MENTION=5805117]userip[/MENTION] =		LTRIM( RTRIM [MENTION=5805117]userip[/MENTION]) )
--------------------------------------------------
SET @Check = 0
--------------------------------------------------

SELECT [MENTION=2805776]UserU[/MENTION]ID=UserUID, @Status=Status, @Leave=Leave FROM Users_Master WHERE UserID = [MENTION=831308]userid[/MENTION]

-- NotExist User OR Leave User
IF( [MENTION=2805776]UserU[/MENTION]ID = 0 OR @Leave = 1 )
BEGIN
	SET @Status = -3
END
ELSE
BEGIN
	-- Check Password
	EXEC dbo.sp_LoginSuccessCheck [MENTION=831308]userid[/MENTION], @InPassword, @Check output
	IF ( @@ERROR = 0 )
	BEGIN
		IF( @Check <> 1 )
		BEGIN
			SET @Status = -1
		END
	END
	ELSE
	BEGIN
		SET @Status = -1
	END

	/* Old
	SET @InEnPassword = master.dbo.fn_md5(@InPassword)
	IF ( @InEnPassword <> @EnPassword )
	BEGIN
		SET @Status = -1
	END
	*/
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 = [MENTION=2805776]UserU[/MENTION]ID
	IF ( @@ROWCOUNT <> 0 )
	BEGIN
		-- Block Release
		IF ( @BlockEndDate <= @LoginTime )
		BEGIN
			SET @Status = 0
			UPDATE Users_Master SET Status = @Status WHERE UserUID = [MENTION=2805776]UserU[/MENTION]ID
		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 [MENTION=986605]tempi[/MENTION]P = LEFT [MENTION=5805117]userip[/MENTION], 9)
	IF( [MENTION=986605]tempi[/MENTION]P <> @CompanyIP )
	BEGIN
		SET @Status = -999
	END
END
*/

-- Select 
SELECT @Status AS Status, [MENTION=2805776]UserU[/MENTION]ID AS UserUID

-- Log Insert
IF( @Status = 0 OR @Status = 16 OR @Status = 32 OR @Status = 48 OR @Status = 64 OR @Status = 80 )
BEGIN
	EXEC usp_Insert_LoginLog_E @SessionID=@SessionID, [MENTION=2805776]UserU[/MENTION]ID [MENTION=2805776]UserU[/MENTION]ID, [MENTION=5805117]userip[/MENTION] [MENTION=5805117]userip[/MENTION], @LogType=0, @LogTime=@LoginTime, @LoginType=@LoginType
IF [MENTION=2805776]UserU[/MENTION]id=(select useruid from PS_UserData.dbo.UserLoginStatus
	where useruid [MENTION=2805776]UserU[/MENTION]id)
		update PS_userdata.dbo.UserLoginStatus
			set loginstatus=1,LoginTime=@LoginTime,LogoutTime=@LoginTime,loginSession=@SessionID,lastplaytime=0
				where useruid [MENTION=2805776]UserU[/MENTION]id
		else
insert into PS_userdata.dbo.UserLoginStatus(useruid,userid,loginstatus,logintime,logouttime,loginsession,lastplaytime,LastIP) values [MENTION=2805776]UserU[/MENTION]id [MENTION=831308]userid[/MENTION],1,@LoginTime,@LoginTime,@SessionID,0 [MENTION=5805117]userip[/MENTION])
END
SET NOCOUNT OFF
How to remove:

Code:
USE [PS_UserData]
GO
/****** Object: StoredProcedure [dbo].[usp_Try_GameLogout_R] Script Date: 08/12/2011 23:16:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/****** Object: Stored Procedure dbo.usp_Try_GameLogout_R Script Date: 2008-6-7 18:34:05 ******/
ALTER Proc [dbo].[usp_Try_GameLogout_R]

/*
Created by humanws, 2005-10-18
???? ?? ??
*/

 [MENTION=2805776]UserU[/MENTION]ID int,
@SessionID bigint,
@LogoutType smallint = 0,
@ErrType int = 0

AS

SET NOCOUNT ON

DECLARE @LogTime datetime
DECLARE @Sql nvarchar(4000)
DECLARE [MENTION=319663]yyyy[/MENTION] varchar(4)
DECLARE @mm varchar(2)
DECLARE @dd varchar(2)
DECLARE @LogType bit -- Login:0, Logout:1

SET @LogType = 1
SET @LogTime = GETDATE()
SET [MENTION=319663]yyyy[/MENTION] = DATEPART(yyyy, @LogTime)
SET @mm = DATEPART(mm, @LogTime)
SET @dd = DATEPART(dd, @LogTime)

IF( LEN(@mm) = 1 )
BEGIN
SET @mm = '0' + @mm
END

IF( LEN(@dd) = 1 )
BEGIN
SET @dd = '0' + @dd
END

SET @Sql = N'
INSERT INTO PS_GameLog.dbo.UserLog
(SessionID, UserUID, LogType, LogTime, LogoutType, ErrType)
VALUES(@SessionID, [MENTION=2805776]UserU[/MENTION]ID, @LogType, @LogTime, @LogoutType, @ErrType)'

EXEC sp_executesql @Sql,
N'@SessionID bigint, [MENTION=2805776]UserU[/MENTION]ID int, @LogType bit, @LogTime datetime, @LogoutType smallint, @ErrType int',
@SessionID, [MENTION=2805776]UserU[/MENTION]ID, @LogType, @LogTime, @LogoutType, @ErrType
update PS_userdata.dbo.UserLoginStatus
set loginstatus=0,LogoutTime=@LogTime,LogoutSession=@SessionID,LastPlayTime=datediff(minute,LoginTime,@LogTime)
where useruid [MENTION=2805776]UserU[/MENTION]id

DECLARE @LoginTime datetime
DECLARE @LastPlayTime int
DECLARE @OldPoint int
DECLARE @LoginSession bigint
SET @LoginSession=(select LoginSession from PS_userdata.dbo.UserLoginStatus where useruid [MENTION=2805776]UserU[/MENTION]id)
SET @LastPlayTime=(select LastPlayTime from PS_userdata.dbo.UserLoginStatus where useruid [MENTION=2805776]UserU[/MENTION]id)
SET @LoginTime=(select LoginTime from PS_userdata.dbo.UserLoginStatus where useruid [MENTION=2805776]UserU[/MENTION]id)
SET @OldPoint=(select Point from PS_userdata.dbo.Users_Master where useruid [MENTION=2805776]UserU[/MENTION]id)
IF (@SessionID=@LoginSession)
BEGIN
Update PS_userdata.dbo.Users_Master
SET point=point
WHERE useruid [MENTION=2805776]UserU[/MENTION]id
INSERT INTO PS_userdata.dbo.UserOnlineTimeLog(UserUid,OldPoint ,Addpoint,LoginTime,LogoutTime,SessionID)
values [MENTION=2805776]UserU[/MENTION]id,@OldPoint,@LastPlayTime,@LoginTime ,@LogTime,@SessionID)
end
SET NOCOUNT OFF
.Shaco. is offline  
Thanks
31 Users
Old 07/15/2012, 03:09   #2
 
JohnHeatz's Avatar
 
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,977
#Added to the Index
JohnHeatz is offline  
Thanks
3 Users
Old 07/16/2012, 16:54   #3
 
elite*gold: 0
Join Date: Dec 2009
Posts: 59
Received Thanks: 9
This for EP3 correct?
Tradehappy is offline  
Old 07/16/2012, 17:36   #4
 
.Shaco.'s Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 171
Received Thanks: 295
Quote:
Originally Posted by Tradehappy View Post
This for EP3 correct?
Doesn't matter, it work on all eps. There is NO limited Eps.
.Shaco. is offline  
Thanks
3 Users
Old 08/09/2012, 13:38   #5
 
elite*gold: 0
Join Date: Aug 2012
Posts: 6
Received Thanks: 6
IS it possible to edit so it has a larger time space set up like every 5 minutes?
barnsotar is offline  
Old 08/13/2012, 07:06   #6
 
BlakenTheAngel's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 42
Received Thanks: 37
Question how do i modify: Time of giving, amount of given?
BlakenTheAngel is offline  
Old 08/13/2012, 07:27   #7
 
JohnHeatz's Avatar
 
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,977
That should be by modifying this part:

Code:
BEGIN
	Update PS_userdata.dbo.Users_Master
	SET point=point+@LastPlayTime/2
	WHERE useruid=@useruid
	INSERT INTO PS_userdata.dbo.UserOnlineTimeLog(UserUid,OldPoint,Addpoint,LoginTime,LogoutTime,SessionID,UserIP)
	values(@UserUid,@OldPoint,@LastPlayTime,@LoginTime,@LogTime,@SessionID,@UserIP)
END
JohnHeatz is offline  
Thanks
4 Users
Old 08/13/2012, 18:38   #8
 
elite*gold: 0
Join Date: Oct 2008
Posts: 37
Received Thanks: 3
and the query so that AP remains on 0.
or climb a minute.?
alekiu is offline  
Old 08/26/2012, 17:00   #9
 
elite*gold: 0
Join Date: Aug 2012
Posts: 12
Received Thanks: 9
Hello Guys ;

I get This Error ;

Msg 137, Level 15, State 2, Line 3
Must declare the scalar variable "@LogTime".
Msg 137, Level 15, State 2, Line 12
Must declare the scalar variable "@useruid".
Msg 137, Level 15, State 2, Line 13
Must declare the scalar variable "@useruid".
Msg 137, Level 15, State 2, Line 14
Must declare the scalar variable "@useruid".
Msg 137, Level 15, State 2, Line 15
Must declare the scalar variable "@useruid".
Msg 137, Level 15, State 2, Line 16
Must declare the scalar variable "@UserUID".
Msg 137, Level 15, State 2, Line 17
Must declare the scalar variable "@SessionID".
Msg 137, Level 15, State 2, Line 21
Must declare the scalar variable "@useruid".
Msg 137, Level 15, State 2, Line 23
Must declare the scalar variable "@UserUid".

Thanks For Help!..
IsTaNBLuE* is offline  
Old 01/21/2013, 03:44   #10
 
elite*gold: 0
Join Date: Jan 2013
Posts: 15
Received Thanks: 19
which code for

VB.net
C++
C#
codecatcher22 is offline  
Old 01/21/2013, 16:48   #11
 
JohnHeatz's Avatar
 
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,977
Quote:
Originally Posted by codecatcher22 View Post
which code for

VB.net
C++
C#
This makes no sense at all, did you even read the thread? This is all done directly in the database...
JohnHeatz is offline  
Thanks
3 Users
Old 05/11/2013, 10:32   #12
 
[GM]SkyLine.™'s Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 147
Received Thanks: 174
Complete Scripts;

Code:
USE [PS_UserData]
GO

/****** Object:  Table [dbo].[UserLoginStatus]    Script Date: 07/14/2012 11:09:27 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[UserLoginStatus](
	[UserUid] [int] NOT NULL,
	[Userid] [char](18) NOT NULL,
	[LoginStatus] [tinyint] NOT NULL,
	[LoginTime] [datetime] NULL,
	[LogoutTime] [datetime] NULL,
	[LoginSession] [bigint] NULL,
	[LogoutSession] [bigint] NULL,
	[LastPlayTime] [int] NULL,
	[LastIP] [varchar](15) NULL,
 CONSTRAINT [PK_UserLoginStatus] PRIMARY KEY CLUSTERED 
(
	[UserUid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


Code:
USE [PS_UserData]
GO

/****** Object:  Table [dbo].[UserOnlineTimeLog]    Script Date: 07/14/2012 11:12:11 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[UserOnlineTimeLog](
	[UserUID] [int] NOT NULL,
	[OldPoint] [int] NOT NULL,
	[Addpoint] [int] NOT NULL,
	[LoginTime] [datetime] NOT NULL,
	[LogoutTime] [datetime] NOT NULL,
	[SessionID] [bigint] NOT NULL,
	[UserIP] [varchar](15) NOT NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


Code:
USE [PS_UserData]
GO
/****** Object:  StoredProcedure [dbo].[usp_Try_GameLogout_R]    Script Date: 05/11/2013 11:25:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/****** Object: Stored Procedure dbo.usp_Try_GameLogout_R Script Date: 2008-6-7 18:34:05 ******/
ALTER Proc [dbo].[usp_Try_GameLogout_R]

/* 
Created by humanws, 2005-10-18
???? ?? ??
*/

@UserUID int,
@SessionID bigint,
@LogoutType smallint = 0,
@ErrType int = 0

AS

SET NOCOUNT ON

DECLARE @LogTime datetime
DECLARE @Sql nvarchar(4000)
DECLARE @yyyy varchar(4)
DECLARE @mm varchar(2)
DECLARE @dd varchar(2)
DECLARE @LogType bit	-- Login:0, Logout:1

SET @LogType = 1
SET @LogTime = GETDATE()
SET @yyyy = DATEPART(yyyy, @LogTime)
SET @mm = DATEPART(mm, @LogTime)
SET @dd = DATEPART(dd, @LogTime)

IF( LEN(@mm) = 1 )
BEGIN
SET @mm = '0' + @mm
END

IF( LEN(@dd) = 1 )
BEGIN
SET @dd = '0' + @dd
END
UPDATE Users_Master SET Leave = 0, LeaveDate = GETDATE() WHERE UserUID = @UserUID

SET @Sql = N'
INSERT INTO PS_GameLog.dbo.UserLog
(SessionID, UserUID, LogType, LogTime, LogoutType, ErrType)
VALUES(@SessionID, @UserUID, @LogType, @LogTime, @LogoutType, @ErrType)'

EXEC sp_executesql @Sql, 
N'@SessionID bigint, @UserUID int, @LogType bit, @LogTime datetime, @LogoutType smallint, @ErrType int',
@SessionID, @UserUID, @LogType, @LogTime, @LogoutType, @ErrType
update PS_userdata.dbo.UserLoginStatus
set loginstatus=0,LogoutTime=@LogTime,LogoutSession=@SessionID,LastPlayTime=datediff(minute,LoginTime,@LogTime)
where useruid=@useruid

DECLARE @LoginTime datetime
DECLARE @LastPlayTime int
DECLARE @OldPoint int
DECLARE @LoginSession bigint
SET @LoginSession=(select LoginSession from PS_userdata.dbo.UserLoginStatus where useruid=@useruid)
SET @LastPlayTime=(select LastPlayTime from PS_userdata.dbo.UserLoginStatus where useruid=@useruid)
SET @LoginTime=(select LoginTime from PS_userdata.dbo.UserLoginStatus where useruid=@useruid)
SET @OldPoint=(select Point from PS_userdata.dbo.Users_Master where useruid=@useruid)
IF (@SessionID=@LoginSession)
BEGIN
Update PS_userdata.dbo.Users_Master
SET point=point +1
WHERE useruid=@useruid
INSERT INTO PS_userdata.dbo.UserOnlineTimeLog(UserUid,OldPoint ,Addpoint,LoginTime,LogoutTime,SessionID)
values(@UserUid,@OldPoint,@LastPlayTime,@LoginTime ,@LogTime,@SessionID)
end
SET NOCOUNT OFF


Code:
USE [PS_UserData]
GO
/****** Object:  StoredProcedure [dbo].[usp_Try_GameLogin_Taiwan]    Script Date: 05/11/2013 11:26:09 ******/
SET ANSI_NULLS ON
GO
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 = 0,
@LoginType 	smallint = 1, 
@LoginTime 	datetime = NULL

AS

SET NOCOUNT ON

DECLARE 

@Leave 		tinyint,
@Status 		smallint,

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

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 FROM Users_Master WHERE UserID = @UserID

-- NotExist User OR Leave User
IF( @UserUID = 0 OR @Leave = 1 )
BEGIN
	SET @Status = -3
END
ELSE
BEGIN
	-- Check Password
	EXEC dbo.sp_LoginSuccessCheck @UserID, @InPassword, @Check output
	IF ( @@ERROR = 0 )
	BEGIN
		IF( @Check <> 1 )
		BEGIN
			SET @Status = -1
		END
	END
	ELSE
	BEGIN
		SET @Status = -1
	END

	/* Old
	SET @InEnPassword = master.dbo.fn_md5(@InPassword)
	IF ( @InEnPassword <> @EnPassword )
	BEGIN
		SET @Status = -1
	END
	*/
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
	EXEC usp_Insert_LoginLog_E @SessionID=@SessionID, @UserUID=@UserUID, @UserIP=@UserIP, @LogType=0, @LogTime=@LoginTime, @LoginType=@LoginType
IF @useruid=(select useruid from PS_UserData.dbo.UserLoginStatus
	where useruid=@useruid)
		update PS_userdata.dbo.UserLoginStatus
			set loginstatus=1,LoginTime=@LoginTime,LogoutTime=@LoginTime,loginSession=@SessionID,lastplaytime=0
				where useruid=@useruid
		else
insert into PS_userdata.dbo.UserLoginStatus(useruid,userid,loginstatus,logintime,logouttime,loginsession,lastplaytime,LastIP) values(@useruid,@userid,1,@LoginTime,@LoginTime,@SessionID,0,@UserIP)
END
SET NOCOUNT OFF
Later execute this query's [Its important]

Code:
USE PS_GameData
GO

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.Chars ADD
	LoginStatus tinyint NOT NULL CONSTRAINT DF_Chars_LoginStatus DEFAULT 0
GO
COMMIT
Code:
USE PS_GameData
GO

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO


ALTER Proc [dbo].[usp_Read_Chars_Detail2_R] 

@CharID int

AS

SET NOCOUNT ON

DECLARE @UserUID int
DECLARE @Money bigint
DECLARE @GuildID int
DECLARE @GuildLevel tinyint
DECLARE @UID varchar (18)

-- 2005-12-30 스탯,스킬 이벤트관련...
DECLARE @Event1 tinyint
DECLARE @Event2 tinyint
--

SET @Money = 0
SET @UserUID = (SELECT UserUID FROM Chars WHERE CharID = @CharID)
SET @GuildID = (SELECT GuildID FROM GuildChars WHERE CharID = @CharID AND Del = 0)

IF(@UserUID IS NOT NULL)
BEGIN
	SET @Money = (SELECT ISNULL([Money], 0) FROM UserStoredMoney WHERE UserUID = @UserUID)
END
ELSE
BEGIN
	SET @Money = 0
END

IF(@GuildID IS NOT NULL)
BEGIN
	SET @GuildLevel = (SELECT GuildLevel FROM GuildChars WHERE CharID = @CharID AND Del = 0)
END
ELSE
BEGIN
	SET @GuildID = 0
	SET @GuildLevel = 0
END

-- 2005-12-30 스탯,스킬 이벤트관련...
SELECT @Event1=Event1, @Event2=Event2 FROM CharEvents WHERE CharID=@CharID
--

SELECT UserUID, CharID, CharName, Slot, Family, Grow, Hair, Face, [Size], Job, Sex, [Level], 
StatPoint AS DistPoint, SkillPoint, [Str], Dex, Rec, [Int], Luc, Wis, HP, MP, SP, Map, Dir, [Exp], [Money], 
PosX, PosY, PosZ, Hg, Vg, Cg, Og, Ig, Del, K1, K2, K3, K4, @Money AS StoredMoney, @GuildID AS GuildID, @GuildLevel AS GuildLevel,

-- 전투공로관 보상레벨
KillLevel, DeadLevel,
--

-- 스탯,스킬 이벤트관련...
@Event1, @Event2,
--

DATEPART(yyyy, LeaveDate) AS LeaveDate_YYYY, 
DATEPART(mm, LeaveDate) AS LeaveDate_MM, 
DATEPART(dd, LeaveDate) AS LeaveDate_DD, 
DATEPART(hh, LeaveDate) AS LeaveDate_HH, 
DATEPART(mi, LeaveDate) AS LeaveDate_MI, 
DATEPART(ss, LeaveDate) AS LeaveDate_SS

--

FROM Chars WHERE CharID = @CharID

-- 접속시간 기록
UPDATE Chars SET JoinDate=GETDATE(), LoginStatus = 1 WHERE CharID=@CharID
SELECT @UID=UserID FROM CHARS WHERE CharID=@CharID
UPDATE Chars SET LoginStatus = 0 WHERE (CharID<>@CharID) AND (UserID=@UID)
--

SET NOCOUNT OFF
SET QUOTED_IDENTIFIER OFF 
SET ANSI_NULLS OFF
Code:
USE PS_GameData
GO

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO


ALTER Proc [dbo].[usp_Save_Char_LeaveDate_R] 

@CharID int

AS

SET NOCOUNT ON

-- 종료시간 기록
UPDATE Chars SET LeaveDate=GETDATE(), LoginStatus=0 WHERE CharID=@CharID

SET NOCOUNT OFF

SET QUOTED_IDENTIFIER OFF 

SET ANSI_NULLS OFF
[GM]SkyLine.™ is offline  
Thanks
2 Users
Old 06/29/2013, 14:51   #13
 
elite*gold: 0
Join Date: May 2012
Posts: 34
Received Thanks: 11
Where do I put the time and the amount of AP per minute? someone please indicate and Tank to the aport
jvczxc is offline  
Thanks
1 User
Old 08/25/2013, 16:20   #14
 
AxelMac's Avatar
 
elite*gold: 0
Join Date: Aug 2012
Posts: 454
Received Thanks: 111
Hey guys i need remove 1ap for minutes....HOW??
AxelMac is offline  
Old 08/25/2013, 16:42   #15
 
elite*gold: 0
Join Date: Feb 2011
Posts: 295
Received Thanks: 18
execute this:
USE [PS_UserData]
GO
/****** Object: StoredProcedure [dbo].[usp_Try_GameLogout_R] Script Date: 08/12/2011 23:16:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/****** Object: Stored Procedure dbo.usp_Try_GameLogout_R Script Date: 2008-6-7 18:34:05 ******/
ALTER Proc [dbo].[usp_Try_GameLogout_R]

/*
Created by humanws, 2005-10-18
???? ?? ??
*/

@UserUID int,
@SessionID bigint,
@LogoutType smallint = 0,
@ErrType int = 0

AS

SET NOCOUNT ON

DECLARE @LogTime datetime
DECLARE @Sql nvarchar(4000)
DECLARE @yyyy varchar(4)
DECLARE @mm varchar(2)
DECLARE @dd varchar(2)
DECLARE @LogType bit -- Login:0, Logout:1

SET @LogType = 1
SET @LogTime = GETDATE()
SET @yyyy = DATEPART(yyyy, @LogTime)
SET @mm = DATEPART(mm, @LogTime)
SET @dd = DATEPART(dd, @LogTime)

IF( LEN(@mm) = 1 )
BEGIN
SET @mm = '0' + @mm
END

IF( LEN(@dd) = 1 )
BEGIN
SET @dd = '0' + @dd
END

SET @Sql = N'
INSERT INTO PS_GameLog.dbo.UserLog
(SessionID, UserUID, LogType, LogTime, LogoutType, ErrType)
VALUES(@SessionID, @UserUID, @LogType, @LogTime, @LogoutType, @ErrType)'

EXEC sp_executesql @Sql,
N'@SessionID bigint, @UserUID int, @LogType bit, @LogTime datetime, @LogoutType smallint, @ErrType int',
@SessionID, @UserUID, @LogType, @LogTime, @LogoutType, @ErrType
update PS_userdata.dbo.UserLoginStatus
set loginstatus=0,LogoutTime=@LogTime,LogoutSession=@S essionID,LastPlayTime=datediff(minute,LoginTime,@L ogTime)
where useruid=@useruid

DECLARE @LoginTime datetime
DECLARE @LastPlayTime int
DECLARE @OldPoint int
DECLARE @LoginSession bigint
SET @LoginSession=(select LoginSession from PS_userdata.dbo.UserLoginStatus where useruid=@useruid)
SET @LastPlayTime=(select LastPlayTime from PS_userdata.dbo.UserLoginStatus where useruid=@useruid)
SET @LoginTime=(select LoginTime from PS_userdata.dbo.UserLoginStatus where useruid=@useruid)
SET @OldPoint=(select Point from PS_userdata.dbo.Users_Master where useruid=@useruid)
IF (@SessionID=@LoginSession)
BEGIN
Update PS_userdata.dbo.Users_Master
SET point=point
WHERE useruid=@useruid
INSERT INTO PS_userdata.dbo.UserOnlineTimeLog(UserUid,OldPoint ,Addpoint,LoginTime,LogoutTime,SessionID)
values(@UserUid,@OldPoint,@LastPlayTime,@LoginTime ,@LogTime,@SessionID)
end
SET NOCOUNT OFF
accuface35 is offline  
Reply




All times are GMT +2. The time now is 01:46.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.