How to Fix MEMB_STAT Problem!

Newbie Spellweaver
Joined
May 19, 2008
Messages
11
Reaction score
9
Hello Mates!

i have been trying to find a solution how to fix MEMB_STAT problem, in other words (website problem, Online Users: 0)

well, i finally found a "guide" from my own files LOL XD

Prepare!! :winky:

1. Delete WZ_CONNECT_MEMB & WZ_DISCONNECT_MEMB from Stored Procedures.
2. Delete MEMB_STAT Table

3. Creating WZ_CONNECT_MEMB with SQL Query (Run this in MuOnline DB)

CREATE PROCEDURE WZ_CONNECT_MEMB

@uid varchar(20),
@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) valueS (
@uid,
@uip,
1,
@server
)
End


IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION

SET NOCOUNT OFF
End
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO


4. Delete Previous Lines, Creating WZ_DISCONNECT_MEMB with SQL Query (Run this in MuOnline DB)

CREATE PROCEDURE 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 WHERE memb___id = @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
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO



5. Finally Creating MEMB_STAT, Delete Previous Lines and Run this in MuOnline DB.

CREATE TABLE [dbo].[MEMB_STAT] (
[memb___id] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[ConnectStat] [tinyint] NULL ,
[ServerName] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[IP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
[ConnectTM] [smalldatetime] NULL ,
[DisConnectTM] [smalldatetime] NULL
) ON [PRIMARY]
GO



Greetings, United
 
Re: [Guide] How to Fix MEMB_STAT Problem!

This really worked... Thanks United.
You're the man.

Finaly someone that could find the solution to this problem.

Thank You !
 
Re: [Guide] How to Fix MEMB_STAT Problem!

thx thx, atleast i did something which actually helps ppl xD
 
Re: [Guide] How to Fix MEMB_STAT Problem!

wtf u mean version? this is DB FIX

Well some use WZ_ and some dont this this release really should have a version announcement in the instruction, or make another version of the script for those who dont use DB's with WZ_ or just edit his tables/functions with your own ^_^
 
Re: [Guide] How to Fix MEMB_STAT Problem!

thanks , tested in 1.03N
 
Hello Mates!

i have been trying to find a solution how to fix MEMB_STAT problem, in other words (website problem, Online Users: 0)

well, i finally found a "guide" from my own files LOL XD

Prepare!! :winky:

1. Delete WZ_CONNECT_MEMB & WZ_DISCONNECT_MEMB from Stored Procedures.
2. Delete MEMB_STAT Table

3. Creating WZ_CONNECT_MEMB with SQL Query (Run this in MuOnline DB)

CREATE PROCEDURE WZ_CONNECT_MEMB

@uid varchar(20),
@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) valueS (
@uid,
@uip,
1,
@server
)
End


IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION

SET NOCOUNT OFF
End
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO


4. Delete Previous Lines, Creating WZ_DISCONNECT_MEMB with SQL Query (Run this in MuOnline DB)

CREATE PROCEDURE 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 WHERE memb___id = @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
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO



5. Finally Creating MEMB_STAT, Delete Previous Lines and Run this in MuOnline DB.

CREATE TABLE [dbo].[MEMB_STAT] (
[memb___id] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[ConnectStat] [tinyint] NULL ,
[ServerName] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[IP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
[ConnectTM] [smalldatetime] NULL ,
[DisConnectTM] [smalldatetime] NULL
) ON [PRIMARY]
GO



Greetings, United

Thank you so much bro, You solved my problem, more power to you
 
Back