PHPsend
PHPsend
Execute console commands using PHP scripts on website!
This plugin provides simple API and lightweight plugin to allow you command your server from your webpage!
To all updating people. You will have to update your scripts plugins, the main thing is that now functions are prefixed with PHPS instead of PHP (for example old PHPconnect is now PHPSconnect).
PHPsend is now PHPSend**
NEW VERSION
- Logging level (No more console spam!), new logging system
- Hash algorithm is now SHA1
- Player associated commands
- New command: phpsend reload to let you reload config and whitelist without server restart
- IP Whitelist for both php script and plugin
- Post argument style
- Protocol names are now with PHPS instead of PHP (like PHPconnect is now PHPSconnect)
- New plugin hook: onWebCommandAsPlayer
- Cleaned up code
- Minor bugs fixed, more exceptions handled.
- Add few API functions to make your life even simplier.
Pages are updated now. Just wait for approval.
Features:
- Execute commands from web
- Using SHA1 password to authenticate
- Simple API with few fuctions!
- Configurable port (default: 11223)
- EXTREME small
- Support for /reload!!!
Plugin API Tutorial - Making simple online player website
Dev Builds
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
never mind, i can wait...
@IwannaDashInName
I don't even have time to check it -_-. Gawd. Should work okay... :/
@kittyPL
i can't... $con->PHPSconnect return value 0, $con->PHPScommand return value 0... return value 0 should indicate, that everything is ok, so my php is not capable to find out, that command wasn't run. multiquering would be good, but not necessary. i just need to tell my php, if command was, or wasnt run, so i can handle it
@IwannaDashInName
Can't you just query the results? If plugin is busy, display loading or just wait. Make a loop where you try to connect, unless returnValue==1. Hope this helps a bit, I will add multiquerying in next update :)
@kittyPL
would be great. i thought PHPsend has only one listening thread, but return value worried me. while it is 0, i cant handle with 'undelivered' commands.
i also found little bug in PHPsend.php in function PHPSconnect() there is:
$result = socket_connect($this->socket, $adress, $port);
if ($this->socket==null) there should be if(!$result)
return 1;
/edit/ it do not solve my problem, i but i found it, while i was trying to solve it...
@IwannaDashInName
PHPsend has only one listening thread, so it can only respond to the first query. I don't know why does the second execution return 00, i think it should return 2x or 1x... hmm. Will try to fix it when I have some time :/
I'm trying your plugin, but i have a problem. I wrote a simple php script to send command to the server, and add sleep (); into that script, to simulate long execution:
$con = new PHPSSend(); $succ = $con->PHPSconnect("127.0.0.1","3fbd4501051c66e0",11223); echo $succ $succ=$con->PHPScommand("say some text!"); echo $succ; sleep (5); $succ = $con->PHPSdisconnect();
i execute script 2 times, so there are 2 scripts trying to send command to server. php output is 00 in booth times (succesful connected, succesful executed command). but server execute command only one times! how can I avoid that problem?
@Adrenalineq
Uhm, this is a bug actually :/
But I wont release a single bug fix, I gonna make scripting language first, and then let go whole update.
@XeonG8
-_- you don't understand me :) "kittyPL" at NEWEST package "PHPSend 1.0" have this bellow error ;3
Should be "PHPSend"
@Adrenalineq
"Protocol names are now with PHPS instead of PHP (like PHPconnect is now PHPSconnect) "
You have to update your scripts
@kittyPL
You have error at your files namely "PHPSend.php"
line 38: class PHPSsend , should be class PHPSend :)
"If you have any problems (or just don't know how to do this), PM me, I will do this for you, its a really small thing."
$con->PHPSbroadcast("&5blahblahblah");
I would imaging its uses would actually make it worth the time just putting the function into plugin... but sure i'll pm you, kinda want it soon.
@XeonG8
So, you have two choices:
1) Write bukkit plugin that will have command that broadcast message, then run this command with $con->PHPScommand("<commandName> blahblahblah");
2) Write your PHPsend mini-plugin, that will catch some incomming messages, and then send them to players. For this one, check out the PHPsend plugin tutorial. I think there is everything you need. (I hope you know Java a bit, also that you have made some bukkit plugins, or at least know how to do them).
If you have any problems (or just don't know how to do this), PM me, I will do this for you, its a really small thing.
I'm wanting to know how I can do
$con->PHPScommand("say
---");but without the say (which puts in the [server]... so just
--appears in the chat to everyone..not sure which bits you were thinking about..
and also "Take a look at tutorial, its updated now. " which did you mean?
@XeonG8
Uhm, I will think about it :)
Of course you can hava php -> bukkit. This is the main job of PHPsend. Take a look at tutorial, its updated now. For more complex actions than just sending some commands use PHPsend mini-plugins, that will let you do whatever you want, with high-level API.
ah very nice.. I got it all working, bukkit > php and php > bukkit ... its good
how can have php > bukkit .. not use the say command but just directly broadcast text much like a server plugin would to all players or specific players? (both options would be nice)
like with command you have to put in 'say ' and you get [server] ingame before the actual sent message and I don't want that.
Also can you make it so that the /website command also sends in the args the playername (maybe even better if it could also send the players permission rank) .. I could do it using skript.. but minecraft only lets you send so much in one chat message from ingame, and I think the plugin would be better attaching all the extra args onto the url it sends to the website than users trying to include everything on a command..
also I think possible logging (to file or console) option should include the sent website url /who sent it
@XeonG8
My plugin has /website command, that sends data to the php url from config. Look in documentation :) I think it's most simple plugin to do that. Also, if you need more you can use some Java and write custom plugin (I can help you).
Good luck with your scripts :)
@speaw
I just need 1.0 approved! :D
what whitelist systemmmmm :D yesss :D
yeah so I took a look at the websend plugin aswel now.. but cannot get the full thing working ie bukkit to php with its websend url.
Which is only basic support for the plugin to have a command that sends inputted commands arguments from ingame to a php url
I think something like that on this plugin would be pretty useful at a basic level.. more possibilities with the custom java stuff.
so I'm wondering if your plugin would do that? out of the 2 plugins websend and swiftapi it certainly is the smallest, and I do like the idea of being able to just do the java for the stuff I do want. However I really do no nothing of java only php. Its why swift api appeals in that it has a lot of usefull stuff built in even it is exactaly what I'd want, and I just need to use php to call it and then just use the stuff I did want.
UPDATED
Still waiting for file approval. Impatient people can compile from sources, cuz they are here ^^