AcasaPortalFAQCautareMembriGrupuriInregistrareConectare

Distribuiţi | 
 

 How to Fix MEMB_STAT Problem

In jos 
AutorMesaj
IDeaL.
•Administrator
•Administrator
avatar

Mesaje : 2693
Puncte : 19323
Data de inscriere : 28/02/2010
Varsta : 24

MesajSubiect: How to Fix MEMB_STAT Problem   Iunie 10th 2011, 5:42 pm

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)

Cod:
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)
Cod:
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
Cod:
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

Credite: United


Sus In jos
Vezi profilul utilizatorului http://www.hk-team.forumz.ro
 
How to Fix MEMB_STAT Problem
Sus 
Pagina 1 din 1

Permisiunile acestui forum:Nu puteti raspunde la subiectele acestui forum
 :: Gaming :: MuOnline :: Tutoriale Server-
Mergi direct la:  
Statistici:
LinkPro - Director WebClanul beoL Top66 Statistici
Forumgratuit.ro | Jocuri video | Actiune | © phpBB | Forum gratuit de suport | Contact | Semnaleaza un abuz | Creeaza un blog gratuit