public function exec($command)
    {
        if (!$this->connected) {
            throw new NotAuthenticatedException('Client has not connected to the Rcon server.');
        }

        $this->write(self::SERVERDATA_EXECCOMMAND, $command);

        return $this->read()[0]['S1'];
    }
public function exec($command)
    {
        if (!$this->connected) {
            throw new NotAuthenticatedException('Client has not connected to the Rcon server.');
        }

        $this->write(self::SERVERDATA_EXECCOMMAND, $command);

        return $this->read()[0]['S1'];
    }
public function exec ( $ command ) { if ( ! $ this -> connected ) { throw new NotAuthenticatedException ( 'Client has not connected to the Rcon server.' ) ; } $ this -> write ( self :: SERVERDATA_EXECCOMMAND , $ command ) ; return $ this -> read ( ) [ 0 ] [ 'S1' ] ; }
Executes a command on the server.

@param string $command
@return string
Executes a command on the server .