Inactive [INFO/WEB] Netstats v5.0.4 - Keeps track of player playtime and online status [RB 1.1-R3]

Discussion in 'Inactive/Unsupported Plugins' started by Valrix, Feb 13, 2011.

  1. Offline

    Valrix

    Netstats v5:
    COMPLETE!
    Keep up with development in BukkitDev!
    Netstats - Player Monitoring Plugin:
    Plugin Version: v5.0
    Web Version: v3.0

    Netstats watches players as they join and leave the server and keeps track of how long they've been logged into the server as well as keeping track of their current online/offline status while using very little system resources. The information is stored in a database which is defined by the user. First time using Netstats it will create the config file then disable itself until you change the config to match your database. Then you can reload or restart the server and it'll start collecting information immediately.
    Source Code: Netstats

    OLD CHANGELOG (open)

    Version 4.7
    • Bug fixes
    • If you don't supply a "database" in the config it will attempt to make it's own database named "NetStats" then create the table "netstats" inside it.
    • Fixed repetitive code and unnecessary MySQL connections when doing multiple queries one-after-another (reduces database calls, speeds up the code, and uses less resources).
    • Reduced code complexity (simplified certain calls and removed hacky functions to improve code performance by around 5-10% in my tests)
    Version 4.6
    • Fixed the bug that happened when trying to change the name of your stats table.
    • Fixed the bug that messed up everyone's total play time (sorry)
    • Code improvements and uses less code for database calls
    Version 4.5
    • Fixed the bug where folders weren't being made.
    Version 4.4
    • Converts the total play time to be saved as seconds instead of milliseconds to increase maximum play time. This will now match the PHP code, so if you changed it, change it back.
    • Now disables and re-enables itself instead of reloading the server when doing a wipe
    • Some code improvements
    Version 4.3
    • No longer requires the /lib/ folder since CB already contains the needed drivers
    • v5 is close to being ready and will bring large speed improvements
    Version 4.2
    • Fixes the bug that creates .stats folders instead of files.
    Version 4.1
    • Many code improvements to improve speed and memory usage.
    • Thanks to @jascotty2 for the code to fix how player and mob kills are handled
    Version 4.0
    • Many bug fixes
    • Changed how total play time was saved to the database
    • Fixed a bug with timed events
    • A new and improved Web update is nearly finished
    Version 3.9
    • Should work with RB 617
    Version 3.8
    • Fixed an issue with how files were handled.
    Version 3.7
    • Fixes issue of logged-in users being shown as offline after a reload
    • Fixed file creation bug where .stat files weren't being made properly
    Version 3.6
    • Fixed a bug where, depending on your region, your IP address was logged twice in the database. This was more of an issue with how the IP address was being grabbed than a problem with how it was stored.
    • Few other small fixes to prevent possible future bugs.
    Version 3.5
    • Changed how paths are managed by the plugin to be more OS-independent, hopefully fixing all "file not found" errors.
    • Removed checking if a database password exists or not.
    Version 3.4
    • Improved error logger that create a special log file with the exact info I'll need to find out what caused the problem.
    • Numerous bug fixes and speed tweaks
    Version 3.3
    • Added tracking of distance traveled
    • Added tracking of number of monsters a player has killed
    • Added tracking of number of other players a player has killed
    • Added the date of when the player first joined the server (after this version of Netstats has been installed, will only be correct after a full wipe of other stats)
    • Database will auto-build if it doesn't exist, otherwise it'll add columns if they're needed (so you don't have to do anything to update your database)
    • Config file now auto-updates and allows for comments (they need their own line however)
    • Many other code improvements and fixes to help it run faster and more efficiently.
    Version 3.2
    • Fixed the problem with saving to the database that everyone's been getting. (Only need the JAR)
    Version 3.1
    • Changed the namespace to com.sparkedia.valrix since I did the Java bit.
    Version 3.0
    • Rebuild of v1 to be more efficient.
    • Customized tracking based on "true" or "false"
    • What you don't want tracked won't be watched which improves performance
    • Timed updates (default is 90 seconds)
    • Fixed updating based on total actions user has done (default is 32)
    • Numerous performance tweaks
    • A "pretty" config file
    • Improved web script performance and added customized tracking (make it match your main config, variables are named the same for simplicity)
    • Web view tells when a player is still online and makes their name green if online, red if offline
    • Uses the "hybrid" method of player data saving like v1 to put less strain on the database
    • When saving to a database it is done dynamically so that only changed things are saved to cut down on the code needed and make smaller, faster calls to the database when saving (this was a big improvement on all previous versions)
    • Table name has been changed to "netstats" to not conflict with any other tables
    • NOTICE: You will need to remove your old data since it is outdated and the table is named differently with a few field name changes so make sure to use the .sql file to add it to your database. Please, before complaining about losing all the old data, realize that there's a 99% chance that it's wrong.
    Version 2.0
    • Complete revamp!
    • Now uses only flatfiles to store data, no more database issues!
    • Lots of code removed and improved for faster speed and less resource use
    • Customizable timed updates (default is every 30 seconds)
    • Customized tracking also reduces resource use by registering (or not registering) events as per your config so it only watches events that you want it to.
    • Web script will search for your CraftBukkit server when you first look at the web page.
    • You can choose where the server will save every player's .stats file by setting the "path" option in the config. The path is relative to your main server folder (where the world folder should be at). So if you set "path=../players/" then the .stats files will be in a folder called "players" in the folder that your server is in.
    • Table of player data is built depending on what your tracking and will change as you change the Netstats config file, nice and easy!
    • There are a few rules to setting paths that are listed above, make sure to read them!
    Version 1.8
    • Various code fixes and changes to improve how it runs.
    • Creates a new blank config file if it can't find one.
    • Only JAR has been changed. Get the newest one above, which I'll just reference from now on since it's faster than posting the same link over and over again.
    Version 1.7
    • Changed how files are accessed which should fix the "Too many files open" bug on Linux machines. Update the [JAR]
    Version 1.6
    • Hopefully fixed bug with connecting multiple times to a property file for each user. Only [JAR] needs updating.
    Version 1.5
    • Fixed a critical bug where user property files (where it saved your data before moving it to the database) wasn't re-defined when the plugin was reloaded. Now it looks for it after everything you do to make sure your data is always being recorded. Only the [JAR] needs to be updated.
    Version 1.4
    • Updated the files to work with the new constructor. You'll need only the [JAR] for this update.
    Version 1.3
    • Fixed a bug with how the plugin saves user data after a server crash
    • Added an Update.sql to add new columns to database table [Web.zip] (only for those upgrading from v1.2)
    Version 1.2
    • Added tracking of blocks broken
    • Added tracking of blocks placed
    • Added tracking of player deaths
    • Added more frequent tracking of total time online
    • Implemented new "safety" storage system
    • New storage system reduces number of database calls
    • Improved the way data is stored to database to take less code
    • The table of data is now ordered by who is online
    Version 1.1
    • Added tracking of player's last used IP address
    Version 1.0
    • Release of Netstats
    WEB CHANGELOG (open)

    Version 2.1
    • Some code cleanup and fixes as well as a better auto-updater that makes sure that the updater is the latest version before doing the actual update process.
    • Localization support for 7 different languages.
    • File name changes to be more netstats-specific which will prevent clashes of CSS and other pages.
    • Better include() and require() calls so a page is only added once which speeds up all the pages and keeps them from destroying each other.
    Version 2.0
    • Improved layout
    • Automatic code updates
    Version 1.0
    • Initial release of web code

    Donations: Don't forget to give amd3th some love too since he helped in making Netstats and came up with the idea (you rock!) as well as @marshall007 since he's been awesome by helping me in his spare time.
     
    Phaedrus, Niemand, D-Lew and 5 others like this.
  2. Offline

    Schlumpfpirat

    How can I see the onlimne times?
    Can I only see it using the web thingy? Can't I see it ingame?
     
  3. Offline

    Valrix

    Ok, just take note that the new version won't have a database.

    I was debating whether to have play time as a stat you can see from in-game or not, but I guess since someone asked I'll make sure to add it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  4. Offline

    Schlumpfpirat

    So actually .. the web thing is thought to bind in your website. Am I right? And the only way to view the stats it to implement it in your website, am I right?
     
  5. Offline

    Valrix

    No, you'll be able to use an in-game command to see some stats and other plugins will be able to hook in to get the stats
     
  6. Offline

    BBFPaco

    Sounds good.

    So it would only make sense if there is a large amount of data in multiple tables? I'm trying to think of how some of the websites and, more specifically, stats websites I've used store data as I know most of them had multiple tables. It just seems that as Minecraft grows, players increase on a server, and Netstats expands that it might have more tables.

    Again, not trying to argue or act like I know any better, just wondering and giving feedback. I'll use Netstats either way. ;)

    A couple examples of what I've used before:

    L4D2 Stats - http://forums.alliedmods.net/showthread.php?t=115965
    COD4 UltraStats - http://www.ultrastats.org/ - I believe this one had tons of tables, and you could look at all sorts of stats in different ways. However, it did end up crapping out with the host I had because I think they changed some php settings and importing data would time out (it would import the server log).

    I've used stats for just about every game I could over the years for our gaming clan, and I think all of them used mysql. This is why I ask about moving toward flat file. Some of the benefits of SQL would be security (arguable, yes), ease of updating (not to bad jumping in phpmyadmin to adjust some values if needed), SQL queries to modify or read values.

    Again, I'm fine with whatever, and I appreciate the explanation Valrix. If it's going to be faster, then I'm fine with faster. I just don't want to see all the hard work put in if later on it will get slow.


    /end long posts from Paco


    ;)
     
  7. Offline

    Valrix

    I'm glad you took the time to give such thought out feedback. I honestly appreciate it a lot when people take the time to talk to me and want to discuss things. I tend to really like tables for storage, but when it comes to something like this where every bit of speed and optimization I can squeeze out makes a big difference, I decided to remove all database reliance which will cut down on tons of usage, and in some cases bandwidth. I don't know how many times I've gone back and rewritten chunks of code after realizing there was a more efficient way of writing it.

    As for security, the folder that'll act as the cache will have .htaccess files in place to make sure nobody can try to tamper with them or whatever. Though nothing can truly be changed anyway, it's just a precaution. I was also thinking of adding a handshake to the communication process to add a security layer so nobody can attack your server. Once I come up with an easy way to do that and get it tested, I'll add it in and continue my work.
     
  8. Offline

    AreLam

    Think of the people with other types of webservers *cough*nginx*cough* :p Nah, I'll manage fixing my own security, and I don't really think the cache files for stats contains anything usable..unless you are into stats :)

    Anyways, have you come any further so I can stop drolling over the alert thing on this forum? :p
     
  9. Offline

    Stardoc

    I have a question...

    Is it possible that players will only appear in the list, not older than 1 week?
    So a special sorting...however what you have to change the script?

    I've given players a different ranking. but now always sorted alphabetically and displayed.

    Can i change this?

    example:

    Player------------Rank .....

    Albert------------Guest
    Bernd------------Member
    Ernie------------ Admin
    Fox--------------- Guest
    Gilbert----------- Guest
    Harry------------ Mod

    But i will sort this ....

    Ernie------------- Admin
    Harry ------------Mod
    Bernd-------------Member
    Fox --------------- Guest
    Gilbert------------Guest
    .....

    Sorry for my bad english :( I hope you understand what i mean..
     
  10. Offline

    Fujikatoma

    Can someone help ?
     
  11. Offline

    Valrix

    This is something you'd manage through the PHP script.

    Means you failed to connect to the database. No I won't help, I'm busy working on v5 so you won't have to care about those errors anymore.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 18, 2016
  12. Offline

    Fujikatoma

    hmm ok i hope at v5 it works :/ because the config iss fill right
     
  13. Offline

    Valrix

    What?
     
  14. Offline

    marshall007

    On a similar note, will hooks exist for plugins to push custom datatypes so NetStats can track them? For example, a spleef plugin might push the winners of each match so that your plugin could keep up with the total number of games each player has one.
     
  15. Offline

    Valrix

    That's an interesting idea. After v5 is out for a bit and I've caught up, I'll think about a way to do this.
     
  16. Offline

    Fujikatoma

    I hope V5 works better because the config file of the plugin iss fill right :/
     
  17. Offline

    rtcabooservb

    Any exact ETA on achievements? And will it include rewards like the old stats and achievements plugin that doesn't get updated anymore.
     
  18. Offline

    Valrix

    When achievements are added it'll have a reward option available. At the moment that's near the bottom of the list of important updates.
     
  19. Offline

    webdevbrian

    Does anyone have a sample of what the statistics files generated (and file structure) look like? I made a shnazzy web interface for a plugin I used back in 1.3 which seems to have disappeared. I'd love to get it working again with another plugin but I don't know what the files look like.

    Here's a screenshot of what I made from a plugin that made flatfiles :

    http://i.imgur.com/2UbAN.jpg

    This is what it looks like when a user hovers over those "achievements" (which gives a basic popup of how it was achieved : http://i.imgur.com/mIpcn.jpg

    I'd like to get this working again for my server ;)

    Thanks!
     
  20. Offline

    Linaks

    Short question @Valrix.
    Why is the Netstats-Web so low? It's loading so long until I can see every user's stats.
    Can you fix that? It is a bit annoying :D
     
  21. Offline

    Valrix

    My answer is that you just need to wait until it's ready and the API is set up.

    Web v3 will fix that. Please wait until the update.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 18, 2016
  22. Offline

    Linaks

    That's perfect ;)
    I love your plugin. It is the only one, which doesn't lagg on my server
     
  23. Offline

    ensirius

    update please plugin :3
     
  24. Offline

    marshall007

    Do you host RedStrype? Your screenshots look identical to what I remember seeing on their site near it's launch.
     
  25. Offline

    nala3

    erm i get an error with the web files. here is the link so you can see...
    http://worldoftomorrow.info/netstats
    actually here is the error :p
    Parse error: syntax error, unexpected '*' in C:\Users\Alan\Website\netstats\netstats_config.php on line 11
     
  26. Offline

    AreLam

    You didn't configure correctly. If you don't replace those "*" you'll get errors like these.. I believe it was either a number or true/false... kinda lazy and you should figure yourself :p
     
  27. Offline

    nala3

    ok then i take it your too lazy to figure this out -.-
    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 206
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5803864728strftime ( )..\data.php:206


    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 206
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5803864728strftime ( )..\data.php:206

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 206
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5803864728strftime ( )..\data.php:206

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 206
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5803864728strftime ( )..\data.php:206

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 206
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5803864728strftime ( )..\data.php:206 Currently Online41m 36s[​IMG]

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 222
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5814865104strftime ( )..\data.php:222

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 222
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5814865104strftime ( )..\data.php:222

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 222
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5814865104strftime ( )..\data.php:222

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 222
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5814865104strftime ( )..\data.php:222

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 222
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5814865104strftime ( )..\data.php:222 DrPain7313248010906908 meters

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 206
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5820865776strftime ( )..\data.php:206

    ( ! ) Warning: Invalid CRT parameters detected in C:\Users\Alan\Website\netstats\data.php on line 206
    Call Stack
    #TimeMemoryFunctionLocation
    10.0069674712{main}( )..\index.php:0
    21.5702852392require_once( 'C:\Users\Alan\Website\netstats\data.php' )..\index.php:23
    31.5820865776strftime ( )..\data.php:206
     
  28. Quick Question.. Why does the PlayerX.stats file still update the enter data if all the info is going into mysql?
     
  29. Offline

    Valrix

    Well, soon the .stats files will be holding all the data and the database will be phased out.

    Ok guys, really nobody should be posting bugs, etc. because the new version is in the works and I really couldn't care about the old version because I'm not supporting it. You'll need to wait until Netstats v5 and NetstatsWeb v3 is ready. Until then, I don't suggest using Netstats since it's just going to lag your server and not keep track of play time correctly. If you choose to use the current version that's out, do NOT post any bugs it has because it's likely not going to get any help. Once the new version is out, then you'll get all the help you need.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 18, 2016
  30. Offline

    gamer1129

    Hey Valrix, I was just installing this on my server, and I was wondering, will you ever make it compatible with MySQLite?
     
  31. Offline

    Valrix

    Nope. It's not going to use any kinds of databases at all actually. It'll store to the stats files and run its own server to communicate with other plugins, web interfaces, and so on. It's a very large update with a whole slurry of new things, fixes, and improvements so it'll run twice as fast and require much fewer resources. Luckily it means a lot less work for everyone, however, more work for me. As long as I keep people's support then I'll have the drive to work on it more and get it done sooner. Though I've been hitting a few roadblocks lately, so development has slowed in order to fix commands and getting stats of offline players. More complicated of course, but it has to be done.
     

Share This Page