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 Sep 18, 2012The plugin "HTTPConsole" can return the output from a command without a modified CraftBukkit. (though the plugin needs an update and gives a "Broken pipe" error almost every time).
I don't know how they have implemented it, but there must be a way? Do you think it would be possible to add?
-
View User Profile
-
Send Message
Posted Sep 18, 2012What does the proLoginEnabled in WSEvents do?
-
View User Profile
-
Send Message
Posted Sep 17, 2012Thanks ! It is okay, I modified the connect function in the Websend class :
-
View User Profile
-
Send Message
Posted Sep 16, 2012@Tetdoss
I just do a quick socket check to see if the server is running, and it seems to work perfectly. Does this help?
-
View User Profile
-
Send Message
Posted Sep 16, 2012Hello, I love this plugin! But I have a suggestion, please add a fonction to the Websend class, I want to do ws->is_connected() to know if the serveur is online for example, or to know if I can send a command to the server :)
Thanks ;)
-
View User Profile
-
Send Message
Posted Sep 3, 2012@Waterflames
you mean, send it as a chat command but with a / still?
-
View User Profile
-
Send Message
Posted Sep 3, 2012@jacklink01
i think commandhelper might listen to the pre command something or other, hmm will give it a try.
and yeah, thats exactly what I'm doing, acts as if the command doesn't exist,
-
View User Profile
-
Send Message
Posted Sep 3, 2012@ryan_the_leach
Depending on how CommandHelper is internally implemented, it might be listening to chat events instead of commands.
Try sending the message as chat instead of a command.
-
View User Profile
-
Send Message
Posted Sep 2, 2012@ryan_the_leach
How is the plugin not working with command helper? Do you mean you are trying to do something like.....
print("/Command/ExecutePlayerCommand:commandhelperalias;");I will look into this because I have run into the same issue, but I think that CommandHelper puts itself "above" all other plugins in order to do the aliasing. You might try messing with "play-dirty=true" in the preferences for CommandHelper. I promise nothing by doing this and according to the comments on that config option, it's a "dirty" thing to do. haha
-
View User Profile
-
Send Message
Posted Sep 2, 2012@decebaldecebal
You should also make sure that your web host is allowing you to use port 4445. Some web hosts require that you send them an email or a "ticket" to have them open up a port for you.
Exriilc is right in that this error means that the connection to the server is not being made. I would contact your host to make sure it is open or find out if they allow you to open the port.
-
View User Profile
-
Send Message
Posted Sep 2, 2012For some reason this doesn't work with commandhelper, is there anyway to get these 2 plugins working together?
-
View User Profile
-
Send Message
Posted Sep 2, 2012@decebaldecebal
Since this is a PHP thing, I figured I'd throw in my 2 cents.
Your web server isn't able to make the connection to the MC server. Therefore, the result of fsockopen() (the resource used for fwrite()) is false (a boolean.)
I know you said you didn't modify the files, but you didn't happen to put the port number after the host IP with a colon like it shows in the error (188.24.5.182:4445), did you? The port defaults to 4445, so you can leave it out entirely; like this: ("188.24.5.182"). You probably didn't, but it was worth mentioning to check.
It's likely, I think, that your web host doesn't allow fsockopen() on the Websend port (4445). You might ask them to open it or which ones they do allow.
Hope this helps.
-
View User Profile
-
Send Message
Posted Sep 2, 2012Installed this plugin and I use the example files to test it.Everything worked fine while I was testing them on my home server,but when I move the web files to my webserver I get these errors: http://pastie.org/4651010
I have not modified the files in any way and I check the port 4445 and it is opened. Could this be caused by my web hosting service?
-
View User Profile
-
Send Message
Posted Sep 1, 2012@Waterflames
Continued in the forum: "Programming Help". Meet me there?
-
View User Profile
-
Send Message
Posted Sep 1, 2012@Ezriilc
I will probably include a way to sent raw data through a script in one of the next versions of Websend. I actually think I already partially have something like that in the protocol of Websend 2.0.
Thanks for the compliment! It keeps the project fueled!
-
View User Profile
-
Send Message
Posted Sep 1, 2012@Waterflames
Yea, I'm thinking that some kind of verification on the web site is needed in any case. Otherwise, I'd need Websend to drop some kind of cookie or other ID badge on the player's device in a way that their browser could then pick it up to auth them on the web site, but that's asking a bit much. Perhaps someday we'll get a MC/Bukkit browser plugin to do that. With Bukkit being part of Mojang now, who knows?
As it stands now, I'm cool. We're all friends, so if anyone at their IP is logged into MC, then I'm OK with them seeing the not-terribly "private" info. Beyond that, they can just login normally. No biggie.
Websend rocks and helps to keep me passionate about Bukkit and Minecraft! Thanks again for all your hard work. I'd donate if I weren't broke.
-
View User Profile
-
Send Message
Posted Sep 1, 2012@Ezriilc I looked into it and servers do not have access to session IDs. (source: http://www.wiki.vg/Authentication#Joining_a_Server )
" It'd be nice to fully automate the process though" " Maybe a plugin to have Bukkit execute a console or player command automatically upon their login."
Well, that kind of defeats the purpose of the verification, doesn't it? The point of that step is for the end user thats playing to be able to say either: "Yes, that was me. Allow the request" or "No, I didn't ask for that? Deny it!" If you automate it, it will just accept always.
I guess another option would be to give a temporary verification code, to the user on login and when they visit the website they have to enter it once. After that you could work with cookies. (Not a fan of that, but Facebook thinks it is safe enough so...) This is kind of how Steam does it. New ip-address? Go check your email and put the verification code we sent you in this box.
-
View User Profile
-
Send Message
Posted Sep 1, 2012@Waterflames
Thanks for the input. I think we're on the same page, but I don't see how the session ID in PHP is useful beyond it's normal function. Is there a session ID in MC or Bukkit that Websend can get a hold of?
Having the user type "/ws logmein" or something from in-game might be easy enough. It'd be nice to fully automate the process though. Anyone have some code they've already hammered out to do this? Somehow it seems closely related to MOTD; like if there could be a command put into that. Maybe a plugin to have Bukkit execute a console or player command automatically upon their login.
-
View User Profile
-
Send Message
Posted Sep 1, 2012@Ezriilc Glad to hear you are enjoying the plugin :D
MC login servers allow multiple sessions from the same ip address, but this doesn't really matter with your problem. In one house, somebody could be playing, and somebody else could visit your webpage. The second person doesn't even have to be playing.
How could you fix this? You could use the session ID of the user, ask the user ingame to confirm the request, or make a login system anyway.
You could also force the web page request to come directly from minecraft by requiring a unique ID in POST or something like that, but this is not such a good idea because it limits the player, probably requires a client mod and isn't that safe either.
Another option is to work with MAC addresses, but that is going to make your solution pretty complicated and heavy for the user. Also, mac addresses can be changed, so its not that good for security purposes.
-
View User Profile
-
Send Message
Posted Sep 1, 2012Just a note to Waterflames to let you know that I'm still loving Websend! The new 2.0 release works great and onlinePlayersIP[] in particular is making my life easier.
To everyone: I need some advice on best practices. I'm using onlinePlayersIP to test a web visitor's $_SERVER['REMOTE_ADDR'] against the current onlinePlayers list. This allows me some low-level security checks to display private info. My concern is that if there were more than one MC player logged in from that IP, then the web page will show the private info, and the visitor might not be who I think it is; like in our house.
We're just a tiny private server with less than 10 members, and we're all friends IRL, but I'm wondering how this should be handled with larger, more secure systems, 'cuz I like learning and I'm picky about my own stuff.
EDIT: Additional note: My basic goal is to allow for some private info display without making the user login separately from Minecraft.
My question/s is/are: How much of a problem is this and am I reading the situation correctly? Does Bukkit/MC prevent multiple sessions from the same IP? I thought I may have seen that somewhere... maybe in a plugin. How would you do it on your system?
All opinions and advice are welcome. Thanks in advance!