Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Online hours not saving previous record!

Status
Not open for further replies.
Junior Spellweaver
Joined
Jun 24, 2012
Messages
135
Reaction score
16
Hi every one.
I really need help with WZ_DISCONNECT_MEMB.
The online exchange hours that i made it's not save previous record it's always reset to 0 when logout and login , even getting DC in game the online hours won't save any thing at all.

Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
@memb___id varchar(10)
 AS
Begin    
set nocount on
    Declare  @find_id varchar(10)    
    Declare @ConnectStat tinyint
	declare @OnlineHours int
    Set @ConnectStat = 0     
    Set @find_id = 'NOT'
    select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id 
           where I.memb___id = @memb___id
    if( @find_id <> 'NOT' )    
    begin        
        update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), OnlineHours = (DATEDIFF(mi,ConnectTM,getdate()))
         where memb___id = @memb___id
    end
end

Thanks
 
Initiate Mage
Joined
Jun 11, 2008
Messages
45
Reaction score
5
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
@memb___id varchar(10)
AS
Begin
set nocount on
Declare @find_id varchar(10)
Declare @ConnectStat tinyint
declare @OnlineHours int
Set @ConnectStat = 0
Set @find_id = 'NOT'
select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
where I.memb___id = @memb___id
if( @find_id <> 'NOT' )
begin
update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), OnlineHours = OnlineHours + (DATEDIFF(mi,ConnectTM,getdate()))
where memb___id = @memb___id
end
end

This should definetely work :D
 
Last edited:
Upvote 0
Status
Not open for further replies.
Back
Top