Hi I have the following point system that automatically committed automated AP system, the same figure is a one-to-
23 hours in the game not to be alone, even committed despite my tsar 1 point
I wonder if I have the following code, I did a mistake or there is missing something you have processed the following code to MySQL mysql my system 2008R2
I want our servers to enable automatic point system
So long as the game points to win clients and
itemmal item scores will buy it.
I found I just committed this code did not work, please help me thank you in advance
Sorry for my english is bad
23 hours in the game not to be alone, even committed despite my tsar 1 point
I wonder if I have the following code, I did a mistake or there is missing something you have processed the following code to MySQL mysql my system 2008R2
I want our servers to enable automatic point system
So long as the game points to win clients and
itemmal item scores will buy it.
I found I just committed this code did not work, please help me thank you in advance
Sorry for my english is bad
Quote:
USE [PS_UserData]
GO
/****** Object: StoredProcedure [dbo].[usp_Try_GameLogout_R] Script Date: 02/17/2013 14:50:51 ******/
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