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

    Letalis

    Valrix: I can tell you that it now works like a charm on Windows 7 & Windows 2008 R2.
    No more file not found...

    Thanks for a great Plugin
     
  3. Offline

    Valrix

    Yeah, this was done as a "catch" for if the server crashed and you start it up again it marks all players as offline. I'll have to also include a check that gets a list of all online players and changes their status back to being online or if there's a way to tell when the server reloads compared to starting up naturally I can only tell it to change everyone's status to offline if it's starting up and not when reloading. Thanks for catching that, I'll fix that today.

    Glad you like it ^^

    Very good, I had it do a bunch of checks and added a few functions to convert any paths to ones that'll work for that system, no more guessing and doing changes based on the OS, it'll "just work".

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

    firewalled

    Sounds great with the off/online fix. No hurries, I have some other backup plugin that breaks upon reloads as it seems.
    Anyways, maybe you can add a third download link to the main thread clearly marked as beta, so you can always get that for the most recent one. Not sure right now, if beta is the same as the normal 3.6 download or not.
     
  5. Offline

    Valrix

    I tend to delete the beta file after releasing the newest official one until I have a new beta for people to test that way nobody can accidentally grab a broken beta or something. But as I build beta versions I will have them there for people to grab and test and I always make sure to announce when I have a beta available for testing. If anything I can have the link there but have it deactivated when there's no beta available.

    EDIT: First, however, I need to make sure everything works with the newest RB which I shall do now.
     
  6. Offline

    Letalis

    Hi Fizi. How to get this to work on windows?
    Not that good att PHP so I cant get it to find the folders :-/
     
  7. Offline

    Valrix

    Just grab the newest version. Everything has been fixed now. :)
     
  8. Offline

    Zyferus

    Code:
    03:25:11 [INFO] [Netstats]: Couldn't find database connector. Downloading now...
    03:25:12 [INFO] [Netstats]: Done downloading connector.
    03:25:12 [SEVERE] [Netstats]: Database connector wasn't found. Make sure it's in your /lib/ folder.
    03:25:12 [SEVERE] [Netstats]: Database connector wasn't found. Make sure it's in your /lib/ folder.
    03:25:12 [SEVERE] [Netstats]: Database connector wasn't found. Make sure it's in your /lib/ folder.
    03:25:12 [SEVERE] [Netstats]: Database connector wasn't found. Make sure it's in your /lib/ folder.
    03:25:12 [SEVERE] BLOCK_PLACE loading Netstats v3.7 (Is it up to date?)
    java.lang.NoSuchFieldError: BLOCK_PLACE
            at com.sparkedia.valrix.Netstats.Netstats.onEnable(Netstats.java:200)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:83)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
    There was no /lib/ created that I can find. there was no log generated. It did create a Netstats dir, that had /logs/ and /players/ and the config.txt.

    Update: I did find the /lib/ in the game root, but it is empty.
     
  9. Offline

    Valrix

    It could have had an issue creating the /lib/ folder, in that case try making one yourself in the same folder as the server .jar file and that should fix it. I'll double-check the code that makes the /lib/ folder to see if I messed something up when improving the code.
     
  10. Offline

    Zyferus

    I did find it had created the /lib/ dir but there was/is nothing in it.
     
  11. Offline

    Valrix

    Well that's weird...I'll have to check on that then. Anyway, here's the link to download the connector yourself, just put it in the /lib/ folder and everything will be fine. JDBC Connector
     
  12. Offline

    Zyferus

    Yes it created the database, but i still get this:

    Code:
    04:21:33 [SEVERE] BLOCK_PLACE loading Netstats v3.7 (Is it up to date?)
    java.lang.NoSuchFieldError: BLOCK_PLACE
            at com.sparkedia.valrix.Netstats.Netstats.onEnable(Netstats.java:200)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:83)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
     
  13. Offline

    Valrix

    What version of CraftBukkit are you running?
     
  14. Offline

    Zyferus

    I downloaded it not long ago:
    This server is running Craftbukkit version git-Bukkit-0.0.0-516-gdf87bb3-b531jnks (MC: 1.3)
     
  15. Offline

    Valrix

    "b531jnks" = beta 531 jenkins

    You're running build #531, and you're trying to use the 602 specific build of Netstats which won't work. you'll need to use the 527-556 build I have in the downloads section or update your CraftBukkit to 602.
     
  16. Offline

    Zyferus

    ahh, ty
     
  17. Offline

    Valrix

    Welcome.
     
  18. Offline

    ksevelyar

     
  19. Offline

    Valrix

    Bah, I'll fix that. One minute.

    EDIT: Fixed.
     
  20. Offline

    IndianaX

    Do you user Flatfile and Database at once???
    I have now both but the flatfiles are stored in the wrong location! (there ist a / missed after players)
     
  21. Offline

    Letalis

    I thought that this one displayed everything a little bit nicer than the page that was included in the webpackage.

    Thats why I asked about it.
    Need to get myself some PHP skills so I can make a nicer display page.
     
  22. Offline

    Luis

    hi i just noticed something weird on my netstats table, it does not record any value for distance,mobskilled,join date, playerkilled.
    i have cb 556 and netstats 3.8
    everything else works great since version 1 :)
     
  23. Offline

    Valrix

    Yeah, it uses flatfiles as temp storage to quickly keep track then stores all that to a database either after a certain number of actions or a set amount of time. The latest version fixes the weird file creation bug.

    Yeah, the web part is still being worked on, but don't worry all those stats are being tracked and the web part will not affect the stats in any way.

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

    WhoCarrot

    Could you make a feature you can see your stats like ingame?
     
  25. Offline

    Valrix

    Depends on how you'd like to see them. What do you suggest?
     
  26. Offline

    firewalled

    I have a problem with the total play time keeps resetting. Last seen/login seems fine. Blocks etc also seems to stay as supposed to.
    I have no idea when it resets, what causes it, but it can go up to 1-2 days or so, and suddenly it is like x hour or something like that. I have only 4 users on my server, my play time seems correct, while the other have less than 7 hours. I recall they had atleast 1½ day a few days ago.

    I am still using 556 bukkit and 3.7, but you haven't mentioned anything about that problem, so I assume it is not fixed.
    Am I the only one with this problem?
     
  27. Offline

    Valrix

    I think that may have been fixed in 3.8 maybe. I'll have to check the commits to make sure.
     
  28. Offline

    WhoCarrot

    you type: /statsme
    and you will see:
    your dmg done like "Damage done: 5083"
    and hours played and stuff down here :)

    and you can also type: /statsnotch
    and you will see the stats of notch (or /stats notch maybe that is more handy)
     
  29. Offline

    Valrix

    Hmm, sounds pretty cool. Sadly, I'm afraid Netstats may die soon due to Notch's stats and achievements tracker that'll be added in at the next update, which can possibly be soon. Plus, by the sound of it, his will be more advanced. Though sad for Netstats, it'll mean more work on my other plugins and coming up with new ones.
     
  30. Offline

    firewalled

    3.8 is b602 only, doesn't work for 556? I have read there's several plugins that might not work for 602 yet, so I would prefer to stay on that for a while yet.
    Anyways, I just took the newest 556 version you have. I'll see how that works out.

    Will his stuff be web based or only ingame?
     
  31. Offline

    Valrix

    The 556 version is still up there for you to use, and we don't really know yet. That's why there's still a chance Netstats will live on. But as of now I'm sorta losing faith.
     

Share This Page