Haunted Dawg Posted April 13, 2008 Share Posted April 13, 2008 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. Quote Link to comment Share on other sites More sharing options...
JDubz Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Nice modification, If the +1 was still here I would give you :mrgreen: Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted April 14, 2008 Author Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Glad you like :-) Quote Link to comment Share on other sites More sharing options...
Gator Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Works fine, good one bud. :-D Quote Link to comment Share on other sites More sharing options...
Robert Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Nice mod, How will this work on a much larger game? I am considering using it but good thinking Killah :wink: -Robert™ Quote Link to comment Share on other sites More sharing options...
Will Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Instead of loading a new page you could just change the link to: TTL: '.$dt . $ht. $mt.' Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted April 14, 2008 Author Share Posted April 14, 2008 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 :) Quote Link to comment Share on other sites More sharing options...
Spudinski Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Why not just use the field that holds the time the user signed up? It would be much easier to do, and not as complex. Quote Link to comment Share on other sites More sharing options...
Will Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] I think another abbreviation should be used. To me TTL means either: Time To Live or Transistor-Transistor Logic. TTLO? Quote Link to comment Share on other sites More sharing options...
Danger-Hazard Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Very Nice Addition To A Game Question : Would It Not make Your Servers Slow If You Have Alot Of Users ? Quote Link to comment Share on other sites More sharing options...
-Matt- Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Depend's on your server if you are on a dedicated server it would only slow down by like 0.0000099 of a seccond but shared could slow it down abit but i don't know. Quote Link to comment Share on other sites More sharing options...
Danger-Hazard Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Cheers Matt I Was Just Wondering Cos It Has Alot Of Querys Going Through The DB Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted April 14, 2008 Share Posted April 14, 2008 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. Quote Link to comment Share on other sites More sharing options...
Danger-Hazard Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Thanks For The Replys -Matt- & Nyna Would There Be Anyway Of Making This Code Not Loop As Much ? Quote Link to comment Share on other sites More sharing options...
-Matt- Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Could just count minutes. . . Quote Link to comment Share on other sites More sharing options...
Danger-Hazard Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Not To Be Rude That Would Make It 10 Times Worse Think About It There Are 60 Minuites And 24 Hours Tell Me Which Is Bigger :) Id Rather Count Hours If There Is Away Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted April 14, 2008 Share Posted April 14, 2008 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. Quote Link to comment Share on other sites More sharing options...
Danger-Hazard Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Thanks for the advice guys despite what Nyna said im going to try it on my free web host game 1st see how bad it lags if all goes good i will then test it on my alpha game .... Once again thanks for the feedback much apreicated Quote Link to comment Share on other sites More sharing options...
-Matt- Posted April 14, 2008 Share Posted April 14, 2008 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. Quote Link to comment Share on other sites More sharing options...
Danger-Hazard Posted April 14, 2008 Share Posted April 14, 2008 Re: [FREE] Total time logged in [v1 + v2] Maybe So .... Evetually The Server would get slow calculating all the different times ... Either way you dont win with this add-on ey ? :-P Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted April 14, 2008 Author Share Posted April 14, 2008 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.