Jump to content
MakeWebGames

[FREE] Total time logged in [v1 + v2]


Haunted Dawg

Recommended Posts

Ok i was looking around ce for some thing to keep my members active. I noticed Total time loggedin.

Add this to where you want to display:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

To display it:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

You might need to edit my code since my source is quite different :)

Now for the minute cron:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Now for those who dont understand TTL in your game add this to header:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Now for the final part SQL:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Enjoy.

Link to comment
Share on other sites

Re: [FREE] Total time logged in [v1 + v2]

Good thinking will. I never thought of that :lol:

 

Nice mod, How will this work on a much larger game? I am considering using it but good thinking Killah :wink:

-Robert™

A larger game i guess you could just do the same? its only updating people who are active in the last 3 minutes :)

Link to comment
Share on other sites

Guest Anonymous

Re: [FREE] Total time logged in [v1 + v2]

Well that's the trouble... A tight loop continually updating the database engine, not a good idea.

It won't make much difference on small games, but a large system, it would need to be optimized.

Link to comment
Share on other sites

Guest Anonymous

Re: [FREE] Total time logged in [v1 + v2]

Yes, get rid of it.

It's an unnecessary evil. Running stuff like this in a cron will just result in lag. A large % of the data is in the web-server logs. Any standard hosting company has stats based on these logs, showing visitors, returning visitors, uniques etc.

Thinking along those lines. it would be simple to write a simple include that registers each page hit with the current user id into a table.

Analysis of this table could be performed easily, quickly and effectively off-line without slowing down the main system at all.

Link to comment
Share on other sites

Re: [FREE] Total time logged in [v1 + v2]

Well really there is no point of this, it's just gonna make your game run slow no matter what, maybe it's possible to do somthing that record's when you loggedin.php so going onto the game at say 20:16 and logout at 20:18 some how calculating but maybe it's not possible.

Link to comment
Share on other sites

Re: [FREE] Total time logged in [v1 + v2]

All these posts in just one day. sheesh i am very sad to see this. BUT! let me tell you this:

 

I went to my server and asked is it fine to run this cron per minute he says even with a database with over 50k members it will run perfect and why? because its only selecting A FEW!

If you put this on torncity it will the run the same updating 300 queries is not that much when normaly a five minute cron is updating a hole database for christ sakes! so please next time go look around befor you people post such rubish!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...