[DEV/WEB] WebSend v2.4 - Use PHP and other web-languages for bukkit! [1.4.7-R1.0]

Discussion in 'Archived: Plugin Releases' started by Waterflames, Jul 21, 2011.

  1. Offline

    Waterflames

    websend-icon-text-smaller.png

    WebSend - Use PHP for Bukkit!:
    Version: v2.3
    BukkitDev: http://dev.bukkit.org/server-mods/websend/
    What does this plugin do?
    A scheme:
    Ingame command -> Your php-enabled server
    -> Your PHP file does stuff and provides output/commands -> Plugin executes commands and prints output.
    Or:
    Webpage command -> bukkit server -> Plugin executes commands and prints output.

    Example scripts are provided in the files.
    !!! IMPORTANT NOTE !!!
    Use the bukkitDev forum for bugs, questions and other stuff. I will no longer respond here!

    A few of the possibilities:
    • Online adminstration screen
    • Online console
    • Membership system (become VIP with a donation)
    • Paypal donation system
    • ...
    Features:
    • Seperate thread (no server lag because of the wait.)
    • Commands (ingame or console emulation)
    • Command to color output send from php.
    • Secure connection (protected with password hash)
    • Permissions support (just "websend")
    • Both ways enabled (PHP -> bukkit | bukkit -> php (-> bukkit))
    Installation: (more detailed instructions can be found on bukkitdev):
    1. Put the plugin in the plugin folder.
    2. Start/reload server to allow the config file to be generated.
    3. Open the example php file and fill in your password.
    4. Upload the example php file to your server.
    5. Open the config file and fill in the settings.
    6. Reload server and test with "/ws timeset".
    7. Go to the bukkitDev page to find instructions to get started.
    Download on bukkitdev.

    Changelog:
    Show Spoiler

    For more changelog, visit the bukkitdev "files" section.
    Version 0.9:
    • Fixes false error reporting
    • A debug feature was added.
    Version 0.8.1:
    • Couple of small bugfixes for 1240
    Version 0.8:
    • Added error report on invalid /Command/
    • Added warning if the first line doesn't contain the password.
    • Added proper disabling code for ServerSocket.
    • Tweaked the variable checking.
    Version 0.7.1:
    • Added extra POST data. (Info)
    Version 0.7:
    • Enabled input from console
    • Implemented a config line to use a custom port.
    Version 0.6:
    • Added extra POST data. (Info)
    Version 0.5:
    • Added the other way (PHP -> bukkit) Port 4445 needs to be forwarded.
    • Improved config file reading
    • Optimized code structure.
    Version 0.4:
    • Added option to use port 4444 opposed to the default
    Version 0.3:
    • Added color feature. (examples in supplied zip.)
    • Added Console command option (Use /Command/ExecuteConsoleCommand)
    Version 0.2
    • Fixed permissions plugin absence error.
    Version 0.1
    • Plugin released
     

    Attached Files:

  2. Offline

    DutchCraft

    Loaded, Console command works. Now going to edit the script to whitelist a testuser.

    Edit: Works like a charm.

    Btw, Your plugins should have some more credits, options are endless with this!
     
  3. Offline

    Waterflames

    :D

    You could always put it in your signature.
     
  4. Offline

    nathanaelps

    I restarted everything, but it got more and more unstable. I'll dig through my other plugins, see if there's a funky interaction. I'll report back when I'm done.

    Show Spoiler

    Permissions (3.something)
    BananaLogArchiver
    BMR (BananaMapRender)
    BorderGuard (lite)
    CustomCrafting
    iConomy
    kFeatherTeleport
    LagMeter
    MCDocs
    MultiVerse
    obuJustShutTheHellUp
    OtherBlocks
    PTMBukkit (Phoenix Terrain Mod)
    RegionMarket
    Scavenger
    SignShop
    Websend
    WorldEdit
    WorldGuard


    Also, 'time day' must be Essentials, because I've got WE.
     
  5. Offline

    DutchCraft

    Make the link for me and i will :0

    Watch my Whitelist page in action:
    http://www.nedercraft.nl/whitelist/
     
  6. Offline

    Waterflames

    Cool!

    Either a normal link like Websend - Use php for minecraft!
    Code:
    [URL='http://forums.bukkit.org/threads/dev-web-websend-v0-5-use-php-and-other-web-languages-for-bukkit-1060.27463/']Websend - Use php for minecraft![/URL]
    OR[​IMG]
    Code:
    [URL='http://forums.bukkit.org/threads/dev-web-websend-v0-5-use-php-and-other-web-languages-for-bukkit-1060.27463'][IMG]http://forums.bukkit.org/attachments/websend-icon-text-smallest-png.6249/?temp_hash=fcc3feb73115c678b85f32ea5dc7b314[/IMG][/URL]
     

    Attached Files:

  7. Offline

    King_KYl3

    Can you say this could be used for donating, once some1 donates thouhgt your website and when the money goes thought into paypal it issues a command and ranks them up?
     
  8. Offline

    DutchCraft

    Possible yes, I have yet to figgure out on how to set this up with paypal, but for my Mollie (dutch payment trough Wallie, iDeal, Phone) it will be quite easy to do, i will only have to protect my uprank page so that the donator only can uprank one account after an payment.

    For paypal i guess this will be the same but with a different payment check listener script than my Mollie script.

    I have only started using this plugin since yesterday and i finished my automated whitelist. You can find a demo here: http://www.nedercraft.nl/whitelist/

    Ill post some more demo's once i am done using websend to fully automate my server, Think of a web profile where the donators can change their ingame name's but with a change limit per rank. After you used all your renames / or points you can no longer change your name again.
     
  9. Offline

    agronm

    Do i need any WEB software installed on my server to use it? For example xampp or wamp?
     
  10. Offline

    Waterflames

    To use this plugin? You need to be able to run php scripts on your server, thats all.
     
  11. Offline

    King_KYl3

    Mad can you try mad video :D thnaks Man
     
  12. Offline

    ReCreate

    How could it be possible to use this to upload server information to a php script? Like, player list/count, server uptime, etc? From what i understand, this doesn't seem to be possible. D:
     
  13. Offline

    Waterflames

    Not (yet).
    It all depends on what data should be available. If you say "Everything should be available on request!" then I say:
    Technicly: not extremely hard to implement.
    In reality: Large amount (And I mean a LARGE amount) of time required.

    However, if you make a list of the variables you need, I can implement them and let the list grow over time (I can add new variables when people need them.).

    BTW: the faster you can give me the list, the better since school starts here again in a couple of days.
     
  14. Offline

    albert

    Hi, what about running scripts when an event happens? When a player join for example, it would be nice to make motds.
     
  15. Offline

    Waterflames

    This can be done by installing rtriggers.
     
  16. Offline

    ReCreate

    Ok, player list(and optionally count), server uptime, the port that the server is running on, (minecraft)server memory usage and free memory, (minecraft)server CPU usage, number of plugins and list of installed plugins. That's all that i can think of that would be of use to me.
     
  17. Offline

    mineHAVOC

    is there a reason why in donationstep2.php there is the

    require "connect.php";

    what file is that? there isnt one in the download.
     
  18. Offline

    Jombi

    Just not working out for me. Here's my configs, and the setup I have.

    Config.txt:
    Code:
    #Configuration and settings file!
    #Help: URL: set to the full path of your server php file (see example).
    #Help: PASS: change the password to one of your choice (set the same in the server php file).
    URL=http://www.url.com/ExternalTimeSet.php
    PASS=password
    #Optional settings. Remove the '#' to use.
    #FORCEPORT=true
    #FILE=
    WEBLISTENER_ACTIVE=true
    #ALTPROTECTION=
    ExternalTimeSet.php:
    Code:
    <?php
         $HOST = "mc.server.ip.address"; //the ip of the bukkit server
         $password = "password";
         //Can't touch this:
         $sock = socket_create(AF_INET, SOCK_STREAM, 0)
         or die("error: could not create socket\n");
         $succ = socket_connect($sock, $HOST, 4445)
         or die("error: could not connect to host\n");
         //Authentification
         socket_write($sock, $command = md5($password)."<Password>", strlen($command) + 1)
         or die("error: failed to write to socket\n");
         //Begin custom code here.
         socket_write($sock, $command = "/Command/ExecuteConsoleCommand:time day;", strlen($command) + 1) //Writing text/command we want to send to the server
         or die("error: failed to write to socket\n");
         socket_write($sock, $command = "Time set to day;", strlen($command) + 1)
         or die("error: failed to write to socket\n");
         ?>
    My MC server is hosted by a game server provider, and my webhost is hosted by a ... webhost... . I've had them open 4445 UDP and TCP on the gameserver side. This is the current error I get:
    Code:
    2011-08-31 23:37:20 [SEVERE] null java.net.SocketException: Unexpected end of file from server 	at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source) 	at sun.net.www.http.HttpClient.parseHTTP(Unknown Source) 	at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source) 	at sun.net.www.http.HttpClient.parseHTTP(Unknown Source) 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) 	at websend.Communicator.sendPOST(Communicator.java:54) 	at websend.ComThread.run(Main.java:256) 2011-08-31 23:37:22 [SEVERE] null java.net.SocketException: Unexpected end of file from server 	at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source) 	at sun.net.www.http.HttpClient.parseHTTP(Unknown Source) 	at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source) 	at sun.net.www.http.HttpClient.parseHTTP(Unknown Source) 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) 	at websend.Communicator.sendPOST(Communicator.java:54) 	at websend.ComThread.run(Main.java:256)
    
    Problem is, that only happens when I try to execute /ws timeset or /ws. When I run the php script, nothing happens. It loads for a few seconds, then stops. No output. No errors. Nothing.

    The port to my MC server is 25571, could that influence it at all? Seeing as 25565 is the default, and "normal" MC port.

    Any help?
     
  19. Offline

    Waterflames

    No, leave it out.

    I will work on it ASAP.

    The URL setting is for bukkit -> php -> bukkit only.
    To enable php -> bukkit,
    WEBLISTENER_ACTIVE=true and a port forward is sufficient.


    That shouldn't make any difference.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  20. Offline

    Jombi

    Awesome, that seemed to work after I had my webhost open the port as well.
     
  21. Offline

    Waterflames

    Good :)
     
  22. Offline

    Waterflames

  23. Offline

    sourcemaker

    When will the source be available?
     
  24. Offline

    Waterflames

    Not planned for the near future. :)
     
  25. Offline

    jobud9

    :O
    this is an awesome plugin. i hope to see more of it
     
  26. Offline

    Neils

    Is it possible, to use this plugin, so that when a User enters his name on www.xyz.de/whitelist he gets automaticly whitlisted ?
    And if yes, is there anybody who knows if it is possible on a site on joomla ?
    And again, if yes, how ?
     
  27. Offline

    Waterflames

    Yes, that is possible. DutchCraft did it already.
    I have no experience with joomla, but if you are able to write custom php code there, you could try :)
     
    Neils likes this.
  28. Offline

    Neils

    Kan jij mij de code gewen, die je voor dit nodig hebt ? (Mijn PHP is te slecht)
    Can you give me de code you used for this ? (my PHP is too bad)
     
  29. Offline

    Waterflames

    Download

    You need my modded version of WhiteListPlus for this, which can be found here.
     
  30. Offline

    mctop100.net

    Looks extremely promising! Unbelievable what talented people come up with, exactly what I was looking for....

    The only feature that I 'do not' or did not see is that when you use this to PHP->Bukkit get perhaps the few following lines of the Bukkit Console returned back to PHP. This would be very useful to be able to parse those strings and make sure that the commands issued by PHP actually accomplished what was desired on the Server.

    Correct me if I am wrong - but at the moment it is similar to blindly sending commands from PHP->Bukkit and hoping that these commands are executed as desired, without actually having a way to know the response of those commands.
     
  31. Offline

    Waterflames

    As I said a few posts back, it is fairly impossible to get the output of a certain plugin, or all plugins for that matter.
    Shame, I know, maybe you could request it on Bukkit Leaky.
     

Share This Page