瀏覽代碼

TeamSpeak 3 PHP Framework update

- Updating from v1.1.28 to v1.1.32

Main site: https://www.planetteamspeak.com/
GitHub: https://github.com/planetteamspeak/ts3phpframework

===============================================================================
   + Added feature or noticable improvement
   - Bug fix or something removed
   * Changed or Information
   ! Important - Take note!
===============================================================================

=== Release 1.1.32 - 8 Apr 2018 ===
 ! updated online and offline docs to Doxygen 1.8.13
 ! removed deprecated TeamSpeak3_Adapter_Blacklist
 ! removed deprecated TeamSpeak3_Adapter_Update
 ! removed deprecated TeamSpeak3_Adapter_TSDNS
 ! TeamSpeak3::factory() uri now features an optional parameter to enable the
   encrypted ServerQuery connections via SSL/TLS
 + added option to specify custom protocol identifier and/or MOTD using the
   CUSTOM_PROTO_IDENT and CUSTOM_MOTD_PREFIX constants
 + added TeamSpeak3_Node_Server::channelGetDefault()
 + added optional type arg to TeamSpeak3_Node_Server::serverGroupIdentify()
 + added partial support for TeaSpeak servers
 + added mapping option for TeamSpeak3_Node_Server::serverSnapshotDeploy() to
   retreive a list of old/new channel IDs when restoring a virtual server
 - TeamSpeak3_Node_Client::memberOf() will use global sort callback
 * TeamSpeak3_Node_Server::clientFindDb() now returns more information
 * code cleanup

=== Release 1.1.31 - 23 Mar 2018 ===
 + Git ignores Intellij IDEA IDE support files.
 - URI helper uses urlrawdecode() in component getters to properly handle
   special characters. Thanks @Newcomer1989
 * README includes note use urlrawencode() on URI parts with special
   characters.

=== Release 1.1.30 - 21 Mar 2017 ===
 - TeamSpeak3\Helper\String::isInt() uses `ctype_int` to check if string is
   numerical.

=== Release 1.1.29 - 21 Mar 2018 ===
 * README includes `Getting Started` section. Thanks @Sebi94nbg
Rocco27 8 年之前
父節點
當前提交
58eb71c57a
共有 44 個文件被更改,包括 182 次插入855 次删除
  1. 1 4
      protocol/TeamSpeak3/Adapter/Abstract.php
  2. 0 119
      protocol/TeamSpeak3/Adapter/Blacklist.php
  3. 0 32
      protocol/TeamSpeak3/Adapter/Blacklist/Exception.php
  4. 1 4
      protocol/TeamSpeak3/Adapter/Exception.php
  5. 2 5
      protocol/TeamSpeak3/Adapter/FileTransfer.php
  6. 1 4
      protocol/TeamSpeak3/Adapter/FileTransfer/Exception.php
  7. 5 6
      protocol/TeamSpeak3/Adapter/ServerQuery.php
  8. 1 4
      protocol/TeamSpeak3/Adapter/ServerQuery/Event.php
  9. 1 4
      protocol/TeamSpeak3/Adapter/ServerQuery/Exception.php
  10. 2 5
      protocol/TeamSpeak3/Adapter/ServerQuery/Reply.php
  11. 0 95
      protocol/TeamSpeak3/Adapter/TSDNS.php
  12. 0 32
      protocol/TeamSpeak3/Adapter/TSDNS/Exception.php
  13. 0 216
      protocol/TeamSpeak3/Adapter/Update.php
  14. 0 32
      protocol/TeamSpeak3/Adapter/Update/Exception.php
  15. 1 4
      protocol/TeamSpeak3/Exception.php
  16. 1 4
      protocol/TeamSpeak3/Helper/Char.php
  17. 18 0
      protocol/TeamSpeak3/Helper/Convert.php
  18. 1 4
      protocol/TeamSpeak3/Helper/Crypt.php
  19. 1 4
      protocol/TeamSpeak3/Helper/Exception.php
  20. 1 4
      protocol/TeamSpeak3/Helper/Profiler.php
  21. 1 4
      protocol/TeamSpeak3/Helper/Profiler/Exception.php
  22. 1 4
      protocol/TeamSpeak3/Helper/Profiler/Timer.php
  23. 1 4
      protocol/TeamSpeak3/Helper/Signal.php
  24. 1 4
      protocol/TeamSpeak3/Helper/Signal/Exception.php
  25. 1 4
      protocol/TeamSpeak3/Helper/Signal/Handler.php
  26. 1 14
      protocol/TeamSpeak3/Helper/Signal/Interface.php
  27. 2 5
      protocol/TeamSpeak3/Helper/String.php
  28. 8 11
      protocol/TeamSpeak3/Helper/Uri.php
  29. 3 6
      protocol/TeamSpeak3/Node/Abstract.php
  30. 4 7
      protocol/TeamSpeak3/Node/Channel.php
  31. 8 8
      protocol/TeamSpeak3/Node/Channelgroup.php
  32. 7 7
      protocol/TeamSpeak3/Node/Client.php
  33. 1 4
      protocol/TeamSpeak3/Node/Exception.php
  34. 1 38
      protocol/TeamSpeak3/Node/Host.php
  35. 64 24
      protocol/TeamSpeak3/Node/Server.php
  36. 2 5
      protocol/TeamSpeak3/Node/Servergroup.php
  37. 23 75
      protocol/TeamSpeak3/TeamSpeak3.php
  38. 1 4
      protocol/TeamSpeak3/Transport/Abstract.php
  39. 1 4
      protocol/TeamSpeak3/Transport/Exception.php
  40. 9 6
      protocol/TeamSpeak3/Transport/TCP.php
  41. 1 4
      protocol/TeamSpeak3/Transport/UDP.php
  42. 2 23
      protocol/TeamSpeak3/Viewer/Html.php
  43. 1 4
      protocol/TeamSpeak3/Viewer/Interface.php
  44. 1 4
      protocol/TeamSpeak3/Viewer/Text.php

+ 1 - 4
protocol/TeamSpeak3/Adapter/Abstract.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Abstract.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 0 - 119
protocol/TeamSpeak3/Adapter/Blacklist.php

@@ -1,119 +0,0 @@
-<?php
-
-/**
- * @file
- * TeamSpeak 3 PHP Framework
- *
- * $Id: Blacklist.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * @package   TeamSpeak3
- * @version   1.1.24
- * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
- */
-
-/**
- * @class TeamSpeak3_Adapter_Blacklist
- * @brief Provides methods to check if an IP address is currently blacklisted.
- */
-class TeamSpeak3_Adapter_Blacklist extends TeamSpeak3_Adapter_Abstract
-{
-  /**
-   * The IPv4 address or FQDN of the TeamSpeak Systems update server.
-   *
-   * @var string
-   */
-  protected $default_host = "blacklist.teamspeak.com";
-
-  /**
-   * The UDP port number of the TeamSpeak Systems update server.
-   *
-   * @var integer
-   */
-  protected $default_port = 17385;
-
-  /**
-   * Stores an array containing the latest build numbers.
-   *
-   * @var array
-   */
-  protected $build_numbers = null;
-
-  /**
-   * Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
-   * server.
-   *
-   * @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));
-
-    TeamSpeak3_Helper_Signal::getInstance()->emit("blacklistConnected", $this);
-  }
-
-  /**
-   * The TeamSpeak3_Adapter_Blacklist destructor.
-   *
-   * @return void
-   */
-  public function __destruct()
-  {
-    if($this->getTransport() instanceof TeamSpeak3_Transport_Abstract && $this->getTransport()->isConnected())
-    {
-      $this->getTransport()->disconnect();
-    }
-  }
-
-  /**
-   * Returns TRUE if a specified $host IP address is currently blacklisted.
-   *
-   * @param  string $host
-   * @throws TeamSpeak3_Adapter_Blacklist_Exception
-   * @return boolean
-   */
-  public function isBlacklisted($host)
-  {
-    if(ip2long($host) === FALSE)
-    {
-      $addr = gethostbyname($host);
-
-      if($addr == $host)
-      {
-        throw new TeamSpeak3_Adapter_Blacklist_Exception("unable to resolve IPv4 address (" . $host . ")");
-      }
-
-      $host = $addr;
-    }
-
-    $this->getTransport()->send("ip4:" . $host);
-    $repl = $this->getTransport()->read(1);
-    $this->getTransport()->disconnect();
-
-    if(!count($repl))
-    {
-      return FALSE;
-    }
-
-    return ($repl->toInt()) ? FALSE : TRUE;
-  }
-}

+ 0 - 32
protocol/TeamSpeak3/Adapter/Blacklist/Exception.php

@@ -1,32 +0,0 @@
-<?php
-
-/**
- * @file
- * TeamSpeak 3 PHP Framework
- *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * @package   TeamSpeak3
- * @version   1.1.24
- * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
- */
-
-/**
- * @class TeamSpeak3_Adapter_Blacklist_Exception
- * @brief Enhanced exception class for TeamSpeak3_Adapter_Blacklist objects.
- */
-class TeamSpeak3_Adapter_Blacklist_Exception extends TeamSpeak3_Adapter_Exception {}

+ 1 - 4
protocol/TeamSpeak3/Adapter/Exception.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 2 - 5
protocol/TeamSpeak3/Adapter/FileTransfer.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: FileTransfer.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -70,7 +67,7 @@ class TeamSpeak3_Adapter_FileTransfer extends TeamSpeak3_Adapter_Abstract
    */
   protected function init($ftkey)
   {
-    if(strlen($ftkey) != 32)
+    if(strlen($ftkey) != 32 && strlen($ftkey) != 16)
     {
       throw new TeamSpeak3_Adapter_FileTransfer_Exception("invalid file transfer key format");
     }

+ 1 - 4
protocol/TeamSpeak3/Adapter/FileTransfer/Exception.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 5 - 6
protocol/TeamSpeak3/Adapter/ServerQuery.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: ServerQuery.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -73,9 +70,11 @@ class TeamSpeak3_Adapter_ServerQuery extends TeamSpeak3_Adapter_Abstract
 
     TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
 
-    if(!$this->getTransport()->readLine()->startsWith(TeamSpeak3::READY))
+    $rdy = $this->getTransport()->readLine();
+
+    if(!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !(defined("CUSTOM_PROTO_IDENT") && $rdy->startsWith(CUSTOM_PROTO_IDENT)))
     {
-      throw new TeamSpeak3_Adapter_Exception("invalid reply from the server");
+      throw new TeamSpeak3_Adapter_Exception("invalid reply from the server (" . $rdy . ")");
     }
 
     TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryConnected", $this);

+ 1 - 4
protocol/TeamSpeak3/Adapter/ServerQuery/Event.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Event.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Adapter/ServerQuery/Exception.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 2 - 5
protocol/TeamSpeak3/Adapter/ServerQuery/Reply.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Reply.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -330,7 +327,7 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
   {
     foreach($rpl as $key => $val)
     {
-      if($val->startsWith(TeamSpeak3::GREET))
+      if($val->startsWith(TeamSpeak3::TS3_MOTD_PREFIX) || $val->startsWith(TeamSpeak3::TEA_MOTD_PREFIX) || (defined("CUSTOM_MOTD_PREFIX") && $val->startsWith(CUSTOM_MOTD_PREFIX)))
       {
         unset($rpl[$key]);
       }

+ 0 - 95
protocol/TeamSpeak3/Adapter/TSDNS.php

@@ -1,95 +0,0 @@
-<?php
-
-/**
- * @file
- * TeamSpeak 3 PHP Framework
- *
- * $Id: TSDNS.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * @package   TeamSpeak3
- * @version   1.1.24
- * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
- */
-
-/**
- * @class TeamSpeak3_Adapter_TSDNS
- * @brief Provides methods to query a TSDNS server.
- */
-class TeamSpeak3_Adapter_TSDNS extends TeamSpeak3_Adapter_Abstract
-{
-  /**
-   * The TCP port number used by any TSDNS server.
-   *
-   * @var integer
-   */
-  protected $default_port = 41144;
-
-  /**
-   * 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);
-  }
-
-  /**
-   * The TeamSpeak3_Adapter_FileTransfer destructor.
-   *
-   * @return void
-   */
-  public function __destruct()
-  {
-    if($this->getTransport() instanceof TeamSpeak3_Transport_Abstract && $this->getTransport()->isConnected())
-    {
-      $this->getTransport()->disconnect();
-    }
-  }
-
-  /**
-   * Queries the TSDNS server for a specified virtual hostname and returns the result.
-   *
-   * @param  string $tsdns
-   * @throws TeamSpeak3_Adapter_TSDNS_Exception
-   * @return TeamSpeak3_Helper_String
-   */
-  public function resolve($tsdns)
-  {
-    $this->getTransport()->sendLine($tsdns);
-    $repl = $this->getTransport()->readLine();
-    $this->getTransport()->disconnect();
-
-    if($repl->section(":", 0)->toInt() == 404)
-    {
-      throw new TeamSpeak3_Adapter_TSDNS_Exception("unable to resolve TSDNS hostname (" . $tsdns . ")");
-    }
-
-    TeamSpeak3_Helper_Signal::getInstance()->emit("tsdnsResolved", $tsdns, $repl);
-
-    return $repl;
-  }
-}

+ 0 - 32
protocol/TeamSpeak3/Adapter/TSDNS/Exception.php

@@ -1,32 +0,0 @@
-<?php
-
-/**
- * @file
- * TeamSpeak 3 PHP Framework
- *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * @package   TeamSpeak3
- * @version   1.1.24
- * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
- */
-
-/**
- * @class TeamSpeak3_Adapter_TSDNS_Exception
- * @brief Enhanced exception class for TeamSpeak3_Adapter_TSDNS objects.
- */
-class TeamSpeak3_Adapter_TSDNS_Exception extends TeamSpeak3_Adapter_Exception {}

+ 0 - 216
protocol/TeamSpeak3/Adapter/Update.php

@@ -1,216 +0,0 @@
-<?php
-
-/**
- * @file
- * TeamSpeak 3 PHP Framework
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * @package   TeamSpeak3
- * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
- */
-
-/**
- * @deprecated
- *
- * @class TeamSpeak3_Adapter_Update
- * @brief Provides methods to query the latest TeamSpeak 3 build numbers from the master server.
- */
-class TeamSpeak3_Adapter_Update extends TeamSpeak3_Adapter_Abstract
-{
-  /**
-   * The IPv4 address or FQDN of the TeamSpeak Systems update server.
-   *
-   * @var string
-   */
-  protected $default_host = "update.teamspeak.com";
-
-  /**
-   * The UDP port number of the TeamSpeak Systems update server.
-   *
-   * @var integer
-   */
-  protected $default_port = 17384;
-
-  /**
-   * Stores an array containing the latest build numbers (integer timestamps).
-   *
-   * @var array
-   */
-  protected $build_datetimes = null;
-
-  /**
-   * Stores an array containing the latest version strings.
-   *
-   * @var array
-   */
-  protected $version_strings = null;
-
-  /**
-   * 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(33));
-
-    if(!preg_match_all("/,?(\d+)#([0-9a-zA-Z\._-]+),?/", $this->getTransport()->read(96), $matches) || !isset($matches[1]) || !isset($matches[2]))
-    {
-      throw new TeamSpeak3_Adapter_Update_Exception("invalid reply from the server");
-    }
-
-    $this->build_datetimes = $matches[1];
-    $this->version_strings = $matches[2];
-
-    TeamSpeak3_Helper_Signal::getInstance()->emit("updateConnected", $this);
-  }
-
-  /**
-   * The TeamSpeak3_Adapter_Update destructor.
-   *
-   * @return void
-   */
-  public function __destruct()
-  {
-    if($this->getTransport() instanceof TeamSpeak3_Transport_Abstract && $this->getTransport()->isConnected())
-    {
-      $this->getTransport()->disconnect();
-    }
-  }
-
-  /**
-   * Returns the current build number for a specified update channel. Note that since version
-   * 3.0.0, the build number represents an integer timestamp. $channel must be set to one of
-   * the following values:
-   *
-   * - stable
-   * - beta
-   * - alpha
-   * - server
-   *
-   * @param  string  $channel
-   * @throws TeamSpeak3_Adapter_Update_Exception
-   * @return integer
-   */
-  public function getRev($channel = "stable")
-  {
-    switch($channel)
-    {
-      case "stable":
-        return isset($this->build_datetimes[0]) ? $this->build_datetimes[0] : null;
-
-      case "beta":
-        return isset($this->build_datetimes[1]) ? $this->build_datetimes[1] : null;
-
-      case "alpha":
-        return isset($this->build_datetimes[2]) ? $this->build_datetimes[2] : null;
-
-      case "server":
-        return isset($this->build_datetimes[3]) ? $this->build_datetimes[3] : null;
-
-      default:
-        throw new TeamSpeak3_Adapter_Update_Exception("invalid update channel identifier (" . $channel . ")");
-    }
-  }
-
-  /**
-   * Returns the current version string for a specified update channel. $channel must be set to
-   * one of the following values:
-   *
-   * - stable
-   * - beta
-   * - alpha
-   * - server
-   *
-   * @param  string  $channel
-   * @throws TeamSpeak3_Adapter_Update_Exception
-   * @return integer
-   */
-  public function getVersion($channel = "stable")
-  {
-    switch($channel)
-    {
-      case "stable":
-        return isset($this->version_strings[0]) ? $this->version_strings[0] : null;
-
-      case "beta":
-        return isset($this->version_strings[1]) ? $this->version_strings[1] : null;
-
-      case "alpha":
-        return isset($this->version_strings[2]) ? $this->version_strings[2] : null;
-
-      case "server":
-        return isset($this->version_strings[3]) ? $this->version_strings[3] : null;
-
-      default:
-        throw new TeamSpeak3_Adapter_Update_Exception("invalid update channel identifier (" . $channel . ")");
-    }
-  }
-
-  /**
-   * Alias for getRev() using the 'stable' update channel.
-   *
-   * @param  string  $channel
-   * @return integer
-   */
-  public function getClientRev()
-  {
-    return $this->getRev("stable");
-  }
-
-  /**
-   * Alias for getRev() using the 'server' update channel.
-   *
-   * @param  string  $channel
-   * @return integer
-   */
-  public function getServerRev()
-  {
-    return $this->getRev("server");
-  }
-
-  /**
-   * Alias for getVersion() using the 'stable' update channel.
-   *
-   * @param  string  $channel
-   * @return integer
-   */
-  public function getClientVersion()
-  {
-    return $this->getVersion("stable");
-  }
-
-  /**
-   * Alias for getVersion() using the 'server' update channel.
-   *
-   * @param  string  $channel
-   * @return integer
-   */
-  public function getServerVersion()
-  {
-    return $this->getVersion("server");
-  }
-}

+ 0 - 32
protocol/TeamSpeak3/Adapter/Update/Exception.php

@@ -1,32 +0,0 @@
-<?php
-
-/**
- * @file
- * TeamSpeak 3 PHP Framework
- *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * @package   TeamSpeak3
- * @version   1.1.24
- * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
- */
-
-/**
- * @class TeamSpeak3_Adapter_Update_Exception
- * @brief Enhanced exception class for TeamSpeak3_Adapter_Update objects.
- */
-class TeamSpeak3_Adapter_Update_Exception extends TeamSpeak3_Adapter_Exception {}

+ 1 - 4
protocol/TeamSpeak3/Exception.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Helper/Char.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Char.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 18 - 0
protocol/TeamSpeak3/Helper/Convert.php

@@ -272,6 +272,24 @@ class TeamSpeak3_Helper_Convert
 
     return $array;
   }
+  
+  /**
+   * Converts a specified 32-bit unsigned integer value to a signed 32-bit integer value.
+   *
+   * @param  integer $unsigned
+   * @return integer
+   */
+  public static function iconId($unsigned)
+  {
+    $signed = (int) $unsigned;
+    
+    if(PHP_INT_SIZE > 4) // 64-bit
+    {
+      if($signed & 0x80000000) return $signed - 0x100000000;
+    }
+    
+    return $signed;
+  }
 
   /**
    * Converts a given string to a ServerQuery password hash.

+ 1 - 4
protocol/TeamSpeak3/Helper/Crypt.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Crypt.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Helper/Exception.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Helper/Profiler.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Profiler.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Helper/Profiler/Exception.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Helper/Profiler/Timer.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Timer.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Helper/Signal.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Signal.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Helper/Signal/Exception.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Helper/Signal/Handler.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Handler.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 14
protocol/TeamSpeak3/Helper/Signal/Interface.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Interface.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -37,8 +34,6 @@ interface TeamSpeak3_Helper_Signal_Interface
    * === Examples ===
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryConnected", array($object, "onConnect"));
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("filetransferConnected", array($object, "onConnect"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("blacklistConnected", array($object, "onConnect"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("updateConnected", array($object, "onConnect"));
    *
    * @param  TeamSpeak3_Adapter_Abstract $adapter
    * @return void
@@ -51,8 +46,6 @@ interface TeamSpeak3_Helper_Signal_Interface
    * === Examples ===
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryDisconnected", array($object, "onDisconnect"));
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("filetransferDisconnected", array($object, "onDisconnect"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("blacklistDisconnected", array($object, "onDisconnect"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("updateDisconnected", array($object, "onDisconnect"));
    *
    * @return void
    */
@@ -303,8 +296,6 @@ interface TeamSpeak3_Helper_Signal_Interface
    * === Examples ===
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryDataRead", array($object, "onDebugDataRead"));
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("filetransferDataRead", array($object, "onDebugDataRead"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("blacklistDataRead", array($object, "onDebugDataRead"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("updateDataRead", array($object, "onDebugDataRead"));
    *
    * @param  string $data
    * @return void
@@ -317,8 +308,6 @@ interface TeamSpeak3_Helper_Signal_Interface
    * === Examples ===
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryDataSend", array($object, "onDebugDataSend"));
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("filetransferDataSend", array($object, "onDebugDataSend"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("blacklistDataSend", array($object, "onDebugDataSend"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("updateDataSend", array($object, "onDebugDataSend"));
    *
    * @param  string $data
    * @return void
@@ -331,8 +320,6 @@ interface TeamSpeak3_Helper_Signal_Interface
    * === Examples ===
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryWaitTimeout", array($object, "onWaitTimeout"));
    *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("filetransferWaitTimeout", array($object, "onWaitTimeout"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("blacklistWaitTimeout", array($object, "onWaitTimeout"));
-   *   - TeamSpeak3_Helper_Signal::getInstance()->subscribe("updateWaitTimeout", array($object, "onWaitTimeout"));
    *
    * @param  integer $time
    * @param  TeamSpeak3_Adapter_Abstract $adapter

+ 2 - 5
protocol/TeamSpeak3/Helper/String.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: String.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -460,7 +457,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
     $pattern[] = "[\xF1-\xF3][\x80-\xBF]{3}";         // planes 4-15
     $pattern[] = "\xF4[\x80-\x8F][\x80-\xBF]{2}";     // plane 16
 
-    return preg_match("%(?:" . implode("|", $pattern) . ")+%xs", $this->string);
+    return boolval(preg_match("%(?:" . implode("|", $pattern) . ")+%xs", $this->string));
   }
 
   /**

+ 8 - 11
protocol/TeamSpeak3/Helper/Uri.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Uri.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -269,7 +266,7 @@ class TeamSpeak3_Helper_Uri
    */
   public function getUser($default = null)
   {
-    return ($this->hasUser()) ? new TeamSpeak3_Helper_String($this->user) : $default;
+    return ($this->hasUser()) ? new TeamSpeak3_Helper_String(urldecode($this->user)) : $default;
   }
 
   /**
@@ -319,7 +316,7 @@ class TeamSpeak3_Helper_Uri
    */
   public function getPass($default = null)
   {
-    return ($this->hasPass()) ? new TeamSpeak3_Helper_String($this->pass) : $default;
+    return ($this->hasPass()) ? new TeamSpeak3_Helper_String(urldecode($this->pass)) : $default;
   }
 
   /**
@@ -356,7 +353,7 @@ class TeamSpeak3_Helper_Uri
    */
   public function getHost($default = null)
   {
-    return ($this->hasHost()) ? new TeamSpeak3_Helper_String($this->host) : $default;
+    return ($this->hasHost()) ? new TeamSpeak3_Helper_String(rawurldecode($this->host)) : $default;
   }
 
   /**
@@ -444,7 +441,7 @@ class TeamSpeak3_Helper_Uri
    */
   public function getPath($default = null)
   {
-    return ($this->hasPath()) ? new TeamSpeak3_Helper_String($this->path) : $default;
+    return ($this->hasPath()) ? new TeamSpeak3_Helper_String(rawurldecode($this->path)) : $default;
   }
 
   /**
@@ -500,7 +497,7 @@ class TeamSpeak3_Helper_Uri
       return $default;
     }
 
-    parse_str($this->query, $queryArray);
+    parse_str(rawurldecode($this->query), $queryArray);
 
     return $queryArray;
   }
@@ -530,7 +527,7 @@ class TeamSpeak3_Helper_Uri
   {
     if(!$this->hasQuery()) return $default;
 
-    parse_str($this->query, $queryArray);
+    parse_str(rawurldecode($this->query), $queryArray);
 
     if(array_key_exists($key, $queryArray))
     {
@@ -601,7 +598,7 @@ class TeamSpeak3_Helper_Uri
    */
   public function getFragment($default = null)
   {
-    return ($this->hasFragment()) ? new TeamSpeak3_Helper_String($this->fragment) : $default;
+    return ($this->hasFragment()) ? new TeamSpeak3_Helper_String(rawurldecode($this->fragment)) : $default;
   }
 
   /**

+ 3 - 6
protocol/TeamSpeak3/Node/Abstract.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Abstract.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -289,7 +286,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces
         }
         elseif($key->contains("_packetloss_"))
         {
-          $info[$key->toString()] = sprintf("%01.2f", floatval($val->toString())*100) . "%";
+          $info[$key->toString()] = sprintf("%01.2f", floatval($val instanceof TeamSpeak3_Helper_String ? $val->toString() : strval($val))*100) . "%";
         }
         elseif($key->endsWith("_uptime"))
         {
@@ -579,7 +576,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces
 
     if(!$this->offsetExists($offset))
     {
-      throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid parameter", 0x602);
+      throw new TeamSpeak3_Node_Exception("node '" . get_class($this) . "' has no property named '" . $offset . "'");
     }
 
     return $this->nodeInfo[(string) $offset];

+ 4 - 7
protocol/TeamSpeak3/Node/Channel.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Channel.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -83,12 +80,12 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
    */
   public function subChannelGetById($cid)
   {
-    if(!array_key_exists((string) $cid, $this->subChannelList()))
+    if(!array_key_exists((int) $cid, $this->subChannelList()))
     {
       throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
     }
 
-    return $this->channelList[(string) $cid];
+    return $this->channelList[(int) $cid];
   }
 
   /**
@@ -112,7 +109,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
    * Returns an array filled with TeamSpeak3_Node_Client objects.
    *
    * @param  array $filter
-   * @return array|TeamSpeak3_Node_Client[]
+   * @return array | TeamSpeak3_Node_Client[]
    */
   public function clientList(array $filter = array())
   {

+ 8 - 8
protocol/TeamSpeak3/Node/Channelgroup.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Channelgroup.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -146,13 +143,16 @@ class TeamSpeak3_Node_Channelgroup extends TeamSpeak3_Node_Abstract
   }
 
   /**
-   * Returns a list of clients assigned to the server group specified.
+   * Returns a list of clients assigned to the channel group specified.
    *
-   * @return array|TeamSpeak3_Node_Client[]
+   * @param  integer $cid
+   * @param  integer $cldbid
+   * @param  boolean $resolve
+   * @return array
    */
-  public function clientList()
+  public function clientList($cid = null, $cldbid = null, $resolve = FALSE)
   {
-    return $this->getParent()->channelGroupClientList($this->getId());
+    return $this->getParent()->channelGroupClientList($this->getId(), $cid, $cldbid, $resolve);
   }
 
   /**

+ 7 - 7
protocol/TeamSpeak3/Node/Client.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Client.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -320,14 +317,17 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
    */
   public function memberOf()
   {
-    $groups = array($this->getParent()->channelGroupGetById($this["client_channel_group_id"]));
+    $cgroups = array($this->getParent()->channelGroupGetById($this["client_channel_group_id"]));
+    $sgroups = array();
 
     foreach(explode(",", $this["client_servergroups"]) as $sgid)
     {
-      $groups[] = $this->getParent()->serverGroupGetById($sgid);
+      $sgroups[] = $this->getParent()->serverGroupGetById($sgid);
     }
 
-    return $groups;
+    uasort($sgroups, array(__CLASS__, "sortGroupList"));
+
+    return array_merge($cgroups, $sgroups);
   }
 
   /**

+ 1 - 4
protocol/TeamSpeak3/Node/Exception.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 38
protocol/TeamSpeak3/Node/Host.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Host.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -307,40 +304,6 @@ class TeamSpeak3_Node_Host extends TeamSpeak3_Node_Abstract
     throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400);
   }
 
-  /**
-   * Returns the first TeamSpeak3_Node_Server object matching the given TSDNS hostname. Like the
-   * TeamSpeak 3 Client, this method will start looking for a TSDNS server on the second-level
-   * domain including a fallback to the third-level domain of the specified $tsdns parameter.
-   *
-   * @param  string $tsdns
-   * @throws TeamSpeak3_Adapter_ServerQuery_Exception
-   * @return TeamSpeak3_Node_Server
-   */
-  public function serverGetByTSDNS($tsdns)
-  {
-    $parts = TeamSpeak3_Helper_Uri::getFQDNParts($tsdns);
-    $query = TeamSpeak3_Helper_String::factory(array_shift($parts));
-
-    while($part = array_shift($parts))
-    {
-      $query->prepend($part);
-
-      try
-      {
-        $port = TeamSpeak3::factory("tsdns://" . $query . "/?timeout=3")->resolve($tsdns)->section(":", 1);
-
-        return $this->serverGetByPort($port == "" ? 9987 : $port);
-      }
-      catch(TeamSpeak3_Transport_Exception $e)
-      {
-        /* skip "Connection timed out" and "Connection refused" */
-        if($e->getCode() != 10060 && $e->getCode() != 10061) throw $e;
-      }
-    }
-
-    throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400);
-  }
-
   /**
    * Creates a new virtual server using given properties and returns an assoc
    * array containing the new ID and initial admin token.

+ 64 - 24
protocol/TeamSpeak3/Node/Server.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Server.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -126,6 +123,22 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
     $this->channelList = null;
   }
 
+  /**
+   * Returns the TeamSpeak3_Node_Channel object representing the default channel.
+   *
+   * @throws TeamSpeak3_Adapter_ServerQuery_Exception
+   * @return TeamSpeak3_Node_Channel
+   */
+  public function channelGetDefault()
+  {
+    foreach($this->channelList() as $channel)
+    {
+      if($channel["channel_flag_default"]) return $channel;
+    }
+
+    throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
+  }
+
   /**
    * Creates a new channel using given properties and returns the new ID.
    *
@@ -625,7 +638,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
    * Returns an array filled with TeamSpeak3_Node_Client objects.
    *
    * @param  array $filter
-   * @return array|TeamSpeak3_Node_Client[]
+   * @return array | TeamSpeak3_Node_Client[]
    */
   public function clientList(array $filter = array())
   {
@@ -707,7 +720,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
   }
 
   /**
-   * Returns a list of client database IDs matching a given pattern. You can either search for a clients
+   * Returns a list of client database information matching a given pattern. You can either search for a clients
    * last known nickname or his unique identity by using the $uid option.
    *
    * @param  string  $pattern
@@ -716,7 +729,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
    */
   public function clientFindDb($pattern, $uid = FALSE)
   {
-    return array_keys($this->execute("clientdbfind", array("pattern" => $pattern, ($uid) ? "-uid" : null))->toAssocArray("cldbid"));
+    return array_keys($this->execute("clientdbfind", array("pattern" => $pattern, ($uid) ? "-uid" : null, "-details"))->toAssocArray("cldbid"));
   }
 
   /**
@@ -1023,7 +1036,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
    * Returns a list of server groups available.
    *
    * @param  filter $filter
-   * @return array|TeamSpeak3_Node_Servergroup[]
+   * @return array | TeamSpeak3_Node_Servergroup[]
    */
   public function serverGroupList(array $filter = array())
   {
@@ -1261,28 +1274,25 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
    * Returns an ordered array of regular server groups available based on a pre-defined
    * set of rules.
    *
+   * @param  integer $type
    * @return array
    */
-  public function serverGroupGetProfiles()
+  public function serverGroupGetProfiles($type = TeamSpeak3::GROUP_DBTYPE_REGULAR)
   {
     $profiles = array();
 
     foreach($this->serverGroupList() as $sgid => $sgroup)
     {
-      if($sgroup["type"] != TeamSpeak3::GROUP_DBTYPE_REGULAR) continue;
+      if($sgroup["type"] != $type) continue;
 
       $profiles[$sgid] = array(
         "b_permission_modify_power_ignore" => 0,
-        "i_group_needed_member_add_power" => 0,
         "i_group_member_add_power" => 0,
-        "i_group_needed_member_remove_power" => 0,
         "i_group_member_remove_power" => 0,
         "i_needed_modify_power_count" => 0,
         "i_needed_modify_power_total" => 0,
         "i_permission_modify_power" => 0,
-        "i_group_needed_modify_power" => 0,
         "i_group_modify_power" => 0,
-        "i_client_needed_modify_power" => 0,
         "i_client_modify_power" => 0,
         "b_virtualserver_servergroup_create" => 0,
         "b_virtualserver_servergroup_delete" => 0,
@@ -1338,11 +1348,12 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
    * the ID.
    *
    * @param  integer $mode
+   * @param  integer $type
    * @return TeamSpeak3_Node_Servergroup
    */
-  public function serverGroupIdentify($mode = TeamSpeak3::GROUP_IDENTIFIY_STRONGEST)
+  public function serverGroupIdentify($mode = TeamSpeak3::GROUP_IDENTIFIY_STRONGEST, $type = TeamSpeak3::GROUP_DBTYPE_REGULAR)
   {
-    $profiles = $this->serverGroupGetProfiles();
+    $profiles = $this->serverGroupGetProfiles($type);
 
     $best_guess_profile = ($mode == TeamSpeak3::GROUP_IDENTIFIY_STRONGEST) ? array_shift($profiles) : array_pop($profiles);
 
@@ -1353,7 +1364,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
    * Returns a list of channel groups available.
    *
    * @param  array $filter
-   * @return array|TeamSpeak3_Node_Channelgroup[]
+   * @return array | TeamSpeak3_Node_Channelgroup[]
    */
   public function channelGroupList(array $filter = array())
   {
@@ -1550,16 +1561,37 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
    * @param  integer $cgid
    * @param  integer $cid
    * @param  integer $cldbid
+   * @param  boolean $resolve
    * @return array
    */
-  public function channelGroupClientList($cgid = null, $cid = null, $cldbid = null)
+  public function channelGroupClientList($cgid = null, $cid = null, $cldbid = null, $resolve = FALSE)
   {
     if($this["virtualserver_default_channel_group"] == $cgid)
     {
       return array();
     }
 
-    return $this->execute("channelgroupclientlist", array("cgid" => $cgid, "cid" => $cid, "cldbid" => $cldbid))->toArray();
+    try
+    {
+      $result = $this->execute("channelgroupclientlist", array("cgid" => $cgid, "cid" => $cid, "cldbid" => $cldbid))->toArray();
+    }
+    catch(TeamSpeak3_Adapter_ServerQuery_Exception $e)
+    {
+      /* ERROR_database_empty_result */
+      if($e->getCode() != 0x501) throw $e;
+
+      $result = array();
+    }
+
+    if($resolve)
+    {
+      foreach($result as $k => $v)
+      {
+        $result[$k] = array_merge($v, $this->clientInfoDb($v["cldbid"]));
+      }
+    }
+
+    return $result;
   }
 
   /**
@@ -1885,14 +1917,22 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
         break;
     }
 
-    $detail = $this->request("serversnapshotdeploy " . $data)->toList();
+    $detail = $this->request("serversnapshotdeploy -mapping " . $data)->toList();
+
+    if(array_key_exists("sid", $detail[0]))
+    {
+      TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServercreated", $this->getParent(), $detail[0]["sid"]);
 
-    if(array_key_exists("sid", $detail))
+      $server = array_shift($detail);
+    }
+    else
     {
-      TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServercreated", $this->getParent(), $detail["sid"]);
+      $server = array();
     }
 
-    return $detail;
+    $server["mapping"] = $detail;
+    
+    return $server;
   }
 
   /**
@@ -2413,7 +2453,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
    * @param  TeamSpeak3_Node_Abstract $b
    * @return integer
    */
-  public static function sortGroupList(TeamSpeak3_Node_Abstract $a, TeamSpeak3_Node_Abstract $b)
+  protected static function sortGroupList(TeamSpeak3_Node_Abstract $a, TeamSpeak3_Node_Abstract $b)
   {
     if(get_class($a) != get_class($b))
     {

+ 2 - 5
protocol/TeamSpeak3/Node/Servergroup.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Servergroup.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -150,7 +147,7 @@ class TeamSpeak3_Node_Servergroup extends TeamSpeak3_Node_Abstract
   /**
    * Returns a list of clients assigned to the server group specified.
    *
-   * @return array|TeamSpeak3_Node_Client[]
+   * @return array
    */
   public function clientList()
   {

+ 23 - 75
protocol/TeamSpeak3/TeamSpeak3.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: TeamSpeak3.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -34,12 +31,22 @@ class TeamSpeak3
   /**
    * TeamSpeak 3 protocol welcome message.
    */
-  const READY = "TS3";
+  const TS3_PROTO_IDENT = "TS3";
 
   /**
    * TeamSpeak 3 protocol greeting message prefix.
    */
-  const GREET = "Welcome";
+  const TS3_MOTD_PREFIX = "Welcome";
+
+  /**
+   * TeaSpeak protocol welcome message.
+   */
+  const TEA_PROTO_IDENT = "TeaSpeak";
+
+  /**
+   * TeaSpeak protocol greeting message prefix.
+   */
+  const TEA_MOTD_PREFIX = "Welcome";
 
   /**
    * TeamSpeak 3 protocol error message prefix.
@@ -59,7 +66,7 @@ class TeamSpeak3
   /**
    * TeamSpeak 3 PHP Framework version.
    */
-  const LIB_VERSION = "1.1.24";
+  const LIB_VERSION = "1.1.32";
 
   /*@
    * TeamSpeak 3 protocol separators.
@@ -284,7 +291,7 @@ class TeamSpeak3
    *   - no_query_clients
    *   - use_offline_as_virtual
    *   - clients_before_channels
-   *   - server_id|server_uid|server_port|server_name|server_tsdns
+   *   - server_id|server_uid|server_port|server_name
    *   - channel_id|channel_name
    *   - client_id|client_uid|client_name
    *
@@ -299,8 +306,6 @@ class TeamSpeak3
    *   - serverquery://127.0.0.1:10011/?server_port=9987&channel_id=1#no_query_clients
    *   - serverquery://127.0.0.1:10011/?server_port=9987&client_name=ScP
    *   - filetransfer://127.0.0.1:30011/
-   *   - blacklist
-   *   - update
    *
    * @param  string $uri
    * @return TeamSpeak3_Adapter_Abstract
@@ -315,7 +320,7 @@ class TeamSpeak3
     $uri = new TeamSpeak3_Helper_Uri($uri);
 
     $adapter = self::getAdapterName($uri->getScheme());
-    $options = array("host" => $uri->getHost(), "port" => $uri->getPort(), "timeout" => (int) $uri->getQueryVar("timeout", 10), "blocking" => (int) $uri->getQueryVar("blocking", 1));
+    $options = array("host" => $uri->getHost(), "port" => $uri->getPort(), "timeout" => (int) $uri->getQueryVar("timeout", 10), "blocking" => (int) $uri->getQueryVar("blocking", 1), "tls" => (int) $uri->getQueryVar("tls", 0));
 
     self::loadClass($adapter);
 
@@ -378,10 +383,6 @@ class TeamSpeak3
       {
         $node = $node->serverGetByName($uri->getQueryVar("server_name"));
       }
-      elseif($uri->hasQueryVar("server_tsdns"))
-      {
-        $node = $node->serverGetByTSDNS($uri->getQueryVar("server_tsdns"));
-      }
 
       if($node instanceof TeamSpeak3_Node_Server)
       {
@@ -624,7 +625,6 @@ class TeamSpeak3
  *   - Integrated full featured and customizable TSViewer interfaces
  *   - Full support for file transfers to up- and /or download custom icons and other stuff
  *   - Powerful error handling capablities using exceptions and customizable error messages
- *   - Query mechanisms for several official services such as the blacklist and auto-update servers
  *   - Dynamic signal slots for event based scripting
  *   - ...
  *
@@ -788,59 +788,7 @@ class TeamSpeak3
  *   ));
  * @endcode
  *
- * \subsection example9 9. Send a Text Message to outdated Clients
- * @code
- *   // load framework files
- *   require_once("libraries/TeamSpeak3/TeamSpeak3.php");
- *
- *   // connect to local server, authenticate and spawn an object for the virtual server on port 9987
- *   $ts3_VirtualServer = TeamSpeak3::factory("serverquery://username:[email protected]:10011/?server_port=9987");
- *
- *   // connect to default update server
- *   $ts3_UpdateServer = TeamSpeak3::factory("update");
- *
- *   // walk through list of clients on virtual server
- *   foreach($ts3_VirtualServer->clientList() as $ts3_Client)
- *   {
- *     // skip query clients
- *     if($ts3_Client["client_type"]) continue;
- *
- *     // send test message if client build is outdated
- *     if($ts3_Client->getRev() < $ts3_UpdateServer->getClientRev())
- *     {
- *       $ts3_Client->message("[COLOR=red]your client is [B]outdated[/B]... update to [U]" . $ts3_UpdateServer->getClientVersion() . "[/U] now![/COLOR]");
- *     }
- *   }
- * @endcode
- *
- * \subsection example10 10. Check if the Server Instance is Outdated or Blacklisted
- * @code
- *   // load framework files
- *   require_once("libraries/TeamSpeak3/TeamSpeak3.php");
- *
- *   // connect to local server, authenticate and spawn an object for the server instance
- *   $ts3_ServerInstance = TeamSpeak3::factory("serverquery://username:[email protected]:10011/");
- *
- *   // connect to default update server
- *   $ts3_UpdateServer = TeamSpeak3::factory("update");
- *
- *   // send global text message if the server is outdated
- *   if($ts3_ServerInstance->version("build") < $ts3_UpdateServer->getServerRev())
- *   {
- *     $ts3_ServerInstance->message("[COLOR=red]your server is [B]outdated[/B]... update to [U]" . $ts3_UpdateServer->getServerVersion() . "[/U]  now![/COLOR]");
- *   }
- *
- *   // connect to default blacklist server
- *   $ts3_BlacklistServer = TeamSpeak3::factory("blacklist");
- *
- *   // send global text message if the server is blacklisted
- *   if($ts3_BlacklistServer->isBlacklisted($ts3_ServerInstance))
- *   {
- *     $ts3_ServerInstance->message("[COLOR=red]your server is [B]blacklisted[/B]... disconnect now![/COLOR]");
- *   }
- * @endcode
- *
- * \subsection example11 11. Create a simple TSViewer for your Website
+ * \subsection example9 9. Create a simple TSViewer for your Website
  * @code
  *   // load framework files
  *   require_once("libraries/TeamSpeak3/TeamSpeak3.php");
@@ -852,7 +800,7 @@ class TeamSpeak3
  *   echo $ts3_VirtualServer->getViewer(new TeamSpeak3_Viewer_Html("images/viewericons/", "images/countryflags/", "data:image"));
  * @endcode
  *
- * \subsection example12 12. Update all outdated Audio Codecs to their Opus equivalent
+ * \subsection example10 10. Update all outdated Audio Codecs to their Opus equivalent
  * @code
  *   // load framework files
  *   require_once("libraries/TeamSpeak3/TeamSpeak3.php");
@@ -874,7 +822,7 @@ class TeamSpeak3
  *   }
  * @endcode
  *
- * \subsection example13 13. Display the Avatar of a connected User
+ * \subsection example11 11. Display the Avatar of a connected User
  * @code
  *   // load framework files
  *   require_once("libraries/TeamSpeak3/TeamSpeak3.php");
@@ -893,7 +841,7 @@ class TeamSpeak3
  *   echo $avatar;
  * @endcode
  *
- * \subsection example14 14. Create a Simple Bot waiting for Events
+ * \subsection example12 12. Create a Simple Bot waiting for Events
  * @code
  *   // load framework files
  *   require_once("libraries/TeamSpeak3/TeamSpeak3.php");
@@ -917,7 +865,7 @@ class TeamSpeak3
  *   }
  * @endcode
  *
- * \subsection example15 15. Handle Errors using Exceptions and Custom Error Messages
+ * \subsection example13 13. Handle Errors using Exceptions and Custom Error Messages
  * @code
  *   // load framework files
  *   require_once("libraries/TeamSpeak3/TeamSpeak3.php");
@@ -940,7 +888,7 @@ class TeamSpeak3
  *   }
  * @endcode
  *
- * \subsection example16 16. Save Connection State in Persistent Session Variable
+ * \subsection example14 14. Save Connection State in Persistent Session Variable
  * @code
  *   // load framework files
  *   require_once("libraries/TeamSpeak3/TeamSpeak3.php");
@@ -955,7 +903,7 @@ class TeamSpeak3
  *   $_SESSION["_TS3"] = serialize($ts3_VirtualServer);
  * @endcode
  *
- * \subsection example17 17. Restore Connection State from Persistent Session Variable
+ * \subsection example15 15. Restore Connection State from Persistent Session Variable
  * @code
  *   // load framework files
  *   require_once("libraries/TeamSpeak3/TeamSpeak3.php");

+ 1 - 4
protocol/TeamSpeak3/Transport/Abstract.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Abstract.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Transport/Exception.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 9 - 6
protocol/TeamSpeak3/Transport/TCP.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: TCP.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -45,15 +42,21 @@ class TeamSpeak3_Transport_TCP extends TeamSpeak3_Transport_Abstract
     $port = strval($this->config["port"]);
 
     $address = "tcp://" . (strstr($host, ":") !== FALSE ? "[" . $host . "]" : $host) . ":" . $port;
+    $options = empty($this->config["tls"]) ? array() : array("ssl" => array("allow_self_signed" => TRUE, "verify_peer" => FALSE, "verify_peer_name" => FALSE));
     $timeout = (int) $this->config["timeout"];
 
-    $this->stream = @stream_socket_client($address, $errno, $errstr, $timeout);
+    $this->stream = @stream_socket_client($address, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, stream_context_create($options));
 
     if($this->stream === FALSE)
     {
       throw new TeamSpeak3_Transport_Exception(TeamSpeak3_Helper_String::factory($errstr)->toUtf8()->toString(), $errno);
     }
 
+    if(!empty($this->config["tls"]))
+    {
+      stream_socket_enable_crypto($this->stream, TRUE, STREAM_CRYPTO_METHOD_SSLv23_CLIENT);
+    }
+
     @stream_set_timeout($this->stream, $timeout);
     @stream_set_blocking($this->stream, $this->config["blocking"] ? 1 : 0);
   }
@@ -147,7 +150,7 @@ class TeamSpeak3_Transport_TCP extends TeamSpeak3_Transport_Abstract
   {
     $this->connect();
 
-    @stream_socket_sendto($this->stream, $data);
+    @fwrite($this->stream, $data);
 
     TeamSpeak3_Helper_Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataSend", $data);
   }

+ 1 - 4
protocol/TeamSpeak3/Transport/UDP.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: UDP.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 2 - 23
protocol/TeamSpeak3/Viewer/Html.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Text.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**
@@ -548,25 +545,7 @@ class TeamSpeak3_Viewer_Html implements TeamSpeak3_Viewer_Interface
       }
     }
 
-    // Get current groups the client is a member of.
-    // Shift off first group (channel group), leaving only server groups.
-    $groups = $this->currObj->memberOf();
-    $clientGroups = [$groups[0]];
-    unset($groups[0]);
-
-    // Create temp assoc array to use in custom uasort function.
-    $sgroups = [];
-    foreach($groups as $group) {
-      $sgroups[$group['sgid']] = $group;
-    }
-    // Use same server group sort function from TeamSpeak3_Node_Server class.
-    uasort($sgroups, array(get_class($this->currObj->getParent()), "sortGroupList"));
-
-    // Append first group (channel group), convert to non-assoc array.
-    $clientGroups = array_merge($clientGroups, array_values($sgroups));
-    unset($sgroups); // Clean-up temp sorting array.
-
-    foreach($clientGroups as $group)
+    foreach($this->currObj->memberOf() as $group)
     {
       if(!$group["iconid"]) continue;
 

+ 1 - 4
protocol/TeamSpeak3/Viewer/Interface.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Interface.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**

+ 1 - 4
protocol/TeamSpeak3/Viewer/Text.php

@@ -4,8 +4,6 @@
  * @file
  * TeamSpeak 3 PHP Framework
  *
- * $Id: Text.php 06/06/2016 22:27:13 scp@Svens-iMac $
- *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -20,9 +18,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * @package   TeamSpeak3
- * @version   1.1.24
  * @author    Sven 'ScP' Paulsen
- * @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
+ * @copyright Copyright (c) Planet TeamSpeak. All rights reserved.
  */
 
 /**