[INFO] OnlineUsers 1.7.0 - logged users in a file/mysql [BukkitDev]

Discussion in 'Archived: Plugin Releases' started by Brettflan, Jan 17, 2011.

  1. Option to add last login (time and date) to the DB?
  2. That's what the "time" field should contain.
  3. Offline


    Can you make thet i can see in the database how many hours/minuts the player is online? (Sorry for my very bad english :p)
  4. A running total of how much time overall they've been online? Should be pretty simple. I'll see about adding a new field and tracking that when I have some spare time.
  5. Offline


    Thanks (A)
  6. Done, and released in 1.6 (see the first post).

    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`:
    Code (Text):
    1. SELECT *, IF(`online`=1, ADDTIME(`time_total`, TIMEDIFF(NOW(), `time`)), `time_total`) AS `current_time_total` FROM `users_online`
  7. Offline


    Changed thread title to remove 627-798. Dashes are not allowed.
  8. Offline


    Is there a plugin That Shows In the chat box if the player is new new
  9. "New" by what standards? I believe Essentials (possibly EssentialsChat or another subplugin) has an option to give a "welcome [player] to the server!" message the first time a player ever connects to the server.
  10. Offline


    I believe that you have this confused with something else. This plugin is for showing the users on a server in an SQL database. Not on the server. DURP

    Can someone help me? I currently use GoDaddy to host my website, and I'm trying to use PHP to list the OnlineUsers on a page for my site. This is my Configuration:
    Code (Text):
    2. #Minecraft Properties File
    3. #Sat Jun 18 21:56:52 EDT 2011
    4. flatfile=online_users.txt
    5. user=sinquillaou
    6. flatfile-data=online_users.data
    7. remove-offline-users=true
    8. flatfile-template=online_users.template
    9. destination=mysql
    10. pass=***************
    11. table=users_online
    12. db=jdbc\:mysql\://sinquillaou.db.7939212.hostedresource.com\:3306/sinquillaou
    And this is the error I get in my console when I try to run the server:

    Code (Text):
    2. 2011-06-18 22:24:13 [SEVERE] OnlineUsers: Communications link failure
    4. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    5. 2011-06-18 22:24:13 [SEVERE] Could not connect to the database. Check your credentials in online-users.settings
    6. 2011-06-18 22:24:13 [SEVERE] OnlineUsers: null
    7. 2011-06-18 22:24:13 [SEVERE] OnlineUsers: Could not init the datasource
    8. 2011-06-18 22:24:34 [SEVERE] OnlineUsers: Communications link failure
    10. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    11. 2011-06-18 22:24:34 [SEVERE] Could not connect to the database. Check your credentials in online-users.settings
    12. 2011-06-18 22:24:34 [SEVERE] OnlineUsers: null
    13. 2011-06-18 22:24:34 [SEVERE] OnlineUsers: could not execute the sql "UPDATE `users_online` SET `time_total` = IF(`online`=1, ADDTIME(`time_total`, TIMEDIFF(NOW(), `time`)), `time_total`), `online`=0"
    14. 2011-06-18 22:24:55 [SEVERE] OnlineUsers: Communications link failure
    16. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    17. 2011-06-18 22:24:55 [SEVERE] Could not connect to the database. Check your credentials in online-users.settings
    18. 2011-06-18 22:24:55 [SEVERE] OnlineUsers: null
    19. 2011-06-18 22:24:55 [SEVERE] OnlineUsers: could not execute the sql "TRUNCATE `users_online`"
    20. 2011-06-18 22:24:55 [INFO] OnlineUsers 1.6 disabled
    LATER EDIT: The host is a GoDaddy SQL host server.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 6, 2016
  11. Assuming your database name is correct ("sinquillaou"), do you have the mysql-connector-java-bin.jar file in your root minecraft server folder alongside the craftbukkit JAR?
  12. Offline


    No I don't... where would I download that?

    EDIT: Got it... same problem.
  13. Offline


    I know That this isnt For In game Server But I just wna Know does anybody Know of A Plugin that showes If a player is new.Also I need help with my Permissions.Its a long file and if u can help conact 'mbk.elite' on skype.
  14. Offline


    Please don't post your tech support questions on this guys Forum thread. But I can help... I'm BFitz937 on Skype.
  15. Offline


    Hey i got one problem:
    I got AuthDB so every User has to register...But your plugin wants to INSERT INTO the table...the problem is that the field 'password' cannot be NULL so your plugin doesnt work then...could you make an option to change it to just update but only if there is an field with the name of the user there?
  16. Offline


    I still need help...
  17. Did you rename it to match the filename I gave? If it's not named exactly right and located in the correct folder (alongside the main CraftBukkit JAR), the plugin won't find it. If you have it located and named correctly and are getting the exact same error message, I have no idea what might cause it.

    You're having two plugins share the same table for data? I can definitely see that as causing problems. Why not simply keep them in their own separate tables and use a LEFT JOIN or similar?
    OnlineUsers already does an ON DUPLICATE KEY UPDATE for the INSERT statement, by the way. You might check whether you've changed the "remove-offline-users=true" option in the online_users.settings file.
  18. Offline


    AuthDB just accesses the table if somebody login and then i just reads. The main problem is, that OnlineUsers gets an Query error because it tries to INSERT and then ON DUPLICATE KEY UPDATE..but it fails because the field password is empty so it cant check if the users exists or not
  19. Either way, the best method would be to have them use separate tables and use a JOIN of some sort when getting the data. No possibility for table structure conflicts that way.
  20. Offline


    I already edit the source but i'm too stupid to compile it -.-" okay but thanks
  21. Offline


    The plugin works fine for me 'as-is' on Minecraft 1.7.2 / CB 953.
  22. Offline

    Max Black

    Same with Toxik, also wanted to say this is a great plugin, really helps with the site currently online section ;)
  23. Offline


    Just what I was looking for. :cool:

    Wrote a little function in PHP for this plugin incase anyone wants to use it on their website.

    1. <?php
    2. function onlineUsers() {
    4.   $path = 'C:\path\to\plugins\OnlineUsers\online_users.txt';
    5.   $handle = fopen($path, "r"); $contents = fread($handle, filesize($path)); fclose($handle);
    7.   $contents = explode("\n", $contents);
    9.   $start = 0;
    11.   $count = count($contents) - 2;
    13.   $ONLINE['COUNT'] = $count;
    15.   foreach($contents as $content) {
    16.     if($start != 0) {
    17.       $user = explode(' ', $content);
    18.       $ONLINE['USERS'] .= $user[0];
    19.       if($start < $count) {
    20.         $ONLINE['USERS'] .= ', ';
    21.       }
    22.     }
    23.     $start++;
    24.   }
    26.   return $ONLINE;
    28. }  
  24. Offline


    Possible addition, that ability to whitelist certain names and hide it from the online list and updating in the mysql. I realize this can be done with PHP, however it would be nice if it was concatenated easier.
  25. It could be done, but I doubt I'll have time for it, honestly. The source is available on GitHub and pull requests are accepted, though, so other are welcome to implement it.
  26. Offline


    Hi Brettflan,
    Why you use "hh" in {shorttime} insted of "HH". The 24h clock is more accurate ;)
    Could you change it?

    P.S. Or add {health}, {iteminhand} ???
  27. 1. Beats me, I haven't touched that part of the code and don't even personally use anything beyond a basic list of online users. I see what you're saying, though, especially since it doesn't even display AM/PM, and I agree it needs to be fixed.

    2. Those would require much more constant monitoring, where the plugin currently only does anything at all when users join or leave the server.
  28. Offline


    I would like to give this a try. Could you update the download link? it is down atm
  29. It's back up now.
  30. Offline


    I have installed the plugin for my server and it works but there is no mysql database addet.
    Does it work with the www - mysql-database or any other database?
    if it works with another database how i can change it for my www database?
    So i would like give out the datas via php and mysql...
    Or have i add the database in phpmyadmin?
    witch structure the database is need if i have to add it?
    sorry for my bad english ;)

Share This Page