OnlineUsers

Note: the original plugin and almost all of the work done on it is by croemmich. He doesn't have the time to work it any more, so he's allowed me to maintain it.


OnlineUsers is a simple plugin that maintains a flatfile or MySQL table with logged in users. Make sure to install the MySQL JDBC driver if you choose to use MySQL. You can obtain it from here: http://www.mysql.com/downloads/connector/j/
You can simply drop it in your server root folder, alongside the CraftBukkit jar. It will need to be named mysql-connector-java-bin.jar. Alternately, if you know how, you should be able to include it in your Java path.


online-users.properties

  • destination=mysql #[mysql|flatfile]
  • flatfile=online_users.txt #location of the flatfile to write
  • flatfile-template=online_users.template #template used for creating the flatfile
  • flatfile-data=online_users.data #data used to fill the flatfile
  • remove-offline-users=true #Set to false to keep users in table when logged off.
  • db=jdbc\:mysql\:localhost\:3306/minecraft
  • user=root
  • table=users_online#Will be created for you when the plugin is enabled
  • pass=root



Note that the new `time_total` column is only updated when players disconnect. So, if a player is currently connected, that column won't account for the additional time they've been online in their current session. If you want to get a fully up-to-date value for how long they've been online, you can account for it in your query.
For example, this query would give you the up-to-date value as `current_time_total`:

SELECT *, IF(`online`=1, `time_total` + TIMESTAMPDIFF(SECOND, `time`, NOW()), `time_total`) AS `current_time_total` FROM `users_online`


If you're using an older release that 1.6.2, the query would instead look like this due to the different data type for `time_total`:

SELECT *, IF(`online`=1, ADDTIME(`time_total`, TIMEDIFF(NOW(),  `time`)), `time_total`) AS `current_time_total` FROM  `users_online`


An example PHP script to read from file output from this plugin can be found here.


Changelog

  • 1.8.0 - Player UUID is now tracked in database and used as unique key, with the player's name updated at each login in case it has changed, so that time online is properly attached to unique player account rather than (soon to be) non-unique player name. dl
  • 1.7.0 - Major efficiency boost by running a separate async task thread to handle adding/removing players from the database or flatfile. Previously this was handled entirely in the player join and quit listeners, thus holding up the main server thread for however long it took. dl
  • 1.6.3 - Fix for newly created MySQL database tables missing the 'online' column; thanks to AxxiD for pointing it out. MySQL tables which are missing that column will retroactively have it added. dl
  • 1.6.2 - IMPORTANT: BREAKING CHANGE for MySQL users: For MySQL data storage, time_total column type is changed from TIME to INT (read notes here) dl
  • 1.6.1 - Primarily a compatibility release to support the upcoming CB 1.1-R5 and above. Update to use the new Bukkit event system. Fix for timestamps showing 12-based hour instead of 24-based as it was supposed to be. Removed the plugin's "loading" and "shutting down" log messages since Bukkit now handles those itself. dl
  • 1.6 - added new database column `time_total` to track how long a player has spent on your server (MySQL only). dl
  • 1.5.5 - fix for {longtime} and {shorttime} (in flatfile template) both outputting the same thing. dl
  • 1.5.4 - Brettflan is now the owner. Updated for 612+ dl
  • 1.5 - Fix MySQL issues. Move OnlineUsers directory to plugins. dl
  • 1.4 - Initial Release dl



Source - https://github.com/Brettflan/OnlineUsers



If you appreciate this plugin, you are welcome to https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif.

Download

File Name Status Version Downloads Date
OnlineUsers 1.20.2 Updating 1.20.2 Updating Updating
OnlineUsers 1.20.1 Updating 1.20.1 Updating Updating
OnlineUsers 1.20 Updating 1.20 Updating Updating
OnlineUsers 1.19.2 Updating 1.19.2 Updating Updating
OnlineUsers 1.19.1 Updating 1.19.1 Updating Updating
OnlineUsers 1.19 Updating 1.19 Updating Updating
OnlineUsers 1.18 Updating 1.18 Updating Updating
OnlineUsers 1.17.1 Updating 1.17.1 Updating Updating
OnlineUsers Forge Updating Forge Updating Updating
OnlineUsers Fabric Updating Fabric Updating Updating
OnlineUsers
OnlineUsers

Dear youtuber!
Have you a channel youtube and want to bring your Video to quality visitors?
Do you want your video to appear on our website?
Do you want to become partner with us?
Just 3 steps to become our partner:
Step 1: Make video review for mods, addons, plugins, ... which you like
Step 2: Upload this video to youtube and our link to your video description
Step 3: Send the youtube video link via message to http://fb.com/9lifehack or leave a comment in the post. We will add your video in the our post, it will help you have more view.
JOIN to get more youtube view with us!!!!

Related Posts

Smarty Productivity Happiness

9LifeHack.com - make things smart