Online Hours

Results 1 to 2 of 2
  1. #1
    Apprentice KardDnight is offline
    MemberRank
    Jun 2012 Join Date
    ItalyLocation
    15Posts

    Support Online Hours

    I have online hours exchange script but i saw in my database that all accounts have <NULL> Online hours and server was opened 2 months ago. Can you please suggest me how to fix that?
    I'm using SCF v7.09,Connect Server and Join Server from Titan Tech v11.xx
    Thank you very much!


  2. #2
    Apprentice KardDnight is offline
    MemberRank
    Jun 2012 Join Date
    ItalyLocation
    15Posts

    Re: Online Hours

    Up,please help me :(
    Just answer if it's JS,CS or GS

    Never mind....
    I thin it's game server and i fixed this problem by dropping MEMB_STATS
    And running this query:

    USE [MuOnline]
    GO

    /****** Object: Table [dbo].[MEMB_STAT] Script Date: 06/22/2012 23:50:04 ******/
    SET ANSI_NULLS ON
    GO

    SET QUOTED_IDENTIFIER ON
    GO

    SET ANSI_PADDING ON
    GO

    CREATE TABLE [dbo].[MEMB_STAT](
    [memb___id] [varchar](10) NOT NULL,
    [ConnectStat] [tinyint] NOT NULL,
    [ServerName] [varchar](50) NULL,
    [IP] [varchar](15) NULL,
    [ConnectTM] [smalldatetime] NULL,
    [DisConnectTM] [smalldatetime] NULL,
    [OnlineHours] [int] NULL,
    CONSTRAINT [PK_MEMB_STAT] PRIMARY KEY CLUSTERED
    (
    [memb___id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF
    GO

    ALTER TABLE [dbo].[MEMB_STAT] ADD CONSTRAINT [DF_MEMB_STAT_ConnectStat] DEFAULT (0) FOR [ConnectStat]
    GO

    ALTER TABLE [dbo].[MEMB_STAT] ADD CONSTRAINT [DF__MEMB_STAT__Onlin__038683F8] DEFAULT (0) FOR [OnlineHours]
    GO



    USE [MuOnline]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
    @memb___id varchar(10)
    AS
    Begin
    set nocount on
    Declare @find_id varchar(10)
    Declare @ConnectStat tinyint
    Set @ConnectStat = 0
    Set @find_id = 'NOT'
    select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id COLLATE Chinese_PRC_CS_AS
    where I.memb___id = @memb___id
    if( @find_id <> 'NOT' )
    begin
    update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), OnlineHours = OnlineHours+(DATEDIFF(mi,ConnectTM,getdate()))
    where memb___id = @memb___id
    end
    end
    Last edited by KardDnight; 26-06-12 at 10:37 PM. Reason: Added another part of query



Advertisement