/** * Sends a prepared command to the server and returns the result. * * @param string $cmd * @throws TeamSpeak3_Adapter_Exception * @return TeamSpeak3_Adapter_ServerQuery_Reply */ public function request($cmd) { if (strstr($cmd, "\r") || strstr($cmd, "\n")) { throw new TeamSpeak3_Adapter_Exception("illegal characters in command '" . $command . "'"); } if (in_array(TeamSpeak3_Helper_String::factory($cmd)->section(TeamSpeak3::SEPERATOR_CELL), $this->block)) { throw new TeamSpeak3_Adapter_ServerQuery_Exception("command not found", 0x100); } $this->getProfiler()->start(); $this->getTransport()->sendLine($cmd); $this->count++; $str = null; $rpl = array(); do { $str = $this->getTransport()->readLine(); $rpl[] = $str; } while ($str instanceof TeamSpeak3_Helper_String && $str->section(TeamSpeak3::SEPERATOR_CELL) != TeamSpeak3::ERROR); TeamSpeak3_Helper_Profiler::stop(spl_object_hash($this)); return new TeamSpeak3_Adapter_ServerQuery_Reply($rpl, $cmd); }