MMOwebs Project Blogs Creating Dynamic Gaming Websites was never this easy.

9Mar/108

Mu Online Total Online Mod

What this does?
- add a new column in your MEMB_STAT table for total online time for the user EVER!

Does can it count in HOUR, DATE, Minutes?
- yes

Do i need this?
- no idea... it's ur life

What sort of things i can do with this?
- well i don't really know but i use as referral system on my test server. referral Total Online TIme = Mu CASH ^^

STEPS FOR INSTALLATION

1. NEED TO ADD A NEW COLUMN in MEMB_STAT TABLE
-----
COLUMN NAME: TotalTime
TYPE: int
NOT NULL
DEFAULT 0
-----

2. Change your WZ_DISCONNECT_MEMB ( stored procedure )

CREATE PROCEDURE 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 DATABASE DEFAULT where I.memb___id = @memb___id
 if( @find_id <> 'NOT' )
 begin
 update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), TotalTime = TotalTime+(DATEDIFF(mi,ConnectTM,getdate()))
 where memb___id = @memb___id
 -- TIMEONLINE MOD by john_d
 end
end
GO

If you also want to add a Total Online count for Character?

STEPS FOR INSTALLATION

1. NEED TO ADD A NEW COLUMN in CHARACTER TABLE
-----
COLUMN NAME: TotalTime
TYPE: int
NOT NULL
DEFAULT 0
-----

2. Change your WZ_DISCONNECT_MEMB ( stored procedure )

STEPS FOR INSTALLATION

1. NEED TO ADD A NEW COLUMN in  MEMB_STAT TABLE
-----
COLUMN NAME: TotalTime
TYPE: int
NOT  NULL
DEFAULT 0
-----

2. Change your WZ_DISCONNECT_MEMB (  stored procedure )
CREATE PROCEDURE WZ_DISCONNECT_MEMB
@memb___id varchar(10)
 AS
Begin
set nocount on
    Declare  @find_id varchar(10)
   Declare  @con_tm DATETIME
    Declare @ConnectStat tinyint
    Set @ConnectStat = 0
    Set @find_id = 'NOT'
    select @find_id = S.memb___id, @con_tm = S.ConnectTM from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id COLLATE DATABASE DEFAULT where I.memb___id = @memb___id
   if( @find_id <> 'NOT' )
    begin
        update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), TotalTime = TotalTime+(DATEDIFF(mi,ConnectTM,getdate()))
         where memb___id = @memb___id
            -- TIMEONLINE MOD by john_d
         update character set TotalTime = TotalTime+(DATEDIFF(mi,@con_tm,getdate()))
         from character as c INNER join AccountCharacter as ac ON
         c.Name = ac.GameIDC COLLATE DATABASE DEFAULT where c.accountid = @memb___id
    end
end

GO

About john_d

Is a Freelance Programmer for MMOwebs.com. Specializes in Javascript/Flash/DHTML interfaces, PHP/ASP backends, and Database systems
Filed under: MU Online Leave a comment
Comments (8) Trackbacks (0)
  1. i get a syntax error “error 156:incorrect syntax near the keyword database”
    any ideea why ?

  2. hey john, could you share an sample php script that will show the most online? Thanks!

  3. What this does?
    - add a new column in your MEMB_STAT table for total online time for the user EVER!

    where i find MEMB_Stat?

  4. Should be a table in your MUONLINE Database

  5. john_d can you give me the script how you use this script to referal system please :(

  6. Give me this error:
    ‘MEMB_STAT’ table
    - Unable to modify table.
    ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column ‘TotalTime’, table ‘MuOnline.dbo.Tmp_MEMB_STAT’; column does not allow nulls. INSERT fails.
    [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.

    What i do ?


Leave a comment

You must be logged in to post a comment.

No trackbacks yet.