Bienvenidos a un nuevo tutorial, el siguiente procedimiento corresponde a la versiĆ³n 0.97D+0.99B del MuOnline y se titula WZ_CONNECT_MEMB
--www.muonlinetutoriales.com
--by asd*
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