[Idea] web accessible user stats

Discussion in 'Archived: Plugin Requests' started by Thyme676, Jan 22, 2011.

  1. Offline

    Thyme676

    I've looked around in the forum and I haven't seen anything like what I am imagining, so I'll post it as an idea. I think it would be do-able to have some stats for a server, like online players, and maybe some others to put on a website.

    Unfortunately I don't have the coding skill to work on this :(
    Does anyone have any thoughts about it?
     
  2. Offline

    Demonofbirth

    It's possible. PHP
     
  3. Offline

    Thyme676

  4. Offline

    DerpinLlama

  5. Offline

    Thyme676

    Ok great! I'll work on a list of some stuff that I think would be great to have for a website.
     
  6. Offline

    Demonofbirth

    I'd like something that I can easily use that will allow me to add another page to my website and show the users on my server and other basic things. Something where I can just upload some files to a new directory in my website, change a few values and be basically done.
     
  7. Offline

    DerpinLlama

    Can be done. Will have to be more specific than 'other basic things' though.
     
  8. Offline

    Demonofbirth

    Just the basics as in if server is up, maybe also saying who the admins are.
     
  9. Offline

    DerpinLlama

    As there is no standard permissions system in Bukkit currently I have no plans to implement that.
    Obviously you will not be able to connect if the server is not up.
    I'll work on a PHP script for you, gimme ten minutes or so.

    Edit: Oh joy, the PHP encoding headache.
    2nd edit: I've just found out java uses UTF-16 encoding. -.-
     
  10. Offline

    Demonofbirth

    Oh lawl. Hey what about other stats like the most active people with how many hours they have been on and maybe the most said words or links. (or top mentioned usernames)
     
  11. Offline

    DerpinLlama

    Eh, that'd probably require recording join and disconnect messages, then calculating the amount of time they were online for and adding it to the time they already have stored in the database.

    Which I can do, but give me a few days to work it out fully. (I'm not quite sure how to use Java's MySQL stuff.)
     
  12. Offline

    Demonofbirth

    Yes I understand things take time. I have a few other ideas I will be getting to you.
     
  13. Offline

    DerpinLlama

    PHP:
    <?php
    $bukkit_host 
    "localhost";
    $bukkit_port 6790;
    $bukkit_password "password";

    $errn "";
    $errs "";
    $timeout 10;
    $sock fsockopen($bukkit_host$bukkit_port$errn$errs$timeout);
    if(
    $sock){
        echo 
    "Connected to Bukkit!\r\n";
        
    fgetc($sock);
        
    fgetc($sock);
        while(!
    feof($sock)){
            
    $line trim(mb_convert_encoding(fgets($sock4096), "ASCII"));
            if(
    $line != ""){
                echo 
    $line."\r\n";
                if(
    $line == "Welcome to Bukkit, please authenticate."){
                    
    writeToSocket("pass ".$bukkit_password$sock);
                }
            }
        }
    }
    else{
        echo 
    "Error: Could not connect to Bukkit! ".$errn." (".$errs.")";
    }

    function 
    writeToSocket($text$sock){
        
    fwrite($sock$text."\r\n");
        echo 
    $text."\r\n";
    }
    ?>
     
  14. Offline

    Demonofbirth

    Nice but how would I use that. (honestly I haven't even used bukkit yet as I was waiting for a full release) I also noticed you put port as 6790, why is that?
     
  15. Offline

    DerpinLlama

    Because port 6790 is the port my TCP interface plugin listens on by default.
     

Share This Page