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


    Netstats v5:
    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 [] (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


    Well, once the system is actually up and working in a stable manner, I can add pretty much whatever features people would like within reason.
  3. Offline


    I'm just starting with Netstat.
    I got MySQL up and running
    I got the jar in and configured and no errors reported on start.
    But the file link for Netstat Web is broke.....
    Can this be fixed?
  4. Offline


    With v5 that'll be coming out in a while, you won't need MySQL which is why some things are a bit broken.
  5. Offline


    Define "a while", a week from now, two, three a month :D ?
  6. Offline


    Well the other day we finally have the new method for getting player data from the server to PHP working correctly regardless of if you want just one player or all of them, so from here it's working in the rest of the functionality of the API and cleaning up the code to reduce and eventually remove memory leaks and improve performance. Otherwise we've actually got to play with it a bit and it does in face to proper tracking of stats, save them, and report them when called upon. So from here it's making sure the API can be called without problems, the data it returns won't be all screwed up, and it doesn't leak a bunch of memory. If all goes well, it should be a few weeks at most, just to be sure we don't give you guys something that breaks and destroys everyone's stats, servers, etc. That would be very bad...
  7. Offline


    Okay, thanks for the reply - Guess I'll have to be patient a few weeks then ;)
  8. Offline


    There no longer seems to be a Download link to the plugin, just the source. I found an old jar for it but after looking through the comment it looks like I also need a sql file for it to work properly? Is there somewhere I can obtain an up to date jar and the sql file I need? Thanks!
  9. Offline


    *Eagerly awaits for v5*
  10. Offline


    No, I removed the link because v4.7 is leaky and will require more work to work from than waiting for v5. Plus, v5 will be out pretty soon now that it compiles and tracks stats. Depending on if I get my job or not, either I'll be working next week, or I will be working on plugins every day before classes and all day Fridays. I hope to get the job, though I'm sure I would only be allowed to work a certain amount of hours every week which would be filled in around 3 days, giving me Fridays to work on plugins all day while making money to pay the internet bill, etc.

    My suggestion is to wait for v5 which will be released once the API is done since from there we'd only have to improve the code to remove leaks, etc. unless people would rather wait a bit longer and have less leaks and a surprise I have planned for the web code. The surprise is nearly done, but will take just a bit more work to be perfect.
  11. Offline


    YAY! 95% done haha keep it up man I'm totally psyched
  12. Offline


  13. Offline


  14. Offline


    Last night I worked on the PHP code to show the stats returned from the server after properly parsing it, which it now uses JSON so nearly every language should have no problems getting and parsing the stats.

    On the Java side I've been getting help from @marshall007 to run a small HTTP server that waits for requests, parses them, then send back a response with the requested data. Good news is everything is running nice and fast and we're working on the API to be sure it's lean and can handle a bunch of stat requests without bogging down the server. Otherwise I can safely say everything actually works, but needs to be smoothed out before we want to release it otherwise you'll get some weird problems and won't have all the functionality I want in it for this update.

    I've also patched up one of the main classes to handle smaller numbers so less resources will be used while Netstats is running. Something else to get everyone excited is that Netstats will also officially be multi-lingual! While marshall007 works on the HTTP stuff, I'm going to be working on standard-compliant multi-language support which will be translations done by the community, for the community instead of using a translation service to be sure all translations make sense and are accurate. Once I get the basics of it set up, I will then post the template for those of you who are not natively English so you may post the translation for me to add in (much like I had everyone do for the web code). Hopefully I'll have that ready sometime today so we can start getting translations in immediately and I can begin testing. Stay tuned!
    Freakdk likes this.
  15. Offline


    yay :)!
  16. Offline


  17. Offline

    Boon Pek


    Anxiety manifests... I hope it still retains its ability to write to a MySQL database, and have a PHP script online read from it. I'd like it to be integrated into my forums, which are hosted on a proper webserver online; my Minecraft server's bandwidth is already as low as it is :p
  18. Offline


    @Valrix : Please test against latest RB, #740 is very inactive!

    EDIT: Uh, where are the download links? I see you have a placeholder for #1000. :p
  19. Offline


    Can you please add to config, in which world will be stats tracked?
    Because I've normal and creative world, and I want stats only from normal world.
    Second option is create permissions node and then write "-netstats.something" in creative world permissions to disable tracking.

  20. Offline


    It's active, but the old version was broken and...unhealthy for servers to use, and the next version is almost ready so I remove the old link and have been preparing the thread for the next version.

    I haven't worked in multi-world support yet, but that is planned. Seeing as multiple worlds are so common now, I'll probably have to add that in for v5 so people don't get upset. And it will be configurable.

    Haha. Well, the ability to access a MySQL database is gone, but Netstats now works like asking a server for some data, then getting JSON back which is even better since it's less bandwidth hungry and more accurate, not to mention almost every language can easily parse JSON. The API will be fully explained to ensure everyone can easily use Netstats. We've been working hard on this update, so it's going to be amazing no matter how much work it takes.
  21. Offline


    @Valrix : Do you mind if I will move this to inactive for the time being?
  22. Offline


    2 more %! Been looking forward to this moment for a long time. Kinda sad MySQL is removed, but I agree, JSON will be better. I just have to learn a bit more about it first >_> Good thing you are not rushing it. It would have been really sad if it's buggy at release...
  23. Offline


    No pressure! haha
  24. Offline


    I have been getting something buggy happening. The pluggin works great and I love it. But the category "Time played" that is measured in seconds sometimes goes very whacky.. For example. One of the players on my server has logged "5248243315 seconds". Which is impossible. I don't know where the error is in your code, as I do not program in Java anymore. Here is my stats page I made.
  25. Offline


    I don't mind. That may actually save me from needing to answer support questions for it.
  26. Offline

    Boon Pek

    Still at 98% :p
  27. Offline


    Yep, but it's getting close. Just been busy. I didn't have a chance at all yesterday because my HDD got corrupted. Luckily I was able to save all my files, but it took all day to do the backup, remove the partition, then re-install all my files. It sucked.
  28. Offline


    Put up v5 as beta build when you think it's ready? :)
  29. Offline


    Plan on it :)

    Need a general consensus though, how important are the old stats? I'm not sure if I want to have to take the time to create a PHP script to scrape the stats from the database and have it sent to Netstats to add/create the data. That would make v5 delay by a few days and is only useful once. Otherwise, I can leave it up to the admins to migrate the old data over if they want, or just start everyone from scratch to be sure everyone starts off evenly. I just thought I'd ask to see if it's really THAT important to automate this process. If most say "no", then v5 will be released a good number of days sooner.
  30. Offline


    I don't care about our old stats.
  31. Offline


    Sweet, so that's one for not saving old stats. I might add a quick poll to make this easier.

    Edit: Or not...guess you can't hot-swap poll threads. Dang.

Share This Page