Ejemplo n.º 1
0
 /**
  * Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
  * server.
  *
  * @throws TeamSpeak3_Adapter_Exception
  * @return void
  */
 public function syn()
 {
     $this->initTransport($this->options);
     $this->transport->setAdapter($this);
     TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
     TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferConnected", $this);
 }
Ejemplo n.º 2
0
 /**
  * The TeamSpeak3_Adapter_ServerQuery constructor.
  *
  * @param  TeamSpeak3_Transport_Abstract $transport
  * @throws TeamSpeak3_Adapter_Exception
  * @return TeamSpeak3_Adapter_Abstract
  */
 public function __construct(TeamSpeak3_Transport_Abstract $transport)
 {
     $this->transport = $transport;
     $this->transport->setAdapter($this);
     TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
     if ($this->getTransport()->readLine() != TeamSpeak3::READY) {
         throw new TeamSpeak3_Adapter_Exception("invalid reply from the server");
     }
 }
Ejemplo n.º 3
0
 /**
  * Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
  * server.
  *
  * @throws TeamSpeak3_Adapter_Exception
  * @return void
  */
 public function syn()
 {
     if (!isset($this->options["port"]) || empty($this->options["port"])) {
         $this->options["port"] = $this->default_port;
     }
     $this->initTransport($this->options);
     $this->transport->setAdapter($this);
     TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
     TeamSpeak3_Helper_Signal::getInstance()->emit("tsdnsConnected", $this);
 }
Ejemplo n.º 4
0
 /**
  * Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
  * server.
  *
  * @throws TeamSpeak3_Adapter_Exception
  * @return void
  */
 protected function syn()
 {
     $this->initTransport($this->options);
     $this->transport->setAdapter($this);
     TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
     if (!$this->getTransport()->readLine()->startsWith(TeamSpeak3::READY)) {
         throw new TeamSpeak3_Adapter_Exception("invalid reply from the server");
     }
     TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryConnected", $this);
 }
Ejemplo n.º 5
0
 /**
  * Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
  * server.
  *
  * @throws TeamSpeak3_Adapter_Update_Exception
  * @return void
  */
 public function syn()
 {
     if (!isset($this->options["host"]) || empty($this->options["host"])) {
         $this->options["host"] = $this->default_host;
     }
     if (!isset($this->options["port"]) || empty($this->options["port"])) {
         $this->options["port"] = $this->default_port;
     }
     $this->initTransport($this->options, "TeamSpeak3_Transport_UDP");
     $this->transport->setAdapter($this);
     TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
     $this->getTransport()->send(TeamSpeak3_Helper_String::fromHex(32));
     if (!preg_match_all("/,?(\\d+),?/", $this->getTransport()->read(32), $matches) || !isset($matches[1])) {
         throw new TeamSpeak3_Adapter_Update_Exception("invalid reply from the server");
     }
     $this->build_numbers = $matches[1];
     TeamSpeak3_Helper_Signal::getInstance()->emit("updateConnected", $this);
 }
Ejemplo n.º 6
0
 /**
  * The TeamSpeak3_Adapter_FileTransfer constructor.
  *
  * @param  TeamSpeak3_Transport_Abstract $transport
  * @throws TeamSpeak3_Adapter_Exception
  * @return TeamSpeak3_Adapter_Abstract
  */
 public function __construct(TeamSpeak3_Transport_Abstract $transport)
 {
     $this->transport = $transport;
     $this->transport->setAdapter($this);
     TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
 }