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

    Yeah, I've already added the fix and I'm working on some code to improve database usage a bit and cut down on some code. I also have some other ideas to make the stats look a bit better, but some I don't think are possible yet. If so then I'll add them in.
     
  3. Offline

    Lord Chaos

    I'll definitely donate again once I get this to work, but so far I can't get the remote web server to connect to the database server, but this is not a problem with this mod, none of the mods can do that sadly :(

    Some cool stats to add:
    How much coal mined
    How much Iron mined
    How much Gold mined
    How much Diamond mined
    How much Redstone mined
    How much Obsidian mined

    And such. :)
     
  4. Offline

    firewalled

    I think there's certain limitations of what bukkit provides to a plugin if I understand correct, but yer, something of the above I'd see included as well, the more the marrier.

    Maybe it is firewalled or if you get an access error, maybe your user has only 'localhost' allowed, not remote hosts.
    I have configured Netstats to use my webservers MySQL database as I don't have a database on the same server as bukkit. That works fine.
     
  5. Offline

    IndianaX

    I use the BigBrother Database for this informations.
     
  6. Offline

    FiZi

    Nice.
     
  7. Offline

    Valrix

    Looking good! The new stuff will hopefully be in by today, but I've been busy since I've been home. Family wants to have "quality time" -_- But don't worry, I'll get more done. I've been trying to get the database improvements done since those are what cost the most resources. Once those are good then everything else will be a breeze.
     
  8. Offline

    G1R Productions

    19:14:57 [SEVERE] [Netstats]: Couldn't find file plugins/Netstats/config.txt
    java.io.FileNotFoundException: plugins/Netstats/config.txt (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
    at java.io.FileWriter.<init>(FileWriter.java:46)
    at com.sparkedia.valrix.Netstats.Property.save(Property.java:74)
    at com.sparkedia.valrix.Netstats.Property.<init>(Property.java:34)
    at com.sparkedia.valrix.Netstats.Netstats.onEnable(Netstats.java:44)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:453)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:92)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:70)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:203)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:190)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:130)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:245)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
     
  9. Offline

    Valrix

    Make sure you have the right permissions set up for the directory. That's the only reason you should get that error. At least as far as I know.
     
  10. this plugin is so cool! I use it now for one month and the developping is very fast ;)
    I hope, this will go on in the Future!
    Maybe you could add a .js to the web interface, wo sort the table^^
    would be great :D

    greetings
    Chriss
     
  11. Offline

    firewalled

    I assumed the web interface was only provided as an example how to use the data?
    So people can somewhat copy that code if they want, and include it on their website in their current design.
     
  12. Offline

    BacaBej

    Hi,
    you can easily sort the data via SQL:
    PHP:
    $sql "SELECT * FROM [table] ORDER BY <field_name>";
     
  13. Offline

    Runelynx

    How did you fix it? i have the same problem !
     
  14. Offline

    Valrix

    Once I get the Java part done so the tracking is all good then I'll be helping @amd3th with the PHP since there are going to be some advanced additions to it and I'll try to include an already-styled page for those who don't plan on just inserting it into an already-existing page. Give me some time though, I'm still a bit swamped with personal stuff. However, I can safely say I'm making progress to make things nice and dynamic for everyone along with a lot of changes to improve speed.

    Woo! There we go, just updated the files with all the new updates. Check out the changelog if you haven't been watching the "planned" section during the past week. Enjoy!

    PS: Notice that there's no .sql file? It's because you don't need them anymore! I'm having the plugin auto-update your database as it needs to so you won't have to! It took a bit of work to get this to work, but now it's made things a lot easier for all of us.

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

    DerManuel

    I got the following error in Version 3.3 (3.2 worked great):
    2011-03-26 12:32:01 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'seen=1301139121628, total=86005373 WHERE player='playername'' at line 1

    (with MySql Server ver. 5.1)
     
  16. Mob Kills and Player kills are not updating other than that its all good
     
  17. Offline

    Kossusukka

    Yep, i noticed that too. Fields mobskilled and playerskilled aren't updating, even through logging them are enabled in config. But overall, this plugin really kicks ass! I just love it! Its perfect addition to my minecraft-servers website and MySQL support makes it very easy to use with PHP. :)
     
  18. mobskilled int(11)
    playerskilled int(11)

    is that right? or should this be an other type?

    greetings
    Chriss
     
  19. Offline

    godgodgodgo

    Hey can you please upload a screenshot of how the stats are displayed. :) Thanks
     
  20. Offline

    Arzeus

    I am getting this same error also. I am using bukkit 556 and MySql 5.0.7
     
  21. i get the same error, only for the travel distance ;)
    I hope, this error will be fixed in the next version!

    greetings
    Chriss
     
  22. Offline

    ThaMunsta

    I have read a bunch of posts on here and am a bit confused. I have a brand new MySQL 5.0 DB but my download did not have a .sql file so right now I have no tables and I keep getting
    Code:
    Last packet sent to the server was 0 ms ago.
    21:12:25 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdb
    c.exceptions.jdbc4.CommunicationsException: Communications link failure
    What am I missing?
    Thanks
     
  23. Offline

    treepunch

    This is the error I'm receiving as well.
     
  24. Offline

    ThaMunsta

    I have a funny feeling this won't run on MySQL 5.0
    The get.php uses a command that's only for 5.1 +
     
  25. Offline

    treepunch

    I believe you're correct, I just checked mine and I'm on 5.0.91. Bummer! I was so excited for this.
     
  26. Offline

    Valrix

    Which command is it? I can try to find ways to get it to work with older version of MySQL, and I'm not sure why everyone's getting these errors. I just checked my MySQL version and I'm running 5.1.48, so that may be why I don't have the same problems. If anyone with an older version of it is able to help me find out what needs to be changed I'll happily fix these problems for you guys.

    If anyone is able to upgrade your MySQL version, that would fantastic, but for those who can't and think they can help, it would be VERY helpful for everyone. I'll also check up on the mob/player kill counter a bit more thoroughly to be sure it's not some small, stupid error I missed or something like that (which I'm sure it is and I'll /facepalm about it later).

    As usual, keep an eye out for my twitter since I'll announce any updates there first then will update everything else. Also, I don't have anything else planned for the next few days, so I'll be on a lot more and have much more time to do fixes and help you guys out as much as possible. The more of you who post logs and keep in contact with me, the faster I'll get these updates out and make sure everything works for everyone. I've put too much work into this to not have it work for at least 90% of you if not 100%.
     
  27. Offline

    Lord Chaos

    I upgraded from 3.2 to 3.3 and now I get this error every time people do anything:

    Code:
    2011-03-27 13:21:11 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'seen=1301224871572, total=44103575 WHERE player='SebastianSA'' at line 1
    It is just completely spamming now and I don't have the old 3.2 version to downgrade with. :/

    Code:
    2011-03-27 13:25:41 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'placed=placed+4, seen=1301225141622, total=35531049 WHERE player='RoyalBrownAle'' at line 1
    2011-03-27 13:25:41 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'placed=placed+4, seen=1301225141622, total=35531049 WHERE player='RoyalBrownAle'' at line 1
    2011-03-27 13:27:11 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'broken=broken+2, seen=1301225231572, total=35620999 WHERE player='RoyalBrownAle'' at line 1
    2011-03-27 13:27:11 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'broken=broken+2, seen=1301225231572, total=35620999 WHERE player='RoyalBrownAle'' at line 1
    2011-03-27 13:28:41 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'broken=broken+11, seen=1301225321572, total=35710999 WHERE player='RoyalBrownAle' at line 1
    2011-03-27 13:28:41 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'broken=broken+11, seen=1301225321572, total=35710999 WHERE player='RoyalBrownAle' at line 1
    2011-03-27 13:30:11 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'broken=broken+13, placed=placed+4, seen=1301225411622, total=35801049 WHERE play' at line 1
    2011-03-27 13:30:11 [SEVERE] [Netstats]: Could not set data, MySQL error for: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'broken=broken+13, placed=placed+4, seen=1301225411622, total=35801049 WHERE play' at line 1
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  28. Offline

    Kossusukka

    I'm running MySQL 5.1.49 and i don't have any errors, so the MySQL 5.0 might be reason for your errors?
    Only that ain't working is mobskilled and playerskilled counters, but they ain't giving any errors through.
     
  29. Offline

    Lord Chaos

    I am using MySQL 5.5 on Windows Server.
     

Share This Page