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.
@stargateanubis14
Are you sure websend is configured correctly? (ALTPORT=8219) Maybe portforwarding on bukkit side?
Ok... so it happened that they [my hosts], had closed off that port (idk why)...they gave me another one, but it results in this::
socket_connect() [function.socket-connect]: unable to connect [111]: Connection refused in /minecraft/playerupdate.php on line 12 error: could not connect to host $succ = socket_connect($sock, $HOST, 8219)
@stargateanubis14
actually.... it used to work just fine. Just tested it, and it doesn't appear to do anything bukkit->php... Is there any ways of debugging that can find the specific point of error?
@Waterflames
yeah...
it works for a file that ONLY has the php->bukkit code... but when i try to call something like the example php->bukkit code via a function, it doesn't do anything. No errors, no results
@stargateanubis14
Is the port properly forwarded?
strange... when i have a line like this:
/Command/ExecuteConsoleCommand:say test123 123
For some reason, its not workin :/
the web server can still get stuff, but for some reason its not performing the command from teh console :/
@Mr_H4mm3r
You need a php -> bukkit, in which you upgrade the user. (using ExecuteConsoleCommand:somecommand someuser) In the future, when output capturing is out of alpha, I suggest changing it so you know if it succeeded or not.
Don't forget to log every donation, just in case something goes wrong. (You never know.)
@Waterflames I want to have a donation script on my site so when you donate you get a rank on the server; If you donate 1 - 3 Euros you get Dirt donator if you donate 4 - 6 Euros you get Stone donator etc.. How should I make it? Can you make it because I'm not the best php developer :!
@darkmage0252
Are you trying to do this in a bukkit->php or php->bukkit connection?
If you mean the bukkit->php: Example:
$_POST["bukkitPort"]
will by default be 25565.
@stargateanubis14
I don't really understand what you mean in the console command part, are you trying to send java code directly to the console? (That's not going to work)
Php->bukkit->php is available in an alpha state. Check the pages section for more info on that.
Could you show us how to use the Post data? i cant seem to get it to work
@Waterflames
well, from what i've been looking at, it doen't look like thats possible... So i'm working on a way to have WS do a command in-game (one that i've written), that gatehrs a bunch of info, and sends it back to the WS web server... Right now, the problem i'm having is that i cant get console to send a command. I've tried everything from player.chat(""); (where i cast Bukkit.getConsoleSender() to Player type), to Bukkit.getServer().dispatchCommand ...neither actually do the commands... so i'm stuck with php->bukkit-//~ ... i've been in the #bukkitdev irc, but noone seems to know why it wouldn't work.
Ofc, if you had a way to do php->bukkit->php, then that would be great (although, that would be a bit more difficult to generalize)
@stargateanubis14
Doing a command like a player while that actual player isn't online? I don't think there is a way to do this. (Except maybe by emulating a player, but that would be very messy.)
@Waterflames
ah... darn :/ And there's no pseudo way of doing that?
@stargateanubis14
Yes that is the correct way. Note that that requires the specified player to be online.
is it possible, through php->bukkit, to send a command as a given user? I'm trying to find a way to get users who log in on the web, to query the server in a sort of way, and the server will send back information and update the site (i can get the server to send info back to the website, but 98% of that information requires the person of whom the information is being received to be the sender of the command.)
EDIT
correct me if i'm wrong, but is this the proper way to do it?
socket_write($sock, $command = "/Command/ExecuteBukkitCommand-".$playerName.":command arg0 arg1;", strlen($command) + 1) or die("error: failed to write to socket\n");
I was just looking at the API, and i saw it... wanted to make sure i'm not gonna end up breaking something this way :D
@Avooal
I know that special symbols might not work out of the box, and supporting them isn't currently on my todo list.
Does WebSend support special characters such as é or à ? I'd like to use them for some of my group names. However, I keep getting blanks (terminal) or squares (files) instead of special characters.
@3LPlay
I just finished an example of response returning with a bukkit command, and it works. I'll do the other ones tomorrow, probably.
@Conderan
Maybe I will implements aliases in the future, but for now you could use CommandHelper for that.