[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

    Rabus

    Nice one, thanks!
     
  3. Offline

    ReCreate

    I seem to get an error after trying this. Are there any specific requirements?
    Code:
    2011-07-23 14:45:32 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'ws' in plugin Websend v1.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NoClassDefFoundError: com/nijiko/permissions/PermissionHandler
        at websend.Main.onCommand(Main.java:127)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    This happens when i run /ws from the client.
    It's running on Ubuntu Server 11.04 with the latest bukkit build and the following plugins:
    Authme, BorderGuard, Essentials, EssentialsChat, EssentialsGeoIP, EssentialsProtect, EssentialsSpawn, Lockette, Worldedit and of course Websend
     
  4. What does this Plugin do ? Only printing a message what the Command is doing ? And whos doing it :eek:
     
  5. Offline

    MariuszT

    @Waterflames: Nice to see that you released a plugin :) If you wish, you can use my PHP script as an example.

    @snooze95: This plugin allows you to communicate with your web server (eg a PHP script but not only) from within the game. Communication works both ways.
     
  6. Can you give me an Example... I know a lot about PHP and Minecraft but dont know how to put both together.

    Sry for my bad english.
     
  7. Offline

    MariuszT

    There are lots of possibilities. Example:

    You can write a script that will check the database iConomy plugin if the user has money. If so, let him buy the selected item and give it to the game with the command / give.

    I propose to combine this plugin with the capabilities of CommandHelper.

    No problem, mine is not better :D
     
  8. Offline

    Waterflames

    The permissions plugin is implemented on that line. I thought it would default to OP's if the plugin was not present.
    I'll fix it.

    Thank you for trying it out! :D

    And thank you for answering some of the questions :)

    I will see what I can do.
     
  9. Offline

    MariuszT

    It was a proposition for users, not for you ;) But of course you can join the team of CommandHelper and add functionality of WebSend. It would be wonderful :)
     
  10. Offline

    Waterflames

    That was what I thought you ment :p
    But, I would rather not.
     
  11. Offline

    Waterflames

    Version 0.2 fixes the permissions plugin problem.
    Download here or here.
     

    Attached Files:

  12. Offline

    ReCreate

    Yay. It works now. Awesome.
     
  13. Offline

    Waterflames

    Glad to hear :)
     
  14. Offline

    Ratarn

    Thx for this Plugin!
    Feature-Request:
    • Colors! (e.g. in combination with iChat)
    Edit: Another Request:
    • Option to execute Admin-Commands for normal User!? (over "/Command/ExecuteBukkitCommand:..."
     
  15. Offline

    Waterflames

    Working on implementing a /Chatcolor-red: command (and Chatcolor-blue, etc etc...)

    Like console commands?

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

    Ratarn

    yes!
    so that for example an User can set himself, after some Checks (per PHP), to an Higher Group.
     
  17. Offline

    albert

    Executing admin commands as console would be epic. Thank you for the plugin, awesome job.
     
  18. Offline

    Waterflames

    Updated to version 0.3:
    • Added color feature. (examples in supplied zip.)
    • Added Console command option (Use /Command/ExecuteConsoleCommand)

    Download here or here.
     

    Attached Files:

  19. Offline

    albert

    Awesome.
     
  20. Code:
    00:17:52 [SEVERE] null
    java.net.ConnectException: Verbindungsaufbau abgelehnt
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:320)
            at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:181)
            at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:390)
            at java.net.Socket.connect(Socket.java:578)
            at java.net.Socket.connect(Socket.java:527)
            at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:384)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
            at sun.net.www.http.HttpClient.<init>(HttpClient.java:213)
            at sun.net.www.http.HttpClient.New(HttpClient.java:300)
            at sun.net.www.http.HttpClient.New(HttpClient.java:312)
            at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:992)
            at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:928)
            at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:846)
            at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1087)
            at websend.Communicator.sendPOST(Communicator.java:43)
    
    
    The URL, Password and config file is right.

    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.einfach-doof.org/XXXX/XX/XXXX/minecraft.php
    PASS=XXXXXXXX
    
     
  21. Offline

    Waterflames

    Tough one... Basicly that error says its unable to write to the connection.
    Are there any settings in your php installation that could prevent php to accept POST data from java? Maybe a firewall?
     
  22. The Web server is installed in a virtual machine.
    Which only listens to port 80

    The PHP Config prevent nothing.
    POST and GET is ok.


    But I'll look again
     
  23. Offline

    Waterflames

    I'm 90% sure that is the problem :)

    Is it possible for you to open up a port, for example 6789?
    If yes, give me the port number and I'll make it connect trough that port.
     
  24. Is not it possible that port 80 is used for HTTP
    As it is normal too.

    I can free up an extra port.


    4444 <<< ;)

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

    Waterflames

    Code is written, but it is late now.
    I will test and release it tomorrow.
     
  26. Offline

    pudd1nG

    Will PHP Sessions work in this? I'm assuming the MC server is the one interacting with the webserver so all sessions would fall under one user? Can test if you're not sure - really excited about this plugin, great job!
     
  27. Offline

    Waterflames

    I haven't tested it, so I encourage you to find out :p

    Go to your config file in plugins, and add this line: FORCEPORT=true
    Change the url to this: URL=http://www.einfach-doof.org
    And add a new line: FILE=/XXXX/XX/XXXX/minecraft.php

    Don't forget to open port 4444 as UDP and TCP.

    0.4 version released.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  28. If protocol is TCP and destination is [WEBSERVERIP] and input interface is eth0 and destination port is 4444
    If protocol is UDP and destination is [WEBSERVERIP] and input interface is eth0 and destination port is 4444

    The Port is free but it don't work :(



    The Adress ist http://einfach-doof.org:4444/minecraft.php

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

    DarkLoard

    Hi i have a problem with the websend plugin. If i run the /ws timeset command
    my consol show me this:
    Code:
    02:43:04 [WARNUNG] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'ws'
    in plugin Websend v0.4
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:12
    9)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:3
    12)
            at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:480)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:465)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.command.Coloured
    ConsoleSender cannot be cast to org.bukkit.entity.Player
            at websend.Main.onCommand(Main.java:158)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 6 more
    I am sorry for my bad english ;)
     
  30. Offline

    Waterflames

    Are you trying to send a command from the server console?

    Is the bukkit server on the same machine that runs the webserver?

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

Share This Page