TeamSpeak 3 PHP Framework
1.1.12
|
Class describing a TeamSpeak 3 server instance and all it's parameters. More...
Public Member Functions | |
__construct (TeamSpeak3_Adapter_ServerQuery $squery) | |
The TeamSpeak3_Node_Host constructor. | |
serverSelectedId () | |
Returns the primary ID of the selected virtual server. | |
serverSelectedPort () | |
Returns the primary UDP port of the selected virtual server. | |
version ($ident=null) | |
Returns the servers version information including platform and build number. | |
serverSelect ($sid, $virtual =null) | |
Selects a virtual server by ID to allow further interaction. | |
serverSelectById ($sid, $virtual =null) | |
Alias for serverSelect(). | |
serverSelectByPort ($port, $virtual =null) | |
Selects a virtual server by UDP port to allow further interaction. | |
serverDeselect () | |
Deselects the active virtual server. | |
serverIdGetByPort ($port) | |
Returns the ID of a virtual server matching the given port. | |
serverGetPortById ($sid) | |
Returns the port of a virtual server matching the given ID. | |
serverGetSelected () | |
Returns the TeamSpeak3_Node_Server object matching the currently selected ID. | |
serverGetById ($sid) | |
Returns the TeamSpeak3_Node_Server object matching the given ID. | |
serverGetByPort ($port) | |
Returns the TeamSpeak3_Node_Server object matching the given port number. | |
serverGetByName ($name) | |
Returns the first TeamSpeak3_Node_Server object matching the given name. | |
serverGetByUid ($uid) | |
Returns the first TeamSpeak3_Node_Server object matching the given unique identifier. | |
serverGetByTSDNS ($tsdns) | |
Returns the first TeamSpeak3_Node_Server object matching the given TSDNS hostname. | |
serverCreate (array $properties=array()) | |
Creates a new virtual server using given properties and returns an assoc array containing the new ID and initial admin token. | |
serverDelete ($sid) | |
Deletes the virtual server specified by ID. | |
serverStart ($sid) | |
Starts the virtual server specified by ID. | |
serverStop ($sid) | |
Stops the virtual server specified by ID. | |
serverStopProcess () | |
Stops the entire TeamSpeak 3 Server instance by shutting down the process. | |
serverList (array $filter=array()) | |
Returns an array filled with TeamSpeak3_Node_Server objects. | |
serverListReset () | |
Resets the list of virtual servers. | |
bindingList () | |
Returns a list of IP addresses used by the server instance on multi-homed machines. | |
permissionList () | |
Returns a list of permissions available on the server instance. | |
permissionTree () | |
Returns an array filled with all permission categories known to the server including their ID, name and parent. | |
permissionFind ($permid) | |
Returns the IDs of all clients, channels or groups using the permission with the specified ID. | |
permissionGetIdByName ($name) | |
Returns the ID of the permission matching the given name. | |
permissionGetNameById ($permid) | |
Returns the name of the permission matching the given ID. | |
permissionGetCategoryById ($permid) | |
Returns the internal category of the permission matching the given ID. | |
permissionGetGrantById ($permid) | |
Returns the internal ID of the i_needed_modify_power_* or grant permission. | |
selfPermCheck ($permid) | |
Returns an array containing the value of a specified permission for your own client. | |
modify (array $properties) | |
Changes the server instance configuration using given properties. | |
message ($msg) | |
Sends a text message to all clients on all virtual servers in the TeamSpeak 3 Server instance. | |
logView ($lines=30, $begin_pos=null, $reverse=null, $instance=TRUE) | |
Displays a specified number of entries (1-100) from the servers log. | |
logAdd ($logmsg, $loglevel=TeamSpeak3::LOGLEVEL_INFO) | |
Writes a custom entry into the server instance log. | |
login ($username, $password) | |
Authenticates with the TeamSpeak 3 Server instance using given ServerQuery login credentials. | |
logout () | |
Deselects the active virtual server and logs out from the server instance. | |
whoami () | |
Returns information about your current ServerQuery connection. | |
whoamiGet ($ident, $default=null) | |
Returns a single value from the current ServerQuery connection info. | |
whoamiSet ($ident, $value=null) | |
Sets a single value in the current ServerQuery connection info. | |
whoamiReset () | |
Resets the current ServerQuery connection info. | |
getAdapterHost () | |
Returns the hostname or IPv4 address the adapter is connected to. | |
getAdapterPort () | |
Returns the network port the adapter is connected to. | |
setPredefinedQueryName ($name=null) | |
Sets a pre-defined nickname for ServerQuery clients which will be used automatically after selecting a virtual server. | |
getPredefinedQueryName () | |
Returns the pre-defined nickname for ServerQuery clients which will be used automatically after selecting a virtual server. | |
setExcludeQueryClients ($exclude=FALSE) | |
Sets the option to decide whether ServerQuery clients should be excluded from node lists or not. | |
getExcludeQueryClients () | |
Returns the option to decide whether ServerQuery clients should be excluded from node lists or not. | |
setUseOfflineAsVirtual ($virtual =FALSE) | |
Sets the option to decide whether offline servers will be started in virtual mode by default or not. | |
getUseOfflineAsVirtual () | |
Returns the option to decide whether offline servers will be started in virtual mode by default or not. | |
setLoadClientlistFirst ($first=FALSE) | |
Sets the option to decide whether clients should be sorted before sub-channels to support the new TeamSpeak 3 Client display mode or not. | |
getLoadClientlistFirst () | |
Returns the option to decide whether offline servers will be started in virtual mode by default or not. | |
getAdapter () | |
Returns the underlying TeamSpeak3_Adapter_ServerQuery object. | |
getUniqueId () | |
Returns a unique identifier for the node which can be used as a HTML property. | |
getIcon () | |
Returns the name of a possible icon to display the node object. | |
getSymbol () | |
Returns a symbol representing the node. | |
__wakeup () | |
Re-authenticates with the TeamSpeak 3 Server instance using given ServerQuery login credentials and re-selects a previously selected virtual server. | |
__toString () | |
Returns a string representation of this node. | |
request ($cmd) | |
Sends a prepared command to the server and returns the result. | |
prepare ($cmd, array $params=array()) | |
Uses given parameters and returns a prepared ServerQuery command. | |
execute ($cmd, array $params=array()) | |
Prepares and executes a ServerQuery command and returns the result. | |
getParent () | |
Returns the parent object of the current node. | |
getId () | |
Returns the primary ID of the current node. | |
iconIsLocal ($key) | |
Returns TRUE if the node icon has a local source. | |
iconGetName ($key) | |
Returns the internal path of the node icon. | |
getClass ($prefix="ts3_") | |
Returns a possible classname for the node which can be used as a HTML property. | |
getViewer (TeamSpeak3_Viewer_Interface $viewer) | |
Returns the HTML code to display a TeamSpeak 3 viewer. | |
getInfo ($extend=TRUE, $convert=FALSE) | |
Returns all information available on this node. | |
getProperty ($property, $default=null) | |
Returns the specified property or a pre-defined default value from the node info array. | |
toString () | |
Returns a string representation of this node. | |
toArray () | |
Returns an assoc array filled with current node info properties. | |
__call ($name, array $args) | |
Called whenever we're using an unknown method. | |
__sleep () | |
Commit pending data. | |
count () | |
| |
current () | |
| |
getChildren () | |
| |
hasChildren () | |
| |
hasNext () | |
| |
key () | |
| |
valid () | |
| |
next () | |
| |
rewind () | |
| |
offsetExists ($offset) | |
| |
offsetGet ($offset) | |
| |
offsetSet ($offset, $value) | |
| |
offsetUnset ($offset) | |
| |
__get ($offset) | |
| |
__set ($offset, $value) | |
| |
Protected Member Functions | |
fetchNodeList () | |
| |
fetchNodeInfo () | |
| |
filterList (array $nodes=array(), array $rules=array()) | |
Filters given node list array using specified filter rules. | |
setStorage ($key, $val) | |
Writes data to the internal storage array. | |
getStorage ($key, $default=null) | |
Returns data from the internal storage array. | |
delStorage ($key) | |
Deletes data from the internal storage array. | |
resetNodeInfo () | |
| |
verifyNodeList () | |
| |
resetNodeList () | |
| |
Protected Attributes | |
$whoami = null | |
| |
$version = null | |
| |
$serverList = null | |
| |
$permissionList = null | |
| |
$predefined_query_name = null | |
| |
$exclude_query_clients = FALSE | |
| |
$start_offline_virtual = FALSE | |
| |
$sort_clients_channels = FALSE | |
| |
$parent = null | |
| |
$server = null | |
| |
$nodeId = 0x00 | |
| |
$nodeList = null | |
| |
$nodeInfo = array() | |
| |
$storage = array() | |
|
Class describing a TeamSpeak 3 server instance and all it's parameters.
The TeamSpeak3_Node_Host constructor.
TeamSpeak3_Adapter_ServerQuery | $squery |
Definition at line 80 of file Host.php.
{ $this->parent = $squery; }
Returns the primary ID of the selected virtual server.
Definition at line 90 of file Host.php.
References whoamiGet().
Referenced by logAdd(), serverGetByPort(), serverGetSelected(), serverSelect(), serverStart(), and serverStop().
{ return $this->whoamiGet("virtualserver_id", 0); }
Returns the primary UDP port of the selected virtual server.
Definition at line 100 of file Host.php.
References whoamiGet().
Referenced by serverSelectByPort().
{ return $this->whoamiGet("virtualserver_port", 0); }
TeamSpeak3_Node_Host::version | ( | $ | ident = null | ) |
Returns the servers version information including platform and build number.
string | $ident |
Definition at line 111 of file Host.php.
References TeamSpeak3_Node_Abstract\request().
TeamSpeak3_Node_Host::serverSelect | ( | $ | sid, |
$ | virtual = null |
||
) |
Selects a virtual server by ID to allow further interaction.
integer | $sid | |
boolean | $virtual |
Definition at line 128 of file Host.php.
References TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Helper_Signal\getInstance(), serverSelectedId(), TeamSpeak3_Node_Abstract\setStorage(), whoami(), and whoamiReset().
Referenced by logAdd(), serverDeselect(), and serverSelectById().
{ if($this->whoami !== null && $this->serverSelectedId() == $sid) return; $virtual = ($virtual !== null) ? $virtual : $this->start_offline_virtual; $getargs = func_get_args(); $this->execute("use", array("sid" => $sid, $virtual ? "-virtual" : null)); if($sid != 0 && $this->predefined_query_name !== null) { $this->execute("clientupdate", array("client_nickname" => (string) $this->predefined_query_name)); } $this->whoamiReset(); $this->setStorage("_server_use", array(__FUNCTION__, $getargs)); TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServerselected", $this); }
TeamSpeak3_Node_Host::serverSelectById | ( | $ | sid, |
$ | virtual = null |
||
) |
Alias for serverSelect().
integer | $sid | |
boolean | $virtual |
Definition at line 156 of file Host.php.
References serverSelect().
Referenced by serverGetById().
{ $this->serverSelect($sid, $virtual); }
TeamSpeak3_Node_Host::serverSelectByPort | ( | $ | port, |
$ | virtual = null |
||
) |
Selects a virtual server by UDP port to allow further interaction.
integer | $port | |
boolean | $virtual |
Definition at line 168 of file Host.php.
References TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Helper_Signal\getInstance(), serverSelectedPort(), TeamSpeak3_Node_Abstract\setStorage(), whoami(), and whoamiReset().
Referenced by serverGetByPort().
{ if($this->whoami !== null && $this->serverSelectedPort() == $port) return; $virtual = ($virtual !== null) ? $virtual : $this->start_offline_virtual; $getargs = func_get_args(); $this->execute("use", array("port" => $port, $virtual ? "-virtual" : null)); if($port != 0 && $this->predefined_query_name !== null) { $this->execute("clientupdate", array("client_nickname" => (string) $this->predefined_query_name)); } $this->whoamiReset(); $this->setStorage("_server_use", array(__FUNCTION__, $getargs)); TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServerselected", $this); }
Deselects the active virtual server.
Definition at line 194 of file Host.php.
References TeamSpeak3_Node_Abstract\delStorage(), and serverSelect().
Referenced by logAdd(), serverStart(), and serverStop().
{ $this->serverSelect(0); $this->delStorage("_server_use"); }
TeamSpeak3_Node_Host::serverIdGetByPort | ( | $ | port | ) |
Returns the ID of a virtual server matching the given port.
integer | $port |
Definition at line 207 of file Host.php.
References TeamSpeak3_Node_Abstract\execute().
{ $sid = $this->execute("serveridgetbyport", array("virtualserver_port" => $port))->toList(); return $sid["server_id"]; }
Returns the port of a virtual server matching the given ID.
integer | $sid |
Definition at line 220 of file Host.php.
References serverList().
{ if(!array_key_exists((string) $sid, $this->serverList())) { throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400); } return $this->serverList[intval((string) $sid)]["virtualserver_port"]; }
Returns the TeamSpeak3_Node_Server object matching the currently selected ID.
Definition at line 235 of file Host.php.
References serverGetById(), and serverSelectedId().
{ return $this->serverGetById($this->serverSelectedId()); }
TeamSpeak3_Node_Host::serverGetById | ( | $ | sid | ) |
Returns the TeamSpeak3_Node_Server object matching the given ID.
integer | $sid |
Definition at line 246 of file Host.php.
References serverSelectById().
Referenced by serverGetSelected().
{ $this->serverSelectById($sid); return new TeamSpeak3_Node_Server($this, array("virtualserver_id" => intval($sid))); }
TeamSpeak3_Node_Host::serverGetByPort | ( | $ | port | ) |
Returns the TeamSpeak3_Node_Server object matching the given port number.
integer | $port |
Definition at line 259 of file Host.php.
References serverSelectByPort(), and serverSelectedId().
Referenced by serverGetByTSDNS().
{ $this->serverSelectByPort($port); return new TeamSpeak3_Node_Server($this, array("virtualserver_id" => $this->serverSelectedId())); }
TeamSpeak3_Node_Host::serverGetByName | ( | $ | name | ) |
Returns the first TeamSpeak3_Node_Server object matching the given name.
string | $name |
TeamSpeak3_Adapter_ServerQuery_Exception |
Definition at line 273 of file Host.php.
References TeamSpeak3_Node_Abstract\$server, and serverList().
{ foreach($this->serverList() as $server) { if($server["virtualserver_name"] == $name) return $server; } throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400); }
TeamSpeak3_Node_Host::serverGetByUid | ( | $ | uid | ) |
Returns the first TeamSpeak3_Node_Server object matching the given unique identifier.
string | $uid |
TeamSpeak3_Adapter_ServerQuery_Exception |
Definition at line 290 of file Host.php.
References TeamSpeak3_Node_Abstract\$server, and serverList().
{ foreach($this->serverList() as $server) { if($server["virtualserver_unique_identifier"] == $uid) return $server; } throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400); }
TeamSpeak3_Node_Host::serverGetByTSDNS | ( | $ | tsdns | ) |
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.
string | $tsdns |
TeamSpeak3_Adapter_ServerQuery_Exception |
Definition at line 309 of file Host.php.
References TeamSpeak3_Helper_String\factory(), TeamSpeak3\factory(), TeamSpeak3_Helper_Uri\getFQDNParts(), and serverGetByPort().
{ $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); }
TeamSpeak3_Node_Host::serverCreate | ( | array $ | properties = array() | ) |
Creates a new virtual server using given properties and returns an assoc array containing the new ID and initial admin token.
array | $properties |
Definition at line 341 of file Host.php.
References TeamSpeak3_Node_Abstract\$server, TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Helper_Signal\getInstance(), and serverListReset().
{ $this->serverListReset(); $detail = $this->execute("servercreate", $properties)->toList(); $server = new TeamSpeak3_Node_Server($this, array("virtualserver_id" => intval($detail["sid"]))); TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServercreated", $this, $detail["sid"]); TeamSpeak3_Helper_Signal::getInstance()->emit("notifyTokencreated", $server, $detail["token"]); return $detail; }
TeamSpeak3_Node_Host::serverDelete | ( | $ | sid | ) |
Deletes the virtual server specified by ID.
integer | $sid |
Definition at line 360 of file Host.php.
References TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Helper_Signal\getInstance(), and serverListReset().
{ $this->serverListReset(); $this->execute("serverdelete", array("sid" => $sid)); TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServerdeleted", $this, $sid); }
TeamSpeak3_Node_Host::serverStart | ( | $ | sid | ) |
Starts the virtual server specified by ID.
integer | $sid |
Definition at line 375 of file Host.php.
References TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Helper_Signal\getInstance(), serverDeselect(), serverListReset(), and serverSelectedId().
{ if($sid == $this->serverSelectedId()) { $this->serverDeselect(); } $this->execute("serverstart", array("sid" => $sid)); $this->serverListReset(); TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServerstarted", $this, $sid); }
TeamSpeak3_Node_Host::serverStop | ( | $ | sid | ) |
Stops the virtual server specified by ID.
integer | $sid |
Definition at line 394 of file Host.php.
References TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Helper_Signal\getInstance(), serverDeselect(), serverListReset(), and serverSelectedId().
{ if($sid == $this->serverSelectedId()) { $this->serverDeselect(); } $this->execute("serverstop", array("sid" => $sid)); $this->serverListReset(); TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServerstopped", $this, $sid); }
Stops the entire TeamSpeak 3 Server instance by shutting down the process.
Definition at line 412 of file Host.php.
References TeamSpeak3_Node_Abstract\execute(), and TeamSpeak3_Helper_Signal\getInstance().
{ TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServershutdown", $this); $this->execute("serverprocessstop"); }
TeamSpeak3_Node_Host::serverList | ( | array $ | filter = array() | ) |
Returns an array filled with TeamSpeak3_Node_Server objects.
array | $filter |
Definition at line 425 of file Host.php.
References TeamSpeak3_Node_Abstract\$server, TeamSpeak3_Node_Abstract\filterList(), TeamSpeak3_Node_Abstract\request(), and TeamSpeak3_Node_Abstract\resetNodeList().
Referenced by fetchNodeList(), serverGetByName(), serverGetByUid(), serverGetPortById(), and serverListReset().
{ if($this->serverList === null) { $servers = $this->request("serverlist -uid")->toAssocArray("virtualserver_id"); $this->serverList = array(); foreach($servers as $sid => $server) { $this->serverList[$sid] = new TeamSpeak3_Node_Server($this, $server); } $this->resetNodeList(); } return $this->filterList($this->serverList, $filter); }
Resets the list of virtual servers.
Definition at line 449 of file Host.php.
References TeamSpeak3_Node_Abstract\resetNodeList(), and serverList().
Referenced by serverCreate(), serverDelete(), serverStart(), and serverStop().
{ $this->resetNodeList(); $this->serverList = null; }
Returns a list of IP addresses used by the server instance on multi-homed machines.
Definition at line 460 of file Host.php.
References TeamSpeak3_Node_Abstract\request().
{ return $this->request("bindinglist")->toArray(); }
Returns a list of permissions available on the server instance.
Definition at line 470 of file Host.php.
References permissionGetCategoryById(), permissionGetGrantById(), and TeamSpeak3_Node_Abstract\request().
Referenced by permissionGetIdByName(), permissionGetNameById(), and permissionTree().
{ if($this->permissionList === null) { $this->permissionList = $this->request("permissionlist")->toAssocArray("permname"); foreach($this->permissionList as $permname => $permdata) { $this->permissionList[$permname]["permcatid"] = $this->permissionGetCategoryById($permdata["permid"]); $this->permissionList[$permname]["permgrant"] = $this->permissionGetGrantById($permdata["permid"]); } } return $this->permissionList; }
Returns an array filled with all permission categories known to the server including their ID, name and parent.
Definition at line 492 of file Host.php.
References TeamSpeak3_Helper_String\factory(), TeamSpeak3_Helper_Convert\permissionCategory(), permissionGetCategoryById(), and permissionList().
{ $permtree = array(); $reflects = new ReflectionClass("TeamSpeak3"); foreach($reflects->getConstants() as $key => $val) { if(!TeamSpeak3_Helper_String::factory($key)->startsWith("PERM_CAT") || $val == 0xFF) { continue; } $permtree[$val]["permcatid"] = $val; $permtree[$val]["permcathex"] = "0x" . dechex($val); $permtree[$val]["permcatname"] = TeamSpeak3_Helper_String::factory(TeamSpeak3_Helper_Convert::permissionCategory($val)); $permtree[$val]["permcatparent"] = $permtree[$val]["permcathex"]{3} == 0 ? 0 : hexdec($permtree[$val]["permcathex"]{2} . 0); $permtree[$val]["permcatchilren"] = 0; $permtree[$val]["permcatcount"] = 0; if(isset($permtree[$permtree[$val]["permcatparent"]])) { $permtree[$permtree[$val]["permcatparent"]]["permcatchilren"]++; } if($permtree[$val]["permcatname"]->contains("/")) { $permtree[$val]["permcatname"] = $permtree[$val]["permcatname"]->section("/", 1)->trim(); } foreach($this->permissionList() as $permission) { if($this->permissionGetCategoryById($permission["permid"]) == $val) { $permtree[$val]["permcatcount"]++; } } } return $permtree; }
TeamSpeak3_Node_Host::permissionFind | ( | $ | permid | ) |
Returns the IDs of all clients, channels or groups using the permission with the specified ID.
integer | $permid |
Definition at line 540 of file Host.php.
References TeamSpeak3_Node_Abstract\current(), and TeamSpeak3_Node_Abstract\execute().
Returns the ID of the permission matching the given name.
string | $name |
TeamSpeak3_Adapter_ServerQuery_Exception |
Definition at line 561 of file Host.php.
References permissionList().
Referenced by permissionGetCategoryById(), and permissionGetGrantById().
{ if(!array_key_exists((string) $name, $this->permissionList())) { throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid permission ID", 0xA02); } return $this->permissionList[(string) $name]["permid"]; }
TeamSpeak3_Node_Host::permissionGetNameById | ( | $ | permid | ) |
Returns the name of the permission matching the given ID.
integer | $permid |
TeamSpeak3_Adapter_ServerQuery_Exception |
Definition at line 578 of file Host.php.
References permissionList().
{ foreach($this->permissionList() as $name => $perm) { if($perm["permid"] == $permid) return new TeamSpeak3_Helper_String($name); } throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid permission ID", 0xA02); }
TeamSpeak3_Node_Host::permissionGetCategoryById | ( | $ | permid | ) |
Returns the internal category of the permission matching the given ID.
All permission IDs are are 2 bytes wide. The first byte identifies the category while the second byte is the permission count within that group.
integer | $permid |
Definition at line 597 of file Host.php.
References permissionGetIdByName().
Referenced by permissionList(), and permissionTree().
{ if(!is_numeric($permid)) { $permid = $this->permissionGetIdByName($permid); } return (int) $permid >> 8; }
TeamSpeak3_Node_Host::permissionGetGrantById | ( | $ | permid | ) |
Returns the internal ID of the i_needed_modify_power_* or grant permission.
Every permission has an associated i_needed_modify_power_* permission, for example b_client_ban_create has an associated permission called i_needed_modify_power_client_ban_create.
integer | $permid |
Definition at line 616 of file Host.php.
References permissionGetIdByName().
Referenced by permissionList().
{ if(!is_numeric($permid)) { $permid = $this->permissionGetIdByName($permid); } return (int) bindec(substr(decbin($permid), -8))+0xFF00; }
TeamSpeak3_Node_Host::selfPermCheck | ( | $ | permid | ) |
Returns an array containing the value of a specified permission for your own client.
integer | $permid |
Definition at line 632 of file Host.php.
References TeamSpeak3_Node_Abstract\current(), and TeamSpeak3_Node_Abstract\execute().
TeamSpeak3_Node_Host::modify | ( | array $ | properties | ) |
Changes the server instance configuration using given properties.
array | $properties |
Definition at line 652 of file Host.php.
References TeamSpeak3_Node_Abstract\execute(), and TeamSpeak3_Node_Abstract\resetNodeInfo().
{ $this->execute("instanceedit", $properties); $this->resetNodeInfo(); }
TeamSpeak3_Node_Host::message | ( | $ | msg | ) |
Sends a text message to all clients on all virtual servers in the TeamSpeak 3 Server instance.
string | $msg |
Definition at line 664 of file Host.php.
References TeamSpeak3_Node_Abstract\execute().
{ $this->execute("gm", array("msg" => $msg)); }
TeamSpeak3_Node_Host::logView | ( | $ | lines = 30 , |
$ | begin_pos = null , |
||
$ | reverse = null , |
||
$ | instance = TRUE |
||
) |
Displays a specified number of entries (1-100) from the servers log.
integer | $lines | |
integer | $begin_pos | |
boolean | $reverse | |
boolean | $instance |
Definition at line 678 of file Host.php.
References TeamSpeak3_Node_Abstract\execute().
{ return $this->execute("logview", array("lines" => $lines, "begin_pos" => $begin_pos, "instance" => $instance, "reverse" => $reverse))->toArray(); }
TeamSpeak3_Node_Host::logAdd | ( | $ | logmsg, |
$ | loglevel = TeamSpeak3::LOGLEVEL_INFO |
||
) |
Writes a custom entry into the server instance log.
string | $logmsg | |
integer | $loglevel |
Definition at line 690 of file Host.php.
References TeamSpeak3_Node_Abstract\execute(), serverDeselect(), serverSelect(), and serverSelectedId().
{ $sid = $this->serverSelectedId(); $this->serverDeselect(); $this->execute("logadd", array("logmsg" => $logmsg, "loglevel" => $loglevel)); $this->serverSelect($sid); }
TeamSpeak3_Node_Host::login | ( | $ | username, |
$ | password | ||
) |
Authenticates with the TeamSpeak 3 Server instance using given ServerQuery login credentials.
string | $username | |
string | $password |
Definition at line 706 of file Host.php.
References TeamSpeak3_Node_Abstract\execute(), TeamSpeak3_Helper_Signal\getInstance(), TeamSpeak3_Node_Abstract\setStorage(), and whoamiReset().
Referenced by __wakeup().
{ $this->execute("login", array("client_login_name" => $username, "client_login_password" => $password)); $this->whoamiReset(); $crypt = new TeamSpeak3_Helper_Crypt($username); $this->setStorage("_login_user", $username); $this->setStorage("_login_pass", $crypt->encrypt($password)); TeamSpeak3_Helper_Signal::getInstance()->emit("notifyLogin", $this); }
Deselects the active virtual server and logs out from the server instance.
Definition at line 724 of file Host.php.
References TeamSpeak3_Node_Abstract\delStorage(), TeamSpeak3_Helper_Signal\getInstance(), TeamSpeak3_Node_Abstract\request(), and whoamiReset().
{ $this->request("logout"); $this->whoamiReset(); $this->delStorage("_login_user"); $this->delStorage("_login_pass"); TeamSpeak3_Helper_Signal::getInstance()->emit("notifyLogout", $this); }
Returns information about your current ServerQuery connection.
Definition at line 740 of file Host.php.
References TeamSpeak3_Node_Abstract\request().
Referenced by serverSelect(), serverSelectByPort(), whoamiGet(), whoamiReset(), and whoamiSet().
TeamSpeak3_Node_Host::whoamiGet | ( | $ | ident, |
$ | default = null |
||
) |
Returns a single value from the current ServerQuery connection info.
string | $ident | |
mixed | $default |
Definition at line 757 of file Host.php.
References whoami().
Referenced by serverSelectedId(), and serverSelectedPort().
TeamSpeak3_Node_Host::whoamiSet | ( | $ | ident, |
$ | value = null |
||
) |
Sets a single value in the current ServerQuery connection info.
string | $ident | |
mixed | $value |
Definition at line 774 of file Host.php.
References TeamSpeak3_Helper_String\factory(), and whoami().
{ $this->whoami(); $this->whoami[$ident] = (is_numeric($value)) ? intval($value) : TeamSpeak3_Helper_String::factory($value); }
Resets the current ServerQuery connection info.
Definition at line 786 of file Host.php.
References whoami().
Referenced by login(), logout(), serverSelect(), and serverSelectByPort().
{ $this->whoami = null; }
Returns the hostname or IPv4 address the adapter is connected to.
Definition at line 796 of file Host.php.
References TeamSpeak3_Node_Abstract\getParent().
Referenced by __toString().
{ return $this->getParent()->getTransportHost(); }
Returns the network port the adapter is connected to.
Definition at line 806 of file Host.php.
References TeamSpeak3_Node_Abstract\getParent().
{ return $this->getParent()->getTransportPort(); }
TeamSpeak3_Node_Host::fetchNodeList | ( | ) | [protected] |
Reimplemented from TeamSpeak3_Node_Abstract.
Definition at line 814 of file Host.php.
References TeamSpeak3_Node_Abstract\$server, and serverList().
{ $servers = $this->serverList(); foreach($servers as $server) { $this->nodeList[] = $server; } }
TeamSpeak3_Node_Host::fetchNodeInfo | ( | ) | [protected] |
Reimplemented from TeamSpeak3_Node_Abstract.
Definition at line 827 of file Host.php.
References TeamSpeak3_Node_Abstract\request().
TeamSpeak3_Node_Host::setPredefinedQueryName | ( | $ | name = null | ) |
Sets a pre-defined nickname for ServerQuery clients which will be used automatically after selecting a virtual server.
string | $name |
Definition at line 842 of file Host.php.
References TeamSpeak3_Node_Abstract\setStorage().
{ $this->setStorage("_query_nick", $name); $this->predefined_query_name = $name; }
TeamSpeak3_Node_Host::setExcludeQueryClients | ( | $ | exclude = FALSE | ) |
Sets the option to decide whether ServerQuery clients should be excluded from node lists or not.
boolean | $exclude |
Definition at line 867 of file Host.php.
References TeamSpeak3_Node_Abstract\setStorage().
{ $this->setStorage("_query_hide", $exclude); $this->exclude_query_clients = $exclude; }
TeamSpeak3_Node_Host::setUseOfflineAsVirtual | ( | $ | virtual = FALSE | ) |
Sets the option to decide whether offline servers will be started in virtual mode by default or not.
boolean | $virtual |
Definition at line 892 of file Host.php.
References TeamSpeak3_Node_Abstract\setStorage().
{ $this->setStorage("_do_virtual", $virtual); $this->start_offline_virtual = $virtual; }
TeamSpeak3_Node_Host::setLoadClientlistFirst | ( | $ | first = FALSE | ) |
Sets the option to decide whether clients should be sorted before sub-channels to support the new TeamSpeak 3 Client display mode or not.
boolean | $first |
Definition at line 917 of file Host.php.
References TeamSpeak3_Node_Abstract\setStorage().
{ $this->setStorage("_client_top", $first); $this->sort_clients_channels = $first; }
Returns the underlying TeamSpeak3_Adapter_ServerQuery object.
Definition at line 940 of file Host.php.
References TeamSpeak3_Node_Abstract\getParent().
{ return $this->getParent(); }
Returns a unique identifier for the node which can be used as a HTML property.
Reimplemented from TeamSpeak3_Node_Abstract.
Definition at line 950 of file Host.php.
{ return "ts3_h"; }
Returns the name of a possible icon to display the node object.
Reimplemented from TeamSpeak3_Node_Abstract.
Definition at line 960 of file Host.php.
{ return "host"; }
Returns a symbol representing the node.
Reimplemented from TeamSpeak3_Node_Abstract.
Definition at line 970 of file Host.php.
{ return "+"; }
Re-authenticates with the TeamSpeak 3 Server instance using given ServerQuery login credentials and re-selects a previously selected virtual server.
Definition at line 981 of file Host.php.
References TeamSpeak3_Node_Abstract\$server, TeamSpeak3_Node_Abstract\getStorage(), and login().
{ $username = $this->getStorage("_login_user"); $password = $this->getStorage("_login_pass"); if($username && $password) { $crypt = new TeamSpeak3_Helper_Crypt($username); $this->login($username, $crypt->decrypt($password)); } $this->predefined_query_name = $this->getStorage("_query_nick"); $this->exclude_query_clients = $this->getStorage("_query_hide", FALSE); $this->start_offline_virtual = $this->getStorage("_do_virtual", FALSE); $this->sort_clients_channels = $this->getStorage("_client_top", FALSE); if($server = $this->getStorage("_server_use")) { $func = array_shift($server); $args = array_shift($server); call_user_func_array(array($this, $func), $args); } }
Returns a string representation of this node.
Reimplemented from TeamSpeak3_Node_Abstract.
Definition at line 1012 of file Host.php.
References getAdapterHost().
{ return (string) $this->getAdapterHost(); }
TeamSpeak3_Node_Abstract::request | ( | $ | cmd | ) | [inherited] |
Sends a prepared command to the server and returns the result.
string | $cmd |
Reimplemented in TeamSpeak3_Node_Server.
Definition at line 70 of file Abstract.php.
References TeamSpeak3_Node_Abstract\getParent().
Referenced by bindingList(), TeamSpeak3_Node_Abstract\execute(), fetchNodeInfo(), logout(), permissionList(), serverList(), version(), and whoami().
{ return $this->getParent()->request($cmd); }
TeamSpeak3_Node_Abstract::prepare | ( | $ | cmd, |
array $ | params = array() |
||
) | [inherited] |
Uses given parameters and returns a prepared ServerQuery command.
string | $cmd | |
array | $params |
Definition at line 82 of file Abstract.php.
References TeamSpeak3_Node_Abstract\getParent().
Referenced by TeamSpeak3_Node_Abstract\execute().
{ return $this->getParent()->prepare($cmd, $params); }
TeamSpeak3_Node_Abstract::execute | ( | $ | cmd, |
array $ | params = array() |
||
) | [inherited] |
Prepares and executes a ServerQuery command and returns the result.
string | $cmd | |
array | $params |
Definition at line 94 of file Abstract.php.
References TeamSpeak3_Node_Abstract\prepare(), and TeamSpeak3_Node_Abstract\request().
Referenced by TeamSpeak3_Node_Server\banCreate(), TeamSpeak3_Node_Server\banDelete(), TeamSpeak3_Node_Server\channelClientPermAssign(), TeamSpeak3_Node_Server\channelClientPermList(), TeamSpeak3_Node_Server\channelClientPermRemove(), TeamSpeak3_Node_Server\channelCreate(), TeamSpeak3_Node_Server\channelDelete(), TeamSpeak3_Node_Server\channelDirCreate(), TeamSpeak3_Node_Server\channelFileDelete(), TeamSpeak3_Node_Server\channelFileInfo(), TeamSpeak3_Node_Server\channelFileList(), TeamSpeak3_Node_Server\channelFileRename(), TeamSpeak3_Node_Server\channelGroupClientList(), TeamSpeak3_Node_Server\channelGroupCopy(), TeamSpeak3_Node_Server\channelGroupCreate(), TeamSpeak3_Node_Server\channelGroupDelete(), TeamSpeak3_Node_Server\channelGroupPermAssign(), TeamSpeak3_Node_Server\channelGroupPermList(), TeamSpeak3_Node_Server\channelGroupPermRemove(), TeamSpeak3_Node_Server\channelGroupRename(), TeamSpeak3_Node_Server\channelMove(), TeamSpeak3_Node_Server\channelPermAssign(), TeamSpeak3_Node_Server\channelPermList(), TeamSpeak3_Node_Server\channelPermRemove(), TeamSpeak3_Node_Server\clientBan(), TeamSpeak3_Node_Server\clientCountDb(), TeamSpeak3_Node_Server\clientDeleteDb(), TeamSpeak3_Node_Server\clientFind(), TeamSpeak3_Node_Server\clientFindDb(), TeamSpeak3_Node_Server\clientGetIdsByUid(), TeamSpeak3_Node_Server\clientGetNameByDbid(), TeamSpeak3_Node_Server\clientGetNameByUid(), TeamSpeak3_Node_Server\clientGetServerGroupsByDbid(), TeamSpeak3_Node_Server\clientInfoDb(), TeamSpeak3_Node_Server\clientKick(), TeamSpeak3_Node_Server\clientListDb(), TeamSpeak3_Node_Server\clientModifyDb(), TeamSpeak3_Node_Server\clientMove(), TeamSpeak3_Node_Server\clientPermAssign(), TeamSpeak3_Node_Server\clientPermList(), TeamSpeak3_Node_Server\clientPermRemove(), TeamSpeak3_Node_Server\clientPoke(), TeamSpeak3_Node_Server\clientSetChannelGroup(), TeamSpeak3_Node_Server\complaintCreate(), TeamSpeak3_Node_Server\complaintDelete(), TeamSpeak3_Node_Server\complaintList(), TeamSpeak3_Node_Server\complaintListClear(), TeamSpeak3_Node_Server\customInfo(), TeamSpeak3_Node_Server\customSearch(), TeamSpeak3_Node_Client\fetchNodeInfo(), TeamSpeak3_Node_Channel\fetchNodeInfo(), TeamSpeak3_Node_Client\getClones(), logAdd(), TeamSpeak3_Node_Server\logAdd(), login(), logView(), TeamSpeak3_Node_Server\logView(), TeamSpeak3_Node_Client\message(), TeamSpeak3_Node_Channelgroup\message(), TeamSpeak3_Node_Servergroup\message(), TeamSpeak3_Node_Channel\message(), message(), TeamSpeak3_Node_Server\message(), TeamSpeak3_Node_Server\messageCreate(), TeamSpeak3_Node_Server\messageDelete(), TeamSpeak3_Node_Server\messageRead(), TeamSpeak3_Node_Client\modify(), TeamSpeak3_Node_Channel\modify(), modify(), TeamSpeak3_Node_Server\modify(), TeamSpeak3_Node_Server\notifyRegister(), permissionFind(), TeamSpeak3_Node_Client\permOverview(), TeamSpeak3_Node_Server\privilegeKeyCreate(), TeamSpeak3_Node_Server\privilegeKeyDelete(), TeamSpeak3_Node_Server\privilegeKeyUse(), selfPermCheck(), TeamSpeak3_Node_Server\selfPermOverview(), TeamSpeak3_Node_Server\selfUpdate(), TeamSpeak3_Node_Server\selfUpdateLogin(), serverCreate(), serverDelete(), TeamSpeak3_Node_Server\serverGroupClientAdd(), TeamSpeak3_Node_Server\serverGroupClientDel(), TeamSpeak3_Node_Server\serverGroupClientList(), TeamSpeak3_Node_Server\serverGroupCopy(), TeamSpeak3_Node_Server\serverGroupCreate(), TeamSpeak3_Node_Server\serverGroupDelete(), TeamSpeak3_Node_Server\serverGroupPermAssign(), TeamSpeak3_Node_Server\serverGroupPermList(), TeamSpeak3_Node_Server\serverGroupPermRemove(), TeamSpeak3_Node_Server\serverGroupRename(), serverIdGetByPort(), serverSelect(), serverSelectByPort(), serverStart(), serverStop(), serverStopProcess(), TeamSpeak3_Node_Server\transferInitDownload(), TeamSpeak3_Node_Server\transferInitUpload(), and TeamSpeak3_Node_Server\transferStop().
TeamSpeak3_Node_Abstract::getParent | ( | ) | [inherited] |
Returns the parent object of the current node.
Definition at line 105 of file Abstract.php.
Referenced by TeamSpeak3_Node_Abstract\__call(), TeamSpeak3_Node_Client\addServerGroup(), TeamSpeak3_Node_Client\avatarDownload(), TeamSpeak3_Node_Client\ban(), TeamSpeak3_Node_Server\channelCreate(), TeamSpeak3_Node_Server\channelDelete(), TeamSpeak3_Node_Servergroup\clientAdd(), TeamSpeak3_Node_Servergroup\clientDel(), TeamSpeak3_Node_Channel\clientList(), TeamSpeak3_Node_Channelgroup\clientList(), TeamSpeak3_Node_Servergroup\clientList(), TeamSpeak3_Node_Server\clientList(), TeamSpeak3_Node_Server\clientMove(), TeamSpeak3_Node_Channel\clientPermAssign(), TeamSpeak3_Node_Channel\clientPermList(), TeamSpeak3_Node_Channel\clientPermRemove(), TeamSpeak3_Node_Servergroup\copy(), TeamSpeak3_Node_Channelgroup\copy(), TeamSpeak3_Node_Client\customInfo(), TeamSpeak3_Node_Servergroup\delete(), TeamSpeak3_Node_Channelgroup\delete(), TeamSpeak3_Node_Channel\delete(), TeamSpeak3_Node_Server\delete(), TeamSpeak3_Node_Client\deleteDb(), TeamSpeak3_Node_Channel\dirCreate(), TeamSpeak3_Node_Channelgroup\fetchNodeList(), TeamSpeak3_Node_Servergroup\fetchNodeList(), TeamSpeak3_Node_Channel\fetchNodeList(), TeamSpeak3_Node_Channel\fileDelete(), TeamSpeak3_Node_Channel\fileInfo(), TeamSpeak3_Node_Channel\fileList(), TeamSpeak3_Node_Channel\fileRename(), getAdapter(), getAdapterHost(), getAdapterPort(), TeamSpeak3_Node_Channel\getLevel(), TeamSpeak3_Node_Channel\getPathway(), TeamSpeak3_Node_Channelgroup\getUniqueId(), TeamSpeak3_Node_Servergroup\getUniqueId(), TeamSpeak3_Node_Client\getUniqueId(), TeamSpeak3_Node_Channel\getUniqueId(), TeamSpeak3_Node_Server\getUniqueId(), TeamSpeak3_Node_Channelgroup\iconDownload(), TeamSpeak3_Node_Servergroup\iconDownload(), TeamSpeak3_Node_Client\iconDownload(), TeamSpeak3_Node_Channel\iconDownload(), TeamSpeak3_Node_Client\infoDb(), TeamSpeak3_Node_Channel\isSpacer(), TeamSpeak3_Node_Client\kick(), TeamSpeak3_Node_Client\memberOf(), TeamSpeak3_Node_Channel\message(), TeamSpeak3_Node_Client\modifyDb(), TeamSpeak3_Node_Client\move(), TeamSpeak3_Node_Channel\move(), TeamSpeak3_Node_Channelgroup\permAssign(), TeamSpeak3_Node_Servergroup\permAssign(), TeamSpeak3_Node_Client\permAssign(), TeamSpeak3_Node_Channel\permAssign(), TeamSpeak3_Node_Channelgroup\permList(), TeamSpeak3_Node_Servergroup\permList(), TeamSpeak3_Node_Client\permList(), TeamSpeak3_Node_Channel\permList(), TeamSpeak3_Node_Channelgroup\permRemove(), TeamSpeak3_Node_Servergroup\permRemove(), TeamSpeak3_Node_Client\permRemove(), TeamSpeak3_Node_Channel\permRemove(), TeamSpeak3_Node_Client\poke(), TeamSpeak3_Node_Abstract\prepare(), TeamSpeak3_Node_Channelgroup\privilegeKeyCreate(), TeamSpeak3_Node_Servergroup\privilegeKeyCreate(), TeamSpeak3_Node_Client\remServerGroup(), TeamSpeak3_Node_Servergroup\rename(), TeamSpeak3_Node_Channelgroup\rename(), TeamSpeak3_Node_Abstract\request(), TeamSpeak3_Node_Server\request(), TeamSpeak3_Node_Client\setChannelGroup(), TeamSpeak3_Node_Server\snapshotDeploy(), TeamSpeak3_Node_Channel\spacerGetAlign(), TeamSpeak3_Node_Channel\spacerGetType(), TeamSpeak3_Node_Server\start(), TeamSpeak3_Node_Server\stop(), TeamSpeak3_Node_Channel\subChannelList(), TeamSpeak3_Node_Server\transferInitDownload(), and TeamSpeak3_Node_Server\transferInitUpload().
{
return $this->parent;
}
TeamSpeak3_Node_Abstract::getId | ( | ) | [inherited] |
Returns the primary ID of the current node.
Definition at line 115 of file Abstract.php.
Referenced by TeamSpeak3_Node_Client\ban(), TeamSpeak3_Node_Server\channelDelete(), TeamSpeak3_Node_Server\channelFileList(), TeamSpeak3_Node_Servergroup\clientAdd(), TeamSpeak3_Node_Servergroup\clientDel(), TeamSpeak3_Node_Channel\clientList(), TeamSpeak3_Node_Channelgroup\clientList(), TeamSpeak3_Node_Servergroup\clientList(), TeamSpeak3_Node_Channel\clientPermAssign(), TeamSpeak3_Node_Channel\clientPermList(), TeamSpeak3_Node_Channel\clientPermRemove(), TeamSpeak3_Node_Channelgroup\copy(), TeamSpeak3_Node_Servergroup\copy(), TeamSpeak3_Node_Servergroup\delete(), TeamSpeak3_Node_Channelgroup\delete(), TeamSpeak3_Node_Channel\delete(), TeamSpeak3_Node_Server\delete(), TeamSpeak3_Node_Channel\dirCreate(), TeamSpeak3_Node_Client\fetchNodeInfo(), TeamSpeak3_Node_Channel\fetchNodeInfo(), TeamSpeak3_Node_Channelgroup\fetchNodeList(), TeamSpeak3_Node_Servergroup\fetchNodeList(), TeamSpeak3_Node_Channel\fetchNodeList(), TeamSpeak3_Node_Channel\fileDelete(), TeamSpeak3_Node_Channel\fileInfo(), TeamSpeak3_Node_Channel\fileList(), TeamSpeak3_Node_Channel\fileRename(), TeamSpeak3_Node_Channel\getLevel(), TeamSpeak3_Node_Channel\getPathway(), TeamSpeak3_Node_Channelgroup\getUniqueId(), TeamSpeak3_Node_Servergroup\getUniqueId(), TeamSpeak3_Node_Client\getUniqueId(), TeamSpeak3_Node_Channel\getUniqueId(), TeamSpeak3_Node_Server\getUniqueId(), TeamSpeak3_Node_Client\kick(), TeamSpeak3_Node_Client\message(), TeamSpeak3_Node_Channel\message(), TeamSpeak3_Node_Server\message(), TeamSpeak3_Node_Client\modify(), TeamSpeak3_Node_Channel\modify(), TeamSpeak3_Node_Client\move(), TeamSpeak3_Node_Channel\move(), TeamSpeak3_Node_Channelgroup\permAssign(), TeamSpeak3_Node_Servergroup\permAssign(), TeamSpeak3_Node_Channel\permAssign(), TeamSpeak3_Node_Channelgroup\permList(), TeamSpeak3_Node_Servergroup\permList(), TeamSpeak3_Node_Channel\permList(), TeamSpeak3_Node_Channelgroup\permRemove(), TeamSpeak3_Node_Servergroup\permRemove(), TeamSpeak3_Node_Channel\permRemove(), TeamSpeak3_Node_Client\poke(), TeamSpeak3_Node_Channelgroup\privilegeKeyCreate(), TeamSpeak3_Node_Servergroup\privilegeKeyCreate(), TeamSpeak3_Node_Servergroup\rename(), TeamSpeak3_Node_Channelgroup\rename(), TeamSpeak3_Node_Server\request(), TeamSpeak3_Node_Server\sortGroupList(), TeamSpeak3_Node_Channel\spacerGetAlign(), TeamSpeak3_Node_Channel\spacerGetType(), TeamSpeak3_Node_Server\start(), TeamSpeak3_Node_Server\stop(), and TeamSpeak3_Node_Channel\subChannelList().
{
return $this->nodeId;
}
TeamSpeak3_Node_Abstract::iconIsLocal | ( | $ | key | ) | [inherited] |
Returns TRUE if the node icon has a local source.
Definition at line 125 of file Abstract.php.
Referenced by TeamSpeak3_Node_Channelgroup\iconDownload(), TeamSpeak3_Node_Servergroup\iconDownload(), TeamSpeak3_Node_Client\iconDownload(), TeamSpeak3_Node_Channel\iconDownload(), and TeamSpeak3_Node_Server\iconDownload().
{
return ($this[$key] > 0 && $this[$key] < 1000) ? TRUE : FALSE;
}
TeamSpeak3_Node_Abstract::iconGetName | ( | $ | key | ) | [inherited] |
Returns the internal path of the node icon.
Definition at line 135 of file Abstract.php.
Referenced by TeamSpeak3_Node_Abstract\getInfo(), TeamSpeak3_Node_Channelgroup\iconDownload(), TeamSpeak3_Node_Servergroup\iconDownload(), TeamSpeak3_Node_Client\iconDownload(), TeamSpeak3_Node_Channel\iconDownload(), and TeamSpeak3_Node_Server\iconDownload().
{ $iconid = ($this[$key] < 0) ? (pow(2, 32))-($this[$key]*-1) : $this[$key]; return new TeamSpeak3_Helper_String("/icon_" . $iconid); }
TeamSpeak3_Node_Abstract::getClass | ( | $ | prefix = "ts3_" | ) | [inherited] |
Returns a possible classname for the node which can be used as a HTML property.
Definition at line 147 of file Abstract.php.
References TeamSpeak3_Helper_String\factory().
{ if($this instanceof TeamSpeak3_Node_Channel && $this->isSpacer()) { return $prefix . "spacer"; } elseif($this instanceof TeamSpeak3_Node_Client && $this["client_type"]) { return $prefix . "query"; } return $prefix . TeamSpeak3_Helper_String::factory(get_class($this))->section("_", 2)->toLower(); }
TeamSpeak3_Node_Abstract::getViewer | ( | TeamSpeak3_Viewer_Interface $ | viewer | ) | [inherited] |
Returns the HTML code to display a TeamSpeak 3 viewer.
TeamSpeak3_Viewer_Interface | $viewer |
Definition at line 188 of file Abstract.php.
References TeamSpeak3_Viewer_Interface\fetchObject().
{ $html = $viewer->fetchObject($this); $iterator = new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST); foreach($iterator as $node) { $siblings = array(); for($level = 0; $level < $iterator->getDepth(); $level++) { $siblings[] = ($iterator->getSubIterator($level)->hasNext()) ? 1 : 0; } $siblings[] = (!$iterator->getSubIterator($level)->hasNext()) ? 1 : 0; $html .= $viewer->fetchObject($node, $siblings); } return $html; }
TeamSpeak3_Node_Abstract::filterList | ( | array $ | nodes = array() , |
array $ | rules = array() |
||
) | [protected, inherited] |
Filters given node list array using specified filter rules.
array | $nodes | |
array | $rules |
Definition at line 218 of file Abstract.php.
Referenced by TeamSpeak3_Node_Server\channelGroupList(), TeamSpeak3_Node_Server\channelList(), TeamSpeak3_Node_Channel\clientList(), TeamSpeak3_Node_Server\clientList(), TeamSpeak3_Node_Server\serverGroupList(), serverList(), and TeamSpeak3_Node_Channel\subChannelList().
{ if(!empty($rules)) { foreach($nodes as $node) { if(!$node instanceof TeamSpeak3_Node_Abstract) continue; $props = $node->getInfo(FALSE); $props = array_intersect_key($props, $rules); $match = TRUE; foreach($props as $key => $val) { if($val instanceof TeamSpeak3_Helper_String) { $match = $val->contains($rules[$key], TRUE); } else { $match = $val == $rules[$key]; } if($match === FALSE) { unset($nodes[$node->getId()]); } } } } return $nodes; }
TeamSpeak3_Node_Abstract::getInfo | ( | $ | extend = TRUE , |
$ | convert = FALSE |
||
) | [inherited] |
Returns all information available on this node.
If $convert is enabled, some property values will be converted to human-readable values.
boolean | $extend | |
boolean | $convert |
Definition at line 260 of file Abstract.php.
References TeamSpeak3_Helper_Convert\bytes(), TeamSpeak3_Helper_String\factory(), TeamSpeak3_Node_Abstract\fetchNodeInfo(), TeamSpeak3_Node_Abstract\iconGetName(), TeamSpeak3_Helper_Convert\seconds(), and TeamSpeak3_Helper_Convert\version().
{ if($extend) { $this->fetchNodeInfo(); } if($convert) { $info = $this->nodeInfo; foreach($info as $key => $val) { $key = TeamSpeak3_Helper_String::factory($key); if($key->contains("_bytes_")) { $info[$key->toString()] = TeamSpeak3_Helper_Convert::bytes($val); } elseif($key->contains("_bandwidth_")) { $info[$key->toString()] = TeamSpeak3_Helper_Convert::bytes($val) . "/s"; } elseif($key->contains("_packets_")) { $info[$key->toString()] = number_format($val, null, null, "."); } elseif($key->contains("_packetloss_")) { $info[$key->toString()] = sprintf("%01.2f", floatval($val->toString())*100) . "%"; } elseif($key->endsWith("_uptime")) { $info[$key->toString()] = TeamSpeak3_Helper_Convert::seconds($val); } elseif($key->endsWith("_version")) { $info[$key->toString()] = TeamSpeak3_Helper_Convert::version($val); } elseif($key->endsWith("_icon_id")) { $info[$key->toString()] = $this->iconGetName($key)->filterDigits(); } } return $info; } return $this->nodeInfo; }
TeamSpeak3_Node_Abstract::getProperty | ( | $ | property, |
$ | default = null |
||
) | [inherited] |
Returns the specified property or a pre-defined default value from the node info array.
string | $property | |
mixed | $default |
Definition at line 318 of file Abstract.php.
References TeamSpeak3_Node_Abstract\fetchNodeInfo(), and TeamSpeak3_Node_Abstract\offsetExists().
Referenced by TeamSpeak3_Node_Server\sortClientList(), and TeamSpeak3_Node_Server\sortGroupList().
{ if(!$this->offsetExists($property)) { $this->fetchNodeInfo(); } if(!$this->offsetExists($property)) { return $default; } return $this->nodeInfo[(string) $property]; }
TeamSpeak3_Node_Abstract::toString | ( | ) | [inherited] |
Returns a string representation of this node.
Definition at line 348 of file Abstract.php.
References TeamSpeak3_Node_Abstract\__toString().
{ return $this->__toString(); }
TeamSpeak3_Node_Abstract::toArray | ( | ) | [inherited] |
Returns an assoc array filled with current node info properties.
Definition at line 358 of file Abstract.php.
Referenced by TeamSpeak3_Node_Server\channelFileInfo().
{
return $this->nodeList;
}
TeamSpeak3_Node_Abstract::__call | ( | $ | name, |
array $ | args | ||
) | [inherited] |
Called whenever we're using an unknown method.
string | $name | |
array | $args |
TeamSpeak3_Node_Exception |
Definition at line 371 of file Abstract.php.
References TeamSpeak3_Node_Abstract\getParent().
{ if($this->getParent() instanceof TeamSpeak3_Node_Abstract) { return call_user_func_array(array($this->getParent(), $name), $args); } throw new TeamSpeak3_Node_Exception("node method '" . $name . "()' does not exist"); }
TeamSpeak3_Node_Abstract::setStorage | ( | $ | key, |
$ | val | ||
) | [protected, inherited] |
Writes data to the internal storage array.
string | $key | |
mixed | $val |
Definition at line 388 of file Abstract.php.
Referenced by login(), serverSelect(), serverSelectByPort(), setExcludeQueryClients(), setLoadClientlistFirst(), setPredefinedQueryName(), and setUseOfflineAsVirtual().
{ $this->storage[$key] = $val; }
TeamSpeak3_Node_Abstract::getStorage | ( | $ | key, |
$ | default = null |
||
) | [protected, inherited] |
Returns data from the internal storage array.
string | $key | |
mixed | $default |
Definition at line 400 of file Abstract.php.
Referenced by __wakeup().
{
return (array_key_exists($key, $this->storage) && !empty($this->storage[$key])) ? $this->storage[$key] : $default;
}
TeamSpeak3_Node_Abstract::delStorage | ( | $ | key | ) | [protected, inherited] |
Deletes data from the internal storage array.
string | $key |
Definition at line 411 of file Abstract.php.
Referenced by logout(), and serverDeselect().
{ unset($this->storage[$key]); }
TeamSpeak3_Node_Abstract::__sleep | ( | ) | [inherited] |
Commit pending data.
Definition at line 421 of file Abstract.php.
{ return array("parent", "storage", "nodeId"); }
TeamSpeak3_Node_Abstract::resetNodeInfo | ( | ) | [protected, inherited] |
Definition at line 445 of file Abstract.php.
Referenced by TeamSpeak3_Node_Client\modify(), TeamSpeak3_Node_Channel\modify(), modify(), and TeamSpeak3_Node_Server\modify().
{ $this->nodeInfo = array(); }
TeamSpeak3_Node_Abstract::verifyNodeList | ( | ) | [protected, inherited] |
Definition at line 453 of file Abstract.php.
References TeamSpeak3_Node_Abstract\fetchNodeList().
Referenced by TeamSpeak3_Node_Abstract\count(), TeamSpeak3_Node_Abstract\current(), TeamSpeak3_Node_Abstract\getChildren(), TeamSpeak3_Node_Abstract\hasChildren(), TeamSpeak3_Node_Abstract\hasNext(), TeamSpeak3_Node_Abstract\key(), TeamSpeak3_Node_Abstract\next(), TeamSpeak3_Node_Abstract\rewind(), and TeamSpeak3_Node_Abstract\valid().
{ if($this->nodeList === null) { $this->fetchNodeList(); } }
TeamSpeak3_Node_Abstract::resetNodeList | ( | ) | [protected, inherited] |
Definition at line 464 of file Abstract.php.
Referenced by TeamSpeak3_Node_Server\channelList(), TeamSpeak3_Node_Server\channelListReset(), TeamSpeak3_Node_Server\clientList(), TeamSpeak3_Node_Server\clientListReset(), serverList(), and serverListReset().
{ $this->nodeList = null; }
TeamSpeak3_Node_Abstract::count | ( | ) | [inherited] |
Definition at line 472 of file Abstract.php.
References TeamSpeak3_Node_Abstract\verifyNodeList().
Referenced by TeamSpeak3_Node_Server\channelFileList(), TeamSpeak3_Node_Server\channelGroupCopy(), TeamSpeak3_Node_Abstract\hasNext(), TeamSpeak3_Node_Server\permRemoveAny(), and TeamSpeak3_Node_Server\serverGroupCopy().
{ $this->verifyNodeList(); return count($this->nodeList); }
TeamSpeak3_Node_Abstract::current | ( | ) | [inherited] |
Definition at line 482 of file Abstract.php.
References TeamSpeak3_Node_Abstract\verifyNodeList().
Referenced by TeamSpeak3_Node_Server\channelClientPermAssign(), TeamSpeak3_Node_Server\channelClientPermRemove(), TeamSpeak3_Node_Server\channelGroupPermAssign(), TeamSpeak3_Node_Server\channelGroupPermRemove(), TeamSpeak3_Node_Server\channelPermAssign(), TeamSpeak3_Node_Server\channelPermRemove(), TeamSpeak3_Node_Server\clientCountDb(), TeamSpeak3_Node_Server\clientPermAssign(), TeamSpeak3_Node_Server\clientPermRemove(), TeamSpeak3_Node_Abstract\getChildren(), TeamSpeak3_Node_Abstract\hasChildren(), permissionFind(), selfPermCheck(), TeamSpeak3_Node_Server\serverGroupPermAssign(), and TeamSpeak3_Node_Server\serverGroupPermRemove().
{ $this->verifyNodeList(); return current($this->nodeList); }
TeamSpeak3_Node_Abstract::getChildren | ( | ) | [inherited] |
Definition at line 492 of file Abstract.php.
References TeamSpeak3_Node_Abstract\current(), and TeamSpeak3_Node_Abstract\verifyNodeList().
{ $this->verifyNodeList(); return $this->current(); }
TeamSpeak3_Node_Abstract::hasChildren | ( | ) | [inherited] |
Definition at line 502 of file Abstract.php.
References TeamSpeak3_Node_Abstract\current(), and TeamSpeak3_Node_Abstract\verifyNodeList().
{ $this->verifyNodeList(); return $this->current()->count() > 0; }
TeamSpeak3_Node_Abstract::hasNext | ( | ) | [inherited] |
Definition at line 512 of file Abstract.php.
References TeamSpeak3_Node_Abstract\count(), TeamSpeak3_Node_Abstract\key(), and TeamSpeak3_Node_Abstract\verifyNodeList().
{ $this->verifyNodeList(); return $this->key()+1 < $this->count(); }
TeamSpeak3_Node_Abstract::key | ( | ) | [inherited] |
Definition at line 522 of file Abstract.php.
References TeamSpeak3_Node_Abstract\verifyNodeList().
Referenced by TeamSpeak3_Node_Abstract\hasNext(), and TeamSpeak3_Node_Abstract\valid().
{ $this->verifyNodeList(); return key($this->nodeList); }
TeamSpeak3_Node_Abstract::valid | ( | ) | [inherited] |
Definition at line 532 of file Abstract.php.
References TeamSpeak3_Node_Abstract\key(), and TeamSpeak3_Node_Abstract\verifyNodeList().
{ $this->verifyNodeList(); return $this->key() !== null; }
TeamSpeak3_Node_Abstract::next | ( | ) | [inherited] |
Definition at line 542 of file Abstract.php.
References TeamSpeak3_Node_Abstract\verifyNodeList().
{ $this->verifyNodeList(); return next($this->nodeList); }
TeamSpeak3_Node_Abstract::rewind | ( | ) | [inherited] |
Definition at line 552 of file Abstract.php.
References TeamSpeak3_Node_Abstract\verifyNodeList().
{ $this->verifyNodeList(); return reset($this->nodeList); }
TeamSpeak3_Node_Abstract::offsetExists | ( | $ | offset | ) | [inherited] |
Definition at line 562 of file Abstract.php.
Referenced by TeamSpeak3_Node_Abstract\getProperty(), and TeamSpeak3_Node_Abstract\offsetGet().
{ return array_key_exists((string) $offset, $this->nodeInfo) ? TRUE : FALSE; }
TeamSpeak3_Node_Abstract::offsetGet | ( | $ | offset | ) | [inherited] |
Definition at line 570 of file Abstract.php.
References TeamSpeak3_Node_Abstract\fetchNodeInfo(), and TeamSpeak3_Node_Abstract\offsetExists().
Referenced by TeamSpeak3_Node_Abstract\__get().
{ if(!$this->offsetExists($offset)) { $this->fetchNodeInfo(); } if(!$this->offsetExists($offset)) { echo $offset; throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid parameter", 0x602); } return $this->nodeInfo[(string) $offset]; }
TeamSpeak3_Node_Abstract::offsetSet | ( | $ | offset, |
$ | value | ||
) | [inherited] |
Definition at line 590 of file Abstract.php.
Referenced by TeamSpeak3_Node_Abstract\__set().
{ if(method_exists($this, "modify")) { return $this->modify(array((string) $offset => $value)); } throw new TeamSpeak3_Node_Exception("node '" . get_class($this) . "' is read only"); }
TeamSpeak3_Node_Abstract::offsetUnset | ( | $ | offset | ) | [inherited] |
Definition at line 603 of file Abstract.php.
{
unset($this->nodeInfo[(string) $offset]);
}
TeamSpeak3_Node_Abstract::__get | ( | $ | offset | ) | [inherited] |
Definition at line 611 of file Abstract.php.
References TeamSpeak3_Node_Abstract\offsetGet().
{ return $this->offsetGet($offset); }
TeamSpeak3_Node_Abstract::__set | ( | $ | offset, |
$ | value | ||
) | [inherited] |
Definition at line 619 of file Abstract.php.
References TeamSpeak3_Node_Abstract\offsetSet().
{ $this->offsetSet($offset, $value); }
TeamSpeak3_Node_Host::$serverList = null [protected] |
TeamSpeak3_Node_Host::$permissionList = null [protected] |
TeamSpeak3_Node_Host::$predefined_query_name = null [protected] |
TeamSpeak3_Node_Host::$exclude_query_clients = FALSE [protected] |
TeamSpeak3_Node_Host::$start_offline_virtual = FALSE [protected] |
TeamSpeak3_Node_Host::$sort_clients_channels = FALSE [protected] |
TeamSpeak3_Node_Abstract::$parent = null [protected, inherited] |
Definition at line 37 of file Abstract.php.
TeamSpeak3_Node_Abstract::$server = null [protected, inherited] |
Definition at line 42 of file Abstract.php.
Referenced by TeamSpeak3_Node_Channel\__construct(), TeamSpeak3_Node_Channelgroup\__construct(), TeamSpeak3_Node_Servergroup\__construct(), TeamSpeak3_Node_Client\__construct(), __wakeup(), fetchNodeList(), serverCreate(), serverGetByName(), serverGetByUid(), and serverList().
TeamSpeak3_Node_Abstract::$nodeId = 0x00 [protected, inherited] |
Definition at line 47 of file Abstract.php.
TeamSpeak3_Node_Abstract::$nodeList = null [protected, inherited] |
Definition at line 52 of file Abstract.php.
TeamSpeak3_Node_Abstract::$nodeInfo = array() [protected, inherited] |
Definition at line 57 of file Abstract.php.
TeamSpeak3_Node_Abstract::$storage = array() [protected, inherited] |
Definition at line 62 of file Abstract.php.