Jump to content
Aplicatiile pentru functia de "Helper" pentru serverul de Minecraft sunt deschise !

How to Fix MEMB_STAT Problem!


Guest Alex

Recommended Posts

Guest HackHunter

Cu alte cuvinte problema la website Online Users: 0

1. Sterge WZ_CONNECT_MEMB & WZ_DISCONNECT_MEMB din Stored Procedures.

2. Sterge MEMB_STAT Table

3. Creeaza WZ_CONNECT_MEMB cu SQL Query (Ruleaza asta in Baza de date: MuOnline)

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. Creaza WZ_DISCONNECT_MEMB cu SQL Query (Ruleaza asta in Baza de date: MuOnline)

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. Si in final creeam MEMB_STAT

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...