<?php /* RCON remote console class, modified for minecraft compability by Tehbeard.
!!!YOU MUST CONFIGURE RCON ON YOUR MINECRAFT SERVER FOR THIS TO WORK AT TIME OF WRITING ONLY 1.9pr4+ HAVE BUILTIN RCON SUPPORT!!!
Example Code: ============ include_once("rcon.class.php"); //Include this file $r = new rcon("127.0.0.1",25575,"foobar"); //create rcon object for server on the rcon port with a specific password if($r->Auth()){ //Connect and attempt to authenticate { $r->rconCommand("say Saving in 10 seconds!"); //send a command sleep(10); $r->rconCommand("save-all"); //send a command $r->rconCommand("say Save complete!");//send a command echo $r->rconCommand("list");//send a command, echo returned value } ============
Based upon the following work: [<<< Basic CS:S Rcon class by Freman. (V1.00) ---------------------------------------------- Ok, it's a completely working class now with with multi-packet responses
function rconCommand($Command) { $this->sendcommand($Command);
$ret = $this->Read();
//ATM: Source servers don't return the request id, but if they fix this the code below should read as // return $ret[$this->_Id]['S1']; return $ret[$this->_Id]['S1']; } } ?>
Re: RCON
Napsal: 26 lis 2013, 13:38
od zdenda204
Nene, určitě instaluje Mystyho WebShop a nečetl návod RCON není plugin. RCON je protokol pomocí kterého se dá s MC serverem komunikovat. Takže v té instalaci jak máš zadat tabulku pro RCON tak tam napiš nějakou hovadinu...