16 février 2009, par Zyzko
Ce petit script PHP permet d’envoyer des commandes RCON à un serveur HL2 Source.
rcon2_class.php
Password = $Password ; $this->Host = $Host ; $this->Port = $Port ; $this->_Sock = @fsockopen($this->Host,$this->Port, $errno, $errstr, 30) or die("Impossible d’ouvrir le socket : $errstr ($errno)\n") ; $this->_Set_Timeout($this->_Sock,2,500) ; function Auth () $PackID = $this->_Write(SERVERDATA_AUTH,$this->Password) ; $ret = $this->_PacketRead() ; if ($ret[1][’id’] == -1) (...)