|
You last visited: Today at 15:14
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.
08/25/2013, 16:48
|
#16
|
elite*gold: 0
Join Date: Aug 2012
Posts: 454
Received Thanks: 111
|
Quote:
Originally Posted by accuface35
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
|
----------FIX-------
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
???? ?? ??
*/
@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=@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
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
This is the right one ... there was a problem writing
|
|
|
08/25/2013, 17:15
|
#17
|
elite*gold: 0
Join Date: Feb 2011
Posts: 295
Received Thanks: 19
|
with this script have i my add per minute to remove
|
|
|
09/06/2013, 23:40
|
#18
|
elite*gold: 246
Join Date: Dec 2010
Posts: 33,474
Received Thanks: 6,059
|
#Edit first post
|
|
|
09/28/2013, 20:56
|
#19
|
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
|
hi all! I have my server ON, all logs are right, and no error. I have add ap for minute whit all this query, but it give 1AP for every Login, and not every minute! Can any one help me about? or say me what can be wrong?
|
|
|
01/26/2014, 14:56
|
#20
|
elite*gold: 0
Join Date: Jan 2012
Posts: 41
Received Thanks: 12
|
Quote:
USE [PS_UserData]
GO
/****** Object: StoredProcedure [dbo].[usp_Try_GameLogout_R] Script Date: 01/26/2014 16:14:16 ******/
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+@LastPlayTime/2
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
|
This is right .... ! all the rest adds 1 or 2 point per login.. not per min....
|
|
|
06/13/2014, 16:24
|
#21
|
elite*gold: 0
Join Date: Apr 2011
Posts: 114
Received Thanks: 72
|
Where i can change amount of time in these scripts?
|
|
|
11/03/2014, 16:25
|
#22
|
elite*gold: 0
Join Date: Feb 2012
Posts: 2
Received Thanks: 0
|
Thakns
|
|
|
All times are GMT +1. The time now is 15:14.
|
|