[MISC] PlayerCount v1.3 - Writes online players in a file! [740]

Discussion in 'Inactive/Unsupported Plugins' started by robin0van0der0v, Mar 13, 2011.

  1. Offline

    robin0van0der0v

    PlayerCount - Writes online players in a file!
    Version: v1.3

    Features:
    • Writes the player count to: Plugins/PlayerCount/PlayerCount.dat.
    • Writes online players to: Plugins/PlayerCount/OnlinePlayers.dat.
    Download PlayerCount!
    Source is inside the jar file.

    Known bugs:
    None. :D

    Changelog:
    Version 1.0
    • Release.
    Version 1.1
    • Changed namespace.
    Version 1.2
    • Works in Beta 1.4.
    Version 1.3
    • Fixed disconnect-event.
     
    ViZiT and fneyret like this.
  2. Offline

    BlueFireGaming

    Nice, like it! [​IMG]
     
  3. Offline

    robin0van0der0v

    Thanks. :)
     
  4. Offline

    gamerluke

    Why would this be needed?,
    Just type /players

    ... If it showed how long each user has been playing the server for Total and Session
     
  5. Offline

    robin0van0der0v

    But you can't use '/players' on an website to show the online players. ;)
     
  6. Offline

    tenach

    What if a server doesn't have a plugin that enables /players? There's always /list, but that doesn't tell you the number of players currently on.

    I like this plugin, it's simple and enables me to show # of players online on my website. :)
     
  7. Offline

    fneyret

    Thank you :)
     
  8. Offline

    squirrelo

    Any way to get this to write anywhere as opposed to the plugins folder? I have the server on a separate hard drive than the website and would like to read the files from the web space.
     
  9. Offline

    robin0van0der0v

    Try this. :)
    PHP:
    <?php

    echo file_get_contents("C://minecraft_server/Plugins/PlayerCount/PlayerCount.dat"); // Change this path. ;)

    ?>
     
  10. Offline

    oleerik

    Lovely plugin!
    I have one more idea to make it perfect. Make it update a file called serverstatus.cat and update it with 1/true every 5 minutes the server is up. and 0/false when it is stopped correctly.
    That way I could easily make a script that checks if the server have crashed by checking the file edit time.

    EDIT:
    Or, for the matter of the simplicity of the plugin you could release a new one doing that? SimpleStatus :p
     
  11. Offline

    robin0van0der0v

    You can better write a script that checks the port. ;)

    In PHP like this:
    PHP:
    $fp = @fsockopen("localhost",25565,$errno,$errstr,1);
    if(
    $fp)
    {
        
    $status true;
    }
    else
    {
        
    $status false;
    }
     
  12. Offline

    shadrxninga

    Do you think you will add mysql support for people you do not have their webserver and gameserver on the same box?
     
  13. Offline

    robin0van0der0v

    Maybe later...
    I don't know how to acces a MySQL-database with Java. :p
     
  14. Offline

    oleerik

    Thanks robin! Have I ever told you that I love you? :D
     
  15. Offline

    ziggo0

    Hey - this plugin completes my server like no other, thanks a lot. You can view it on the main page here: http://www.idenvale.net/.

    I used a symbolic link from where they are located to a public space on the webserver and simply used php to display it's contents.
     
  16. Offline

    fneyret

    They tell me to nag, so I nag ;)
    Code:
    [SEVERE] Nag author: 'robin0van0der0v' of 'PlayerCount' about the following: onPlayerJoin has been replaced with a new signature, (PlayerJoinEvent)
    Great plugin anyway !

    EDIT : build 617, PlayerCount 1.1
     
  17. Offline

    robin0van0der0v

  18. Offline

    fneyret

    Perfect! Thank you :D
     
  19. Offline

    BasBloem

    You could do an HTTP request including the number of players, and then make it write to the database using PHP.
     
  20. Offline

    MathijsNL

    This plugin is really nice, it gives yet another thing to put on your website. I have one request though. Could you make a config file for this plugin, where the default folder is your plugin/playercount/ folder, but where you can add another path if desired (i would like to write the files to my www folder so i dont have to put a link to my minecraft folder in the php script).

    Off topic: If this is not possible, can someone please tell me wich program you use to compile the .java source to a .class again, since i cant get it done with jEdit and i cant really find any other progries on the internet :)
     
  21. Offline

    MathijsNL

    I think there is some kind of bug in this plugin. Is it possible that when the last player logs out, the file doesnt get updated? This leaves always 1 player in the file. Reloading the server fixes this.
     
  22. Offline

    q-sens

    Hello!
    I'm using this plugin too and it's very nice and useful!
    Unfortunately i'm having the same problem as MathijsNL.

    Robin0van0der0v if you're still around, could you kindly have a look to this issue please?

    Thank you so much!

    Q-SeNs.

    My website, using the PlayerCount plugin: www.waron.net (see the Minecraft block on the left side).
     
  23. Offline

    maelwedd

    I am having the same problem with regards to not removing the last player. It's becoming a nuisance. It worked fine until I upgraded the server to 1.4 (and the plugin to 1.3).

    Anyone have any ideas how to fix this?
     
  24. Offline

    CJS2008

    I am also having the same problem but only since i updated the plugin.
     
  25. Offline

    robin0van0der0v

    I'm trying to fix this, but I don't know why this happens. :(
     
  26. Offline

    maelwedd

    Me and a friend was looking at your source, and could it be that when there's no one on the server, the return value for getOnlinePlayers() is null? If so, that's your problem right there. If not, it's to long since I wrote Java for me to help more I think...
     
  27. Offline

    fneyret

    FYI I don't have this problem with CB617. Bad interaction between plugins?
     
  28. Offline

    Connor Griffin

    Thanks, this works perfectly for a widget on our website. We had been using some modified code an MCStats page, but this is much better.
     
  29. Offline

    kankan_01

    Thanks, but I've a strange problem with this plugin with build 670. When the last player disconnecting, the files are not updated (OnlinePlayers.dat have the last nick, and /PlayerCount.dat remain to 1).
     
  30. Offline

    woodzy

    maby u could add a command like /who and /list and /players and have it be global?
    you know to see the players list?
     

Share This Page