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

    amd3th

    @maxsteele there shouldn't be anything wrong in the code that is causing this. You might have to wait until valrix gets back from class because I am just as confused as you are why only you would be getting this error.
     
  3. Offline

    AreLam

  4. Offline

    amd3th


    Yes this has been fixed just not updated yet in the download.
     
  5. Offline

    AreLam

    I was just trying to point it out for maxsteele :)
     
  6. Offline

    amd3th

    @AreLam I appreciate it. Idk if it will fix his problem however, but here's to hoping.
     
  7. Offline

    AreLam

    @amd3th Wow, really? I'd get a blank page each and every time without that semicolon.
    Oh well, I guess that makes my setup less debug friendly, but more production "ready" :p

    (Still not used to this forum's fancy features)
     
  8. Offline

    amd3th

    @AreLam I am kind of an idiot, I just noticed that my webserver was running an earlier version of the get.php that only used a single echo line. I was updating a different version I had set up for a git repository and not updating my webserver so I wasn't seeing the error. [​IMG] Should be fixed in the official release when valrix gets back. In the meantime people will have to fix the error themselves, which truely isn't that hard. Just add a ; to the end of line 80. :D
     
  9. Offline

    maxsteele

    That was it, thanks!

    Like I said, I was just using the get.php provided, and I know nothing about how php works.

    It's working just fine now. :)
     
  10. Offline

    amd3th

    @maxsteele Sorry for the trouble, it was completely my fault. :(
     
  11. Offline

    blaize9

    any way i can run this useing a webserver?
     
  12. Offline

    maxsteele

    No worries! I'm just glad someone was able to find it.

    Now I need to learn how to get fancy so I can sort the columns and such. No clue on php, but I'll see if I can figure it out.
     
  13. Offline

    amd3th

    @maxsteele prior to release I was trying to find a way to sort the columns as well, but they kept destroying my page when using the methods. To my knowledge it has to be done in javascript which is not something I'm fluent in, I'm barely fluent in PHP. I can look into it and release it with another version of the Webpage if you want.
     
  14. Offline

    AreLam

    From what I understand from staring at the code, it simply goes through the table with the different players.

    Ah yeah, felt like I had to share WIP on how it looks when I strip it down :p

    [​IMG]
    Green is online, but the server crashed and I'm too lazy to go into the database ATM to fix it [​IMG]
     
  15. Offline

    amd3th

    @AreLam I really like that idea for the status instead. it's cleaner. I was also thinking of having Val include possibly player rank in the stats db as well, not sure how the plugin could grab player rank from the server though, I'm not sure if it's too difficult to do or not. Curious what others think of the idea.

    Edit: Nevermind that idea, bukkit does not deal with rank in anyway it relies on other plugins to do such. I'm not sure if currently any plugins store the rank in a database so even if they did we wouldn't want to require people to download another plugin they may not want to just get one feature to work.
     
  16. Offline

    Valrix

    Ok I'm back and will update the zip, etc. then see about tracking other stuff. First I'll update the zip for everyone.
    --- merged: Feb 17, 2011 1:23 AM ---
    Okay, due to dropbox acting up I'm using amdeth's site as a temporary place to get it. NetstatsPlugin.zip
     
  17. Offline

    ItsCriminal

    Valrix, if you want we can talk about i can host you some webspace with a subdomain like valrix.sapphira.org just let me know.
    I'm allways in the IRC
     
  18. Offline

    Brack

    Just wanted to say thanks alot for the work you've done here. Makes my webspace happy.
     
  19. Offline

    Valrix

    You're quite welcome!
    --- merged: Feb 17, 2011 2:01 AM ---
    Most of the time I don't have any troubles with DropBox. But my router sometimes acts up which is the main issue. Once I get a desktop computer I'll just be able to host files from it instead of having to rely on something third-party.
     
  20. Offline

    ItsCriminal

    no problem just wanted to ask ;D
     
  21. Offline

    Valrix

    Thanks for asking ^^ You're always welcome to grab the zip and host it and I can have the link as a Mirror in case the DropBox link fails and you'd just need to update the zip every time I do.
     
  22. Offline

    Kane

    @Valrix you would not have happen to make a cheesy php page? Be kind of handy hehe :)
     
  23. Offline

    Valrix

    Cheesy PHP page?
     
  24. Offline

    Kane

    like a basic php page to output the sql info. Or maybe there is one already? Sorry have not tried yet :)
     
  25. Offline

    Valrix

    There's already one in the zip :)
     
  26. Offline

    Kane

    Silly me I was in bed so I was not trying it out hehe. Thanks :)
     
  27. Offline

    ChadTheDJ

    Any way to make it sort by online? When a online player joins, it sorts by a b c by their name and is on the top.
     
  28. Offline

    Valrix

    There is actually. I'll either have amdeth do that or I'll do it when I get back from class (or heck, during class) tonight. I'm still working on the new tracking and saving methods, but doing that is pretty easy. I'm hoping to have the new stuff done by tonight.
    --- merged: Feb 18, 2011 4:18 AM ---
    Netstats has been officially updated to version 1.2! Full list of changes in the changelog.
     
  29. Offline

    Kane

    @Valrix any knowledge in resources this plugin might have on very large servers?
     
  30. Offline

    Valrix

    I don't know how much it uses, but I built it trying to use the least amount as I could. Currently you can't really keep track of how much an individual plugin uses, but for Netstats it really depends on how often players are breaking and setting blocks. It shouldn't take up very much.
     
  31. Offline

    Kane

    does it apply that data instant? Maybe only apply it every 60 seconds per person or more? Not sure I'm little worried I mean we could have 30+ at once digging hehe.
     

Share This Page