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

    The new storage system is based on the number of actions the player does. And "action" counts as a block placed or broken and you can set the number of actions before it saves to the database. I have the default set to 32 so that it would take a total of 32 blocks being broken/placed until the server saves their data to the database. Or if they haven't hit that many actions before they log out it will then save to the database. This was done to cut down the number of database calls and to ensure that player data stays safe even if the server crashes.
     
  3. Offline

    dafour

    Hmm i dont get this.

    I've put the jar and map with config in the plugin folder,but i dont know what to do with the web folder.
    Do i have to run a website for this to work?Forgive me my stupidity..
     
  4. Offline

    Valrix

    Yes, this is a plugin meant to store data in a database so it can be shown on a website.
    --- merged: Feb 18, 2011 1:23 PM ---
    I fixed a major bug with how player data is saved. Please make sure to update. Only JAR needs to be updated if you have version 1.2, 1.1 needs a full update however.
     
  5. Offline

    AreLam

    Total SQL noob, but could you make it "easier" to update the database to the latest version? I'm sure I can create the rows/field/whatever myself, but it would be nice to have a .sql that could add the rows (for existing databases). :)
     
  6. Offline

    Valrix

    Yeah I'll see if I can figure a way to do that and will update the file.
    --- merged: Feb 18, 2011 11:15 PM ---
    Okay, I added an Update.sql which will update your table from v1.2 to v1.3 so previous data will be safe. I'll remember to do this next time, sorry for the inconvenience everyone.
    --- merged: Feb 20, 2011 4:32 AM ---
    Netstats has been updated v1.4 to fit with the new way of building plugins.
     
  7. Offline

    iJusDefy

    I need some help. Whenever I try to run your plugin, I get the following error in the window:

    Code:
    2011-02-20 13:35:21 [SEVERE] Could not load plugins\Netstats.jar in plugins: aut
    hors are of wrong type
    org.bukkit.plugin.InvalidDescriptionException: authors are of wrong type
            at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile
    .java:182)
            at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.
    java:29)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:60)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:129)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:94)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:53)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:179)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:166)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:118)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:217)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    How can I resolve this? Thank you, and I greatly appreciate your work on this!
     
  8. Offline

    ratty

    I just tried using this plugin for the first time and I get the "authors are of wrong type" error as well, I'm using craftbukkit build 361.
     
  9. Offline

    Valrix

    Hey guys, sorry I've been asleep and will check this out now and fix it right away.
    --- merged: Feb 20, 2011 10:42 PM ---
    Okay, everything is fixed. It was a typo in the plugin.yml that caused it to break. Just redownload the jar and everything should work just fine. Sorry for the inconvenience.
     
  10. Offline

    ratty

    Thanks for fixing that!
     
  11. Offline

    Valrix

    You're quite welcome. Hopefully it didn't create too many problems while I was away. Next time I'll double check before I release it because that shouldn't have happened...
     
  12. Offline

    ratty

    Just one more thing, if I type "reload", it freaks out

    [SEVERE] Could not pass event BLOCK_BREAK to Netstats

    and for every other event as it happens
     
  13. Offline

    Valrix

    Yeah, there shouldn't ever really be a need to reload it actually. Once it gets started if you need to change anything it's best to restart the server or the player data can get messed up since it tracks users nearly constantly.
     
  14. Offline

    ratty

    I need to reload when making changes to other plugins, frequently I'm changing recipes in Craftdispenser, and can just reload after each change without making everyone rejoin.
    But if I have the Netstats plugin running, I have to restart the server everytime I change a config instead of just doing a reload because Netstats bugs out.
    I use BigBrother plugin, and it has to read events and put them into a database, and it has no problem after a reload so I don't think its a bug in craftbukkit.
     
  15. Offline

    Valrix

    Hmm, I'll have to see if there's a way to maybe keep Netstats from being affected or see how to keep it from freaking out when reloaded.
     
  16. Offline

    iJusDefy

    Thank you very much for fixing that issue. It loads correctly now, but I have another question I am hoping you can help me with, but is a problem on my end... I get the following error when it tries to access the database. The database is there with the correct name and host. It loads a blank table with the header titles at the top when I load get.php.

    Code:
    Could not fetch data for mysql: java.sql.SQLException: invalid database address: jdbc:mysql://supremecenter34.com/agomez_mc
    Could not set data for java.sql.SQLException: invalid database address: jdbc:mysql://supremecenter34.com/agomez_mc
     
  17. Offline

    Valrix

    Don't know what to tell you.
     
  18. Offline

    ratty

    Just speculation, but something to try, it might not like the _ in the database name.
     
  19. Offline

    Valrix

    Nah, underscores work fine. I know another user who has them and it works alright. Could be a typo or an extra space in the config maybe. That's all I can think of.
     
  20. Offline

    iJusDefy

    I discovered the problem was with the MySQL server I was trying to fetch and set the data from/to. I've started using another server and the problem no longer occurs. Thanks again
     
  21. Offline

    Valrix

    Ah. Good to know the problem was sorted out. Enjoy! :)
     
  22. Offline

    Phantom Index

    iConomy support?
     
  23. Offline

    Valrix

    Though tempting, it would be too much work and I don't like the idea of hooking into something that breaks as often as it seems to. Niji has also said that he's getting bored with MC.
     
  24. Offline

    Pyroking

    I get these errors:

    Code:
    2011-02-23 18:16:12 [SEVERE] [Netstats]: Could not set data for com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    2011-02-23 18:17:34 [SEVERE] [Netstats]: Could not set data for com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    2011-02-23 18:18:08 [INFO] /74.207.241.234:56310 lost connection
    2011-02-23 18:18:29 [SEVERE] [Netstats]: Could not set data for com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    2011-02-23 18:19:06 [SEVERE] [Netstats]: Could not set data for com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    
    What can i do and why do i get this error?

    Thank you.
     
  25. Offline

    Valrix

    What's your craftbukkit version?
    --- merged: Feb 24, 2011 1:37 AM ---
    I've updated the build number recommended in order to use all my plugins. They've all been tested against the newest recommended build 432 and work perfectly fine. I will also test against more recent builds to see if I can catch problems and fix them before they happen. But since I can't really foresee which build will be the next recommended one, I can't really make any promises.
     
  26. Offline

    Pyroking

    Code:
    This server is running Craftbukkit version git-Bukkit-0.0.0-447-g84246c4-b428jnks (MC: 1.3)
    This should be the newest right? :)
     
  27. Offline

    Valrix

    Well, you don't want to use the newest, you'll want to use 432 which is git-Bukkit-0.0.0-450-gd3c1ba4-b432jnks. This is the only one I know for sure works without problems. If you get it to work in other builds then more power to you.
     
  28. Offline

    Pyroking

    now i get this error.


    Code:
    2011-02-24 20:03:32 [SEVERE] [Netstats]: Could not set data for java.sql.SQLException: invalid database address: jdbc:mysql://localhost/minecraft
    
    I dont understand why i get this error.
     
  29. Offline

    Valrix

    That would mean it can't find the database you're trying to save data to.
     
  30. Offline

    Pyroking

    Yes, but how can that be? "jdbc:mysql://localhost/minecraft" should be right... hmmm.
     
  31. Offline

    Valrix

    You're sure MySQL is running and that you have proper permissions and everything?
     

Share This Page