Arkadaşlar cssource için rcon şifresiyle bağlanılabilen çok kısa server restart başlat kapat işlemi olan küçük bir dosya yapabilir misiniz? Tasarım olmayacak düz HTML login işlemide olmayacak.
Cssource webpanel
)

(05-03-2021, 22:47)MawiLarq Adlı Kullanıcıdan Alıntı: ogcp panel vardı onun kodlardan rcon bağlantısını alabilirsin örnekO cs1.6 paneli sanırsam bana detay gerekmiyor sadece dediğim gibi cssource uyumlu rcon bağlantısı hatta kapat açta olmasın restart işlemi olsun yeterli.
<?php
/*
Basic CS:S Rcon class by Freman. (V1.00)
*/
class rcon {
var $Password;
var $Host;
var $Port = 27015;
var $_Sock = null;
var $_Id = 0;
function RCon ($Host,$Port,$Password) {
$this->Password = $Password;
$this->Host = $Host;
$this->Port = $Port;
$this->_Sock = @fsockopen($this->Host,$this->Port, $errno, $errstr, 30) or
die("Unable to open socket: $errstr ($errno)\n");
$this->_Set_Timeout($this->_Sock,2,500);
}
function Auth () {
$PackID = $this->_Write(3,$this->Password);
// Real response (id: -1 = failure)
$ret = $this->_PacketRead();
if ($ret[1]['id'] == -1) {
die("Authentication Failure\n");
}
}
function _Set_Timeout(&$res,$s,$m=0) {
if (version_compare(phpversion(),'4.3.0','<')) {
return socket_set_timeout($res,$s,$m);
}
return stream_set_timeout($res,$s,$m);
}
function _Write($cmd, $s1='', $s2='') {
// Get and increment the packet id
$id = ++$this->_Id;
// Put our packet together
$data = pack("VV",$id,$cmd).$s1.chr(0).$s2.chr(0);
// Prefix the packet size
$data = pack("V",strlen($data)).$data;
// Send packet
fwrite($this->_Sock,$data,strlen($data));
// In case we want it later we'll return the packet id
return $id;
}
function _PacketRead() {
//Declare the return array
$retarray = array();
//Fetch the packet size
while ($size = @fread($this->_Sock,4)) {
$size = unpack('V1Size',$size);
//Work around valve breaking the protocol
if ($size["Size"] > 4096) {
//pad with 8 nulls
$packet = "\x00\x00\x00\x00\x00\x00\x00\x00".fread($this->_Sock,4096);
} else {
//Read the packet back
$packet = fread($this->_Sock,$size["Size"]);
}
array_push($retarray,unpack("V1ID/V1Response/a*S1/a*S2",$packet));
}
return $retarray;
}
function Read() {
$Packets = $this->_PacketRead();
foreach($Packets as $pack) {
if (isset($ret[$pack['ID']])) {
$ret[$pack['ID']]['S1'] .= $pack['S1'];
$ret[$pack['ID']]['S2'] .= $pack['S1'];
}
else {
$ret[$pack['ID']] = array(
'Response' => $pack['Response'],
'S1' => $pack['S1'],
'S2' =>$pack['S2'],
);
}
}
return $ret;
}
function sendCommand($Command) {
$Command = '"'.trim(str_replace(' ','" "', $Command)).'"';
$this->_Write(2,$Command,'');
}
function rconCommand($Command) {
$this->sendcommand($Command);
$ret = $this->Read();
return $ret[0]['S1'];
}
}
/*
ilk değer - ip adresi
ikinci değer- port
üçüncü değer - rcon şifreis
*/
$r = new rcon("127.0.0.1",27015,"testme");
$r->Auth();
$r->rconCommand("cvarlist"); // kullanmak istediğin rcon komutu
?>(06-03-2021, 06:29)Haseki Adlı Kullanıcıdan Alıntı: Çok teşekkürler.
@ITenGriTR
Kullanmak istediğin komut diye belirtmişsin onun bir listesi varsa atar mısın?
cvarList gibi
$r->rconCommand("cvarlist"); // kullanmak istediğin rcon komutu