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

    Valrix

    Interesting, I have it do an md5 hash check on the player's saved skin versus the one on amazon and if they don't match it'll grab the new skin.
     
  3. Offline

    SyPi

    A combination of filedate and md5 would be the best performance solution. To check every time the md5 hash of 100 visitors takes to mutch time.
     
  4. Offline

    Lord Chaos

    Ah ok, thats fine :) I've been looking over the data more closely now that I got it working. (turned out it was the web server that was blocking outbound port 3306, DOH!) and its not as bad as I feared, its fine that you delete most of it.

    I look forward to seeing what you can come up with in Version 4.0 :)
     
  5. Offline

    Valrix

    Yeah, I wouldn't want to delete information that I don't have to since that is a bit more intense on the table. I'm told that not all admins have access to command line which is somewhat required when you need to wipe the data, but instead I may just check the version of the config and if it doesn't match the new format it'll clean up the database and delete the files. The wipe process doesn't work when players are online so if the command is used from in-game it'll save each player and kick them (including the admin) before wiping the data and reloading the server for you. This will probably happen very fast, so be sure to inform your players before you do the wipe so they don't flame you for kicking them, even though everything will be saved.
     
  6. Offline

    Valrix

    Beta is ready for testing. Please follow the instructions I gave while testing it so you don't accidentally break something.
     
  7. Offline

    Letalis

    I closed the server and added the beta version and got this error while booting the server.

    Code:
    2011-04-14 10:16:53 [ALLVARLIG] tried to access class com.sparkedia.valrix.Netst
    ats.Netstats$1 from class com.sparkedia.valrix.Netstats.Netstats loading Netstat
    s vb4.0 (Is it up to date?)
    [Error] Minecraft server error. Server will be restarted.
    java.lang.IllegalAccessError: tried to access class com.sparkedia.valrix.Netstat
    s.Netstats$1 from class com.sparkedia.valrix.Netstats.Netstats
    2011-04-14 10:16:53 [ALLVARLIG] com/sparkedia/valrix/Netstats/Netstats$1 loading
     Netstats vb3.9.1 (Is it up to date?)
     
  8. Offline

    Valrix

    You somehow have more than one version of Netstats?? The heck?

    I would suggest stopping the server and removing the netstats.jar then download the beta again and put it in the plugins folder.
     
  9. Offline

    Letalis

    Sorry My bad. I thought I overwrote the old Netstats.jar but somehow I added a second netstats(1).jar.
    It could be that the server wasnt totally closed when I added it..
    Sorry for that.
     
  10. Offline

    Valrix

    Haha, you had me worried there for a moment. I've never seen that error before. Anyway, please do let me know how the testing goes. I'm about to go to bed so I'll report back in the morning.
     
  11. Offline

    Letalis

    Have you had a chance to update the web part?
     
  12. Offline

    Valrix

    I'm still working a lot on the web part. It's not updated yet, but will be pretty soon. Luckily the Web part is separate from the actual plugin so you will be able to update the plugin and gather up stats before the web part so you can fully enjoy it when it's ready. When Notch does the next update to include stats and we figure out how he does it, there may be a new revamp to v5 depending on how easy he makes it to gather stats, and if they can be altered then I will try to find a way to add in the previous stats gathered from v4. We'll just have to wait and see how things turn out to be sure.
     
  13. Offline

    Bambo

    When i download the files there are no sql files included?
     
  14. Offline

    Valrix

    Correct, it creates the table and data all on it's own. No need for any sql files. Once you first start it Netstats will tell you it made the config file and will disable itself. Then edit the config to match the settings you want, save it, and restart the server. People have to log in the first time Netstats is run, just reloading will mess up the data. After that, you're done! I also suggest using the Beta otherwise you may run into problems because the other one is outdated and you'll have to wipe all the data when 4.0 is released. So I do highly suggest using the beta. The update from beta to 4.0 shouldn't mess anything up when it's done being tested.
     
  15. Offline

    Bambo

    Well when i started it before nothing was added to my database and nothing happened?
    I'm so confused.

    Ah, my fault. Forgot to configure it on the Java side ^^

    thanks for the response, also for these "oldtable=" and "newtable=" what do i fill in?

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

    Valrix

    Those are optional and only if you want to have a different table name than "netstats" in your database.
     
  17. Offline

    Bambo

    Dude, its not creating the tables nor filling it in. This is getting silly!

    Lemmie check its not the webhoster blocking the ip
     
  18. Offline

    Valrix

    Also make sure that the user you're giving it has the correct permissions to create tables on the database otherwise it won't be able to do anything. If it can't make the table, it won't be able to write to the table.
     
  19. Offline

    Bambo

  20. Offline

    Valrix

    Yeah...? "Yeah" what?
     
  21. Offline

    Bambo

    you should implement some sorta way that it used HTTP request to add information to the database because this happens with some hosts its pretty annoying!
     
  22. Offline

    Valrix

    The only way for Java to store the data in the MySQL database is through the connector using the required port. I don't think it's at all possible to send it through HTTP to a non-HTTP port. 3306 is a TCP port and that's what's required. If the host is blocking it, you need to talk with the host.
     
  23. Offline

    Bambo

    Yeah just doing it now, the minecraft server's ip needs white-listing.

    Thanks i think i've sorted it.
     
  24. Offline

    Valrix

    Alrighty then.
     
  25. Offline

    Bambo

    It still doesn't work...
     
  26. Offline

    Valrix

    Are you sure they're allowing access to it? Try to connect to the DB from somewhere/something else and see if you can connect. Also post any errors that are being stored in the /logs/ folder.
     
  27. Offline

    Bambo

    its creating profiles in the "players" folder, its just not uploading them.
     
  28. Offline

    Valrix

    The .stats files are for temporary storage only until the action limit has been reached or the timed update fires OR the player logs out. If it doesn't save to the DB, then an error should be posted to an error log file.
     
  29. Offline

    Bambo

    alright. Thanks for all the help, i'll probably Donate a couple of monies if i get this working

    you know it says update time "90" is that seconds?

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

    Valrix

    Yes, that's in seconds.

    That would be quite appreciated.
     
  31. Offline

    Bambo

    I have a few questions:
    1) "admin=" is that my ingame name?
    2) does the "host=" require the port?

    If i can't get this working i will slit my wrists ^^
     

Share This Page