/**
  * Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
  * server.
  *
  * @throws UpdateException
  * @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);
     Profiler::init(spl_object_hash($this));
     $this->getTransport()->send(String::fromHex(33));
     if (!preg_match_all("/,?(\\d+)#([0-9a-zA-Z\\._-]+),?/", $this->getTransport()->read(96), $matches) || !isset($matches[1]) || !isset($matches[2])) {
         throw new UpdateException("invalid reply from the server");
     }
     $this->build_datetimes = $matches[1];
     $this->version_strings = $matches[2];
     Signal::getInstance()->emit("updateConnected", $this);
 }
 /**
  * Deploys snapshot data on the selected virtual server. If no virtual server is selected (ID 0),
  * the data will be used to create a new virtual server from scratch.
  *
  * @param  string $data
  * @param  string $mode
  *
  * @return array
  */
 public function snapshotDeploy($data, $mode = Constant::SNAPSHOT_STRING)
 {
     switch ($mode) {
         case Constant::SNAPSHOT_BASE64:
             $data = String::fromBase64($data);
             break;
         case Constant::SNAPSHOT_HEXDEC:
             $data = String::fromHex($data);
             break;
         default:
             $data = String::factory($data);
             break;
     }
     $detail = $this->request("serversnapshotdeploy " . $data)->toList();
     if (array_key_exists("sid", $detail)) {
         Signal::getInstance()->emit("notifyServercreated", $this->getParent(), $detail["sid"]);
     }
     return $detail;
 }