[Release] Script auto gain AP

05/17/2012 03:45 venon321#1
Script reworked by me
had some bugs and errors but I ageitei.
What you want to leave anything in doubt.

================================================== =======

USE [PS_UserData]
GO
/****** Object: StoredProcedure [dbo].[usp_Try_GameLogout_R] Script Date: 01/31/2012 18:21:57 ******/
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=@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=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


================================================== =====

PS: It is scheduled to earn a point for every minute ap logged.
If you want to change the gain of AP just changes "point = 1 for the number that you want.
05/17/2012 04:08 George St-Pierre#2
Very good job, I'll check and see if it works.
Thank you for sharing this with the community epvp *
05/17/2012 04:25 venon321#3
Happy to help the community elite pvp :)
05/17/2012 17:07 treica#4
I love to but not to post as release something that has been posted here
[Only registered and activated users can see links. Click Here To Register...]

Is the same just copy paste from this topic ;) and changed there point=1 here but the same spaces as this topic :P
Quote:
set loginstatus=0,LogoutTime=@LogTime,LogoutSession=@S essionID,LastPlayTime=datediff(minute,LoginTime,@L ogTime)
I wrong? :D

Give credits to real poster of this ;)
05/18/2012 06:30 venon321#5
Wrong.
I got the script every bug and fix the flaws.
11/07/2018 01:11 jestoni143#6
how can i gain ap sir >
11/07/2018 03:39 Blober#7
Quote:
Originally Posted by treica View Post
I love to but not to post as release something that has been posted here
[Only registered and activated users can see links. Click Here To Register...]

Is the same just copy paste from this topic ;) and changed there point=1 here but the same spaces as this topic :P

I wrong? :D

Give credits to real poster of this ;)
Please read before bumping an old old thread (6years old).

Thanks.