Websend
Websend
EOL notice:
After almost 6 years, this plugin has reached an end-of-life status.
I will no longer be maintaining this plugin. If you are a developer and are interested in the source code of this project, feel free to use it as it is published under an MIT license.
To all the great people in the community: Thank you for the wonderful time!
Documentation can be found on Github wiki. (Edit: 9/2/2017: link fixed)
Source code can be found on Github.
What does this plugin do?
This plugin enables PHP developers to access minecraft commands from a web-based script.
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.
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))
Head over to the files for the latest version, and here for installation instructions.
Documentation and more.
-
View User Profile
-
Send Message
Posted Feb 26, 2012So, would like to be able to tell when someone eats something. Can you add an event or suggest a way to detect that?
-
View User Profile
-
Send Message
Posted Feb 26, 2012When I type /ws ingame the console shows the following error:
2012-02-26 18:12:28 [SEVERE] Exception in thread "Thread-27108" 2012-02-26 18:12:28 [SEVERE] java.lang.NullPointerException 2012-02-26 18:12:28 [SEVERE] at Waterflames.websend.POSTHandler.(POSTHandler.java:49) 2012-02-26 18:12:28 [SEVERE] at Waterflames.websend.PosterThread.run(PosterThread.java:42)
What does that mean?
-
View User Profile
-
Send Message
Posted Feb 25, 2012@tclausen
Try the externalTimeSet from here: http://dev.bukkit.org/server-mods/websend/pages/types-of-communication/#w-php-to-bukkit
-
View User Profile
-
Send Message
Posted Feb 25, 2012I am trying to get v1.4.2 to work, but I keep getting this error in the console, whe trying to load ExternalTimeSet.php:
2012-02-25 20:38:45 [SEVERE] Websend encountered an error while reading from socket. java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) at sun.nio.cs.StreamDecoder.implRead(Unknown Source) at sun.nio.cs.StreamDecoder.read(Unknown Source) at java.io.InputStreamReader.read(Unknown Source) at java.io.BufferedReader.fill(Unknown Source) at java.io.BufferedReader.readLine(Unknown Source) at java.io.BufferedReader.readLine(Unknown Source) at Waterflames.websend.ComServer.run(ComServer.java:95)
ExternalTimeSet.php <?php try{ $HOST = "127.0.0.1"; the ip of the bukkit server $password = "XXXXX"; 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/ExecuteConsoleCommandAndReturn-SimpleBroadCast:broadcast lol;", strlen($command) + 1) Writing text/command we want to send to the server or die("error: failed to write to socket\n"); sleep(2); while(($returnedString = socket_read($sock,50000))!= ""){ $returnedString = socket_read($sock,50000,PHP_NORMAL_READ); print($returnedString); } print("End of script"); socket_close($sock); }catch(Exception $e){ echo $e->getMessage(); } ?>
config.txt:
What could that be?
-
View User Profile
-
Send Message
Posted Feb 25, 2012@Waterflames I host bukkit on shell account, I do not forward any ports, they are rather open.
-
View User Profile
-
Send Message
Posted Feb 25, 2012@Gh33rt
Have you forwarded the port correctly?
-
View User Profile
-
Send Message
Posted Feb 25, 2012I tested websend on 2 hosting servers and on first (payed) it gave me error 500 and on second (free 000webhost) gave me "Warning: socket_connect() [function.socket-connect]: unable to connect [110]: Connection timed out in /home/a8343251/public_html/index.php on line 7" I tried on alt ports with no effects. Unfortunately i can't host php script on the game server ;\
Here is my cfg:
Here is my PHP script:
Startup log looks good too:
Is it way to fix it or any simply, alternative plugin?
-
View User Profile
-
Send Message
Posted Feb 25, 2012It would be nice if we can have the position & world of every player in the POST data!
-
View User Profile
-
Send Message
Posted Feb 24, 2012@Conderan
Using WSEvents is pretty simple. Install the jar, let it generate the config file by starting the server and then you can switch events on or off in the configuration file.
Once an event is triggered, WSEvents will check whether it is toggled on and then it will start a connection as if you were to type /ws The "player" value in the post data will reference to the player that was involved in the event. The "args" value will give you an array containing "event" in slot 0 and the event type in slot 1 (in your case "join").
-
View User Profile
-
Send Message
Posted Feb 24, 2012Where can I find some documentation on WSEvents? Is there a POST data to easily tell if and which event triggered it? Wanting to build something that only runs when someone connects.
Also, does anyone have a listing of things others have done? I'd just happened to stumble across one plugin that was written as a php script at one point and was then redone in java, author was nice enough to give me the php version since I figured this would be less taxing as I already run websend.
-
View User Profile
-
Send Message
Posted Feb 23, 2012@Stonehengeflk98
echo "/Command/ExecuteConsoleCommand:give $target $item:$type $amount;";
Make sure that there is no / before give. There is a requirement to have a ; in the end to finalize the command AFAIR. If yo want to give enchanted items you will have to add that, too according to the command syntax of /give.
-
View User Profile
-
Send Message
Posted Feb 23, 2012@Stonehengeflk98
I wrote "/Command/ExecuteConsoleCommand:give <player> <itemid> <amount>" and it worked. Tip: I always set a space (" ") between ExecuteConsoleCommand and the command to execute - but this throws an error in the console (command nout found).
I hope I helped :)
-
View User Profile
-
Send Message
Posted Feb 23, 2012@Waterflames
cool plugin, but when i try to use any command like say or give Websend says:
Websend: Parsing Line
Websend: No Commands were found.
<?php
$HOST = "localhost"; //the ip of the bukkit server
$password = "pw";
//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:give $_Player diamond 15;", strlen($command) + 1) //Writing text/command we want to send to the server
or die("error: failed to write to socket\n");
?>
$_Player is an variable, which is defined by an textfield..
-
View User Profile
-
Send Message
Posted Feb 23, 2012how to integrate the /give command?
-
View User Profile
-
Send Message
Posted Feb 22, 2012@Pr07o7yp3
$_POST['playerXP'] returns the value of xp of the player as if it would reset each level. To get a players xp LEVEL, use $_POST['playerXPLevel']
Note that this info is all available here.
-
View User Profile
-
Send Message
Posted Feb 21, 2012Can you add to $_POST data these:
$_POST['yaw'] and $_POST['pitch'] :) ?
And why $_POST['playerXP'] doesn't work correct?
-
View User Profile
-
Send Message
Posted Feb 21, 2012@Waterflames
Thanks! Looking forward to a fix of the enchantments! :)
-
View User Profile
-
Send Message
Posted Feb 21, 2012@uncovery
Added to the todo list.
-
View User Profile
-
Send Message
Posted Feb 20, 2012Another interesting side-feature would be the possibility to process & output console text.
So if the console throws a certain text, the plugin would react. I am not sure if this is taking a lot of resources however.
If the plugin could write text to the console w/o displaying it to someone in-game it would be great for monitoring & debugging activities of the plugin.
-
View User Profile
-
Send Message
Posted Feb 20, 2012Hello back,
Websend works now (changed permissions plugin).
Thanks.