AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Time played for all users (https://forums.alliedmods.net/showthread.php?t=265584)

Schpraaankiii 06-30-2015 16:14

Time played for all users
 
hey, is there a plugin that count all players active time time spent on multiple servers that preferably log the time into a database. If not, is there anyone who would wanna take this challenge on?
A separate time log for the activity on each server for all players and a total time active on all servers for all players would be amazing.

So it would look like this (each row for a collumn in the db)

k0nan
(SteamID)
Total time: 242h 23m
Hide'n'Seek: 142h 10m
Surf: 50h 13m
Aim: 50h

ThatOneGuy 06-30-2015 20:46

Re: Time played for all users
 
Paid? Volunteer? Helps to specify.

I dont know of any such plugin, but it wouldnt be all to hard to code one. One downside to it: sometimes players can disconnect and the OnClientPostAdminCheck event wont have fired. So, while this is usually not the case, occasionally it will not have a start time to compute the play time with. I have a plugin that logs this sort of stuff, but to FTP logs for each steam ID, not to a database. Also, do you need it to differentiate between time in spec vs time on teams? I feel that can make the values far more meaningful.

friagram 06-30-2015 23:42

Re: Time played for all users
 
I have not seen this posted here, but it should be done with mysql, not some silly flatfile implementstion.
Easy to write.

ThatOneGuy 06-30-2015 23:53

Re: Time played for all users
 
Quote:

Originally Posted by friagram (Post 2314120)
I have not seen this posted here, but it should be done with mysql, not some silly flatfile implementstion.
Easy to write.

It is part of another plugin, so the flatfile made sense for it...dont talk shit til you know context...smh

As for the OP request, mysql is the only way I would suggest doing it (I dont think that was in question but wanted to clear up that I wasnt suggesting otherwise).

friagram 07-01-2015 01:32

Re: Time played for all users
 
Quote:

Originally Posted by ThatOneGuy (Post 2314125)
It is part of another plugin, so the flatfile made sense for it...dont talk shit til you know context...smh

As for the OP request, mysql is the only way I would suggest doing it (I dont think that was in question but wanted to clear up that I wasnt suggesting otherwise).

Still fail, as the average popular server could get tens of thousands of unique visitors over a month, which is a lot of needless files. The context does not matter. Flatfile approach like this is beyond bad when much better alternatives are easily available.

Also, you dont need postadmincheck, onclientauthorized is the proper callback and happens much earlier.

Don't act like you know what you are doing and be insulting to others when you clearly know very little.

ThatOneGuy 07-01-2015 02:43

Re: Time played for all users
 
Quote:

Originally Posted by friagram (Post 2314147)
Still fail, as the average popular server could get tens of thousands of unique visitors over a month, which is a lot of needless files. The context does not matter. Flatfile approach like this is beyond bad when much better alternatives are easily available.

Also, you dont need postadmincheck, onclientauthorized is the proper callback and happens much earlier.

Don't act like you know what you are doing and be insulting to others when you clearly know very little.

Your really eating your own words kiddo.

The plugin I mentioned involves admin checks, so OnClientPostAdminCheck IS required.
From clients.inc:
Spoiler

The plugin is namely logging admin actions, but includes play time, so mysql would be a terrible platform for such a plugin.

And the number of users is limited to the server admins, so it isnt thousands of unique visitors.

Try not to be so ignorant and rude next time...grow up a bit.

EDIT: Anyways...back on topic....I've coded the plugin, it compiles great, but it still needs testing. Right now, it separates the time into an SQL table column for both play time and another column for spectate time, and auto-appends two new columns every time a new server runs the plugin. I'm off to bed, but will test it tomorrow.

Schpraaankiii 07-01-2015 17:33

Re: Time played for all users
 
I don't really follow all your advance talking XD
But I do however want the logging to be done with a MySQL database so I can output the data on my community.
Also, How's it going 'ThatOneGuy'? Have you got it to work? :)

friagram 07-02-2015 04:31

Re: Time played for all users
 
Quote:

Originally Posted by ThatOneGuy (Post 2314159)
Your really eating your own words kiddo.

The plugin I mentioned involves admin checks, so OnClientPostAdminCheck IS required.
From clients.inc:
Spoiler

The plugin is namely logging admin actions, but includes play time, so mysql would be a terrible platform for such a plugin.

And the number of users is limited to the server admins, so it isnt thousands of unique visitors.

Try not to be so ignorant and rude next time...grow up a bit.

EDIT: Anyways...back on topic....I've coded the plugin, it compiles great, but it still needs testing. Right now, it separates the time into an SQL table column for both play time and another column for spectate time, and auto-appends two new columns every time a new server runs the plugin. I'm off to bed, but will test it tomorrow.


I'll not drag this on, but I do know what I'm talking about, and I will remind you that you are the one that took offense to my earlier message where perhaps the only negative thing i said was that your approach was 'silly.'

I'm not a fan of inferiority complexes, and it is silly to push on and ignore good advice when it is given. We're all wrong sometimes, and it's much better to learn to recognize our errors so we can improve, rather than follow along the same broken track forever. While simple and familiar is easy, it is not always the best.

As far as you thinking I'm a kid, it's likely that I am not only your senior in age, but skill/experience as well. Looking at your pervious posts, I see a pattern of hostility and empty praise. You're not an administrator, though most of your posts are laid out as if you were in some position of power. Let's not cling to a false sense of superiority or importance, and just focus on the tasks at hand.

That being said, I stick with my original assertion, that huge numbers of flat files are bad, sql is far superior, and that onclientauthorized is usually best for queries (because signal admin check can be greatly delayed by some plugins, thus causing postadmincheck to not fire in a timely manner). If it does indeed require admin checks, and it is time critical, you can use one of the earlier admin checks.

ThatOneGuy 07-02-2015 11:01

Re: Time played for all users
 
Quote:

Originally Posted by friagram (Post 2314490)
I'll not drag this on, but I do know what I'm talking about, and I will remind you that you are the one that took offense to my earlier message where perhaps the only negative thing i said was that your approach was 'silly.'

I'm not a fan of inferiority complexes, and it is silly to push on and ignore good advice when it is given. We're all wrong sometimes, and it's much better to learn to recognize our errors so we can improve, rather than follow along the same broken track forever. While simple and familiar is easy, it is not always the best.

As far as you thinking I'm a kid, it's likely that I am not only your senior in age, but skill/experience as well. Looking at your pervious posts, I see a pattern of hostility and empty praise. You're not an administrator, though most of your posts are laid out as if you were in some position of power. Let's not cling to a false sense of superiority or importance, and just focus on the tasks at hand.

That being said, I stick with my original assertion, that huge numbers of flat files are bad, sql is far superior, and that onclientauthorized is usually best for queries (because signal admin check can be greatly delayed by some plugins, thus causing postadmincheck to not fire in a timely manner). If it does indeed require admin checks, and it is time critical, you can use one of the earlier admin checks.

I totally agree that SQL is better IN MOST SITUATIONS, and that onclientauthorized is preferable for getting steam IDs, when that is all that is required. I never disagreed to that, actually. I just said that you statement that SQL is ALWAYS better than writing to files isnt the case - there are specific situation where a file is preferable, and postadmincheck is required due to needing to know if they have certain flags when previous plugins are done handling them.

As to your allegations of my age, etc., and my attitude on these forums, I would have described you similarly, based on what I've seen of you. Other than my responses to you in this thread, my responses are rarely hostile. The only sense I've acted as an "admin" is telling people that bumping, cross-posting, and deleting threads after resolution are against forum rules. I don't stick to the "familiar", and even if I did, SQL is "familiar" just the same as writing to files...there are just some situations where it is not the best tool available.

As to this plugin though, I 100% agree with you on how it ought to be coded. The plugin is finished. I'm at work right now on break, but I'll PM the OP when I get home.

Schpraaankiii 07-02-2015 11:30

Re: Time played for all users
 
Quote:

Originally Posted by ThatOneGuy (Post 2314593)
The plugin is finished. I'm at work right now on break, but I'll PM the OP when I get home.

Thanks!


All times are GMT -4. The time now is 15:47.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.