[INFO/WEB] InfoApi v0.2 - a simple API for your Bukkit Server [1060]

Discussion in 'Inactive/Unsupported Plugins' started by Seta, Aug 15, 2011.

  1. Offline

    Seta

    InfoApi V 0.2

    Info Api provides a simple API for youre Bukkit Server. There may already plugins out there doing that. But this is mine, and because it works great i share it ;)

    Use this Version: http://dev.bukkit.org/server-mods/infoapi/ by Janka
    Possible Api Querys:
    The Player Query only Works with Online Players! It returns as:
    each request needs its secret key at the end like:
    http://server:25577/version?secret

    Download Fork me @ Github Nice PHP Script by @Janka

    Config File
    Example Usage PHP
    PHP:
    $apiurl "http://server:25577/onlineplayer"
    $ch curl_init();
    curl_setopt($chCURLOPT_URL$apiurl);
    curl_setopt($chCURLOPT_HEADER1);
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
    curl_setopt($chCURLOPT_TIMEOUT1000);
    $onlineplayer curl_exec($ch);
    echo 
    $onlineplayer;
    Please note: If the Query is wrong, or the Server cant Handle it, it will appear as "not found website". Also this Plugin will give an Error if you do /reload, because the API Server CAN'T get reloaded at the moment. Thats not really an problem, but you should know. Also there can be an Error on Shutdown... im sorry about that

    If somebody knows how i could convert Minecraft Time to real time, please say ;)

    Changelog
    • V 0.2 - added some functions (cpu/ram/player/chat/kick) & small fixes
    • V 0.1 - releasing this plugin
     
  2. Offline

    Mihahail

    We are talking about first.
    I switched charset(UTF-8\16,win1250\1251 and others...) - no result.
    I don't use htmlentities, my code is:
    Code:
    $apiurl = "http://******.net:25577/chat?if49dkcm";
    curl_setopt($ch, CURLOPT_URL, $apiurl);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 1000);
    $res = curl_exec($ch);
    echo $res;
    
    php-charset is utf-8, browser-charset too.
     
  3. My last guess is to use something like this on your code:

    PHP:
    $res curl_exec($ch);

    // Convert String from whatever it is to UTF-8
    $resUTF iconv(mb_detect_encoding($res), "UTF-8"$res);

    echo 
    $resUTF;
    If that doesn't work I am at loss :/ Also i didn't test this Code but it should work.
     
  4. Offline

    Mihahail

    Good idea, but it doesn't work again :(
     
  5. Offline

    Tealk

    hi anyone know how i seperate this
    "git-Bukkit-0.0.0-980-g4ed23b1-b1060jnks (MC: 1.7.3)"
    to
    "1060" and "1.7.3"
     
  6. substr is your Friend :) You can download the PHP Script Zip from the first Post there you can see how I cut the String to Bukkit-0.0.0-980 (MC: 1.7.3)
     
  7. Offline

    Mihahail

    Does it works with craftbukkit 1000?
    May be solution of all my problems 1000 -> 1060? =)
     
  8. This Plugin does only rely on Basic Commands present since the First Release :)
    So there shouldn't be any differences between 1000 or 1060. But you could try it?
    I will try to implement the Chat Log as fast as Possible and test it for Cyrillic Characters.
     
  9. Offline

    Tealk

    thanks
     
  10. Offline

    Mihahail

    Okey, while you work, I will use JSONAPI for my modest purposes. )
    If it possible, put sources to .jar in next release, please.
     
  11. Offline

    Seta

    Wow here finally people talking in this threat ^^

    You realized the problems with my release, i realized them too, but much to late ... i mostly tested them in the browser... and like you checked, it works there (mostly).

    This nice guy, Janka, fixed it.
    He seems much more skilled in this stuff. I really respekt him for this stable release.
     
  12. Offline

    Mihahail

    But it so easy!
    In Minecraft time 24000 "ticks". so in 1 hour 1000 "ticks". Also you must understand, this "seconds" and "ticks" are unreal.
    simply remeber: 00000=06 : 00
    So,
    xxyyy = (xx+6) hours and (60*yyy/1000) minutes.
    ;)
     
  13. Offline

    Seta

    THIS is the point i didnt figure out :D thx
     
  14. Offline

    Mihahail

    When will be a new version? :)
     
  15. Offline

    Dec64

    installed, plugin loads fine, but when doing http://94.23.251.27:8085/version?xxxxxx in my browser it tells me its not configured, the plugin at first had issues using the default port, thats why i took it down to 8085.

    Anything obvious i am missing here?
     


  16. Thanks for the Kudos :) I seem to be good at Reverse Engineering and Reworking Code but I'm kinda slow when It comes to Implement to (or Come up with) New Features :) So I am Honored for getting the Chance to Help you out :)


    Hmm, that's Strange. It should only return "Not Configured" if you asked for a Command that is in Fact not Configured :/ I will look into that. Maybe I missed something.

    Your Issue with the Standard Port is something I can't help about :/ I can simply guess which Port would be not used by anything around an Standard Server and Bukkit Server. 8085 seems Strangly familiar but it's nothing I could point my finger at.

    Hopefully tonight :) or better: tomorrow morning (2~3am my time)

    EDIT
    Version 0.3.1 is now available and should provide every Command the Initial Release had.
    Looks for it here: InfoApi on bukkitdev
     
  17. Offline

    MCTSS

    Dont see what this does.......
     
  18. TL;DR:
    Query Information about your Minecraft Server like Versionnumber and Overall Status (Running / Not Running) through standard HTTP Request. Means you can check if your server is running from every Internet enabled Device. EVERY DEVICE!
     
  19. Offline

    Mihahail

    I think, you should do:
    onlineplayer -> count of players, gaming now
    playerlist -> player list
    Ofc, it possible to use PHP for counting.. but it is uncomfortable. =)
     
  20. :) I was wondering today at 2am what the difference between those commands is - now I got it. Thank you! :) Will change this for 0.3.2
     
  21. Offline

    Tealk

  22. Added new Version 0.3.2 staring Command tempc - Temperature on Spawnpoint in CelsiusĀ° :)

    Please use from now on bukkitdev to report Errors and comment on this Plugin because this Part of the Forum will be removed/disabled in the near future.
     
  23. Offline

    MrCPU

    Hi,
    I have a problem using this addon.
    It's working ok and I can get the infos, but on some commands especially "ram" the cpu usages goes up to 100% and stays there. If I try to stop the server there is no reaction or a very long time.

    Infos:
    Craftbukkit version git-Bukkit-1.0.1-R1-31-g3ac936b-b1709jnks (MC: 1.0.1) (Implementing API version 1.0.1-R2-SNAPSHOT)
    InfoApi version v0.3.4
     
  24. -> http://dev.bukkit.org/server-mods/infoapi/tickets/ ->
     

Share This Page