Join our community of MMORPG enthusiasts and private server developers! By registering, you'll gain access to in-depth discussions on source codes, binaries, and the latest developments in MMORPG server files. Collaborate with like-minded individuals, explore tutorials, and share insights on building and optimizing private servers. Join us today and unlock the full potential of MMORPG server development!
Join Today!What database you use? Maybe you don't have column for counting online hours.
The module dose work..You just have to make sure you have OnlineHours in your memb_stat and trigger set
ALTER TABLE dbo.MEMB_STAT ADD MinutesOnline int NOT NULL CONSTRAINT DF_MEMB_STAT_MinutesOnline DEFAULT 0
Use MuOnline
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[WZ_CONNECT_MEMB]
@uid varchar(10),
@server varchar(20),
@uip varchar(20)
AS
BEGIN
BEGIN TRANSACTION
SET NOCOUNT ON
IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED) WHERE memb___id = @uid )
BEGIN
UPDATE MEMB_STAT SET IP = @uip , ConnectStat = 1 , ServerName = @server , ConnectTM = (getdate()) WHERE memb___id = @uid
End
ELSE
BEGIN
INSERT INTO MEMB_STAT ( memb___id,IP,ConnectStat,ServerName,ConnectTM) valueS (@uid,@uip,1,@server,(getdate()))
End
IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION
SET NOCOUNT OFF
End
Use MuOnline
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
@uid varchar(20)
AS
Begin
BEGIN TRANSACTION
SET NOCOUNT ON
IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )
Begin
UPDATE MEMB_STAT SET DisConnectTM = (getdate()), ConnectStat = 0 , MinutesOnline = MinutesOnline+(DATEDIFF(mi,ConnectTM,getdate())) WHERE memb___id = @uid
UPDATE Character SET cLevel = 400 , MapNumber = 40, MapPosX = 225, MapPosY = 25, MapDir = 1, PkTime= 0 Where CtlCode = 32 And AccountID = @uid
End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,DisConnectTM,ConnectStat) valueS (@uid,(getdate()),0)
End
IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION
SET NOCOUNT OFF
End