19 private array|
null $clientList =
null;
20 private array $channelList = [];
33 $this->nodeInfo = $info;
35 if (!array_key_exists($index, $this->nodeInfo)) {
39 $this->nodeId = $this->nodeInfo[$index];
52 foreach ($this->
getParent()->channelList() as $channel) {
53 if ($channel[
"pid"] == $this->
getId()) {
54 $channels[$channel->getId()] = $channel;
74 return $this->channelList[$cid];
87 if ($channel[
"channel_name"] == $name) {
106 if ($client[
"cid"] == $this->
getId()) {
107 $clients[$client->getId()] = $client;
123 if (!array_key_exists($clid, $this->
clientList())) {
140 if ($client[
"client_nickname"] == $name) {
157 return $this->
getParent()->channelClientPermList($this->
getId(), $cldbid, $permsid);
169 public function clientPermAssign(
int $cldbid,
int|array $permid,
int|array $permvalue): void
171 $this->
getParent()->channelClientPermAssign($this->
getId(), $cldbid, $permid, $permvalue);
193 $this->
getParent()->channelClientPermRemove($this->
getId(), $cldbid, $permid);
212 public function permList(
bool $permsid =
false): array
214 return $this->
getParent()->channelPermList($this->
getId(), $permsid);
225 public function permAssign(
int|array $permid,
int|array $permvalue): void
227 $this->
getParent()->channelPermAssign($this->
getId(), $permid, $permvalue);
269 public function fileList(
string $cpw =
"",
string $path =
"/",
bool $recursive =
false): array
271 return $this->
getParent()->channelFileList($this->
getId(), $cpw, $path, $recursive);
281 public function fileInfo(
string $cpw =
"",
string $name =
"/"): array
283 return $this->
getParent()->channelFileInfo($this->
getId(), $cpw, $name);
297 public function fileRename(
string $cpw =
"",
string $oldname =
"/",
string $newname =
"/",
int $tcid =
null,
string $tcpw =
null): void
299 $this->
getParent()->channelFileRename($this->
getId(), $cpw, $oldname, $newname, $tcid, $tcpw);
309 public function fileDelete(
string $cpw =
"",
string $name =
"/"): void
311 $this->
getParent()->channelFileDelete($this->
getId(), $cpw, $name);
321 public function dirCreate(
string $cpw =
"",
string $dirname =
"/"): void
323 $this->
getParent()->channelDirCreate($this->
getId(), $cpw, $dirname);
373 return $this->
getParent()->channelIsSpacer($this);
386 $iconid = $this[
'channel_icon_id'];
387 if (!is_int($iconid)) {
388 $iconid = $iconid->toInt();
391 if ($this->
iconIsLocal(
"channel_icon_id") || $iconid == 0) {
395 $download = $this->
getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->
iconGetName(
"channel_icon_id"));
396 $transfer =
TeamSpeak3::factory(
"filetransfer://" . (str_contains($download[
"host"],
":") ?
"[" . $download[
"host"] .
"]" : $download[
"host"]) .
":" . $download[
"port"]);
398 return $transfer->download($download[
"ftkey"], $download[
"size"]);
409 public function modify(array $properties): void
411 $properties[
"cid"] = $this->
getId();
413 $this->
execute(
"channeledit", $properties);
426 public function message(
string $msg,
string $cpw =
null): void
428 if ($this->
getId() != $this->
getParent()->whoamiGet(
"client_channel_id")) {
441 public function delete(
bool $force =
false): void
453 public function move(
int $pid,
int $order =
null): void
469 public function sendPluginCmd(
string $plugin,
string $data,
string $cpw =
null,
bool $subscribed =
false): void
471 if ($this->
getId() != $this->
getParent()->whoamiGet(
"client_channel_id")) {
483 $this->nodeList = [];
485 if ($this->
getParent()->getLoadClientlistFirst()) {
487 if ($client[
"cid"] == $this->
getId()) {
488 $this->nodeList[] = $client;
493 if ($channel[
"pid"] == $this->
getId()) {
494 $this->nodeList[] = $channel;
499 if ($channel[
"pid"] == $this->
getId()) {
500 $this->nodeList[] = $channel;
505 if ($client[
"cid"] == $this->
getId()) {
506 $this->nodeList[] = $client;
519 $this->nodeInfo = array_merge($this->nodeInfo, $this->
execute(
"channelinfo", [
"cid" => $this->
getId()])->toList());
529 return $this->
getParent()->getUniqueId() .
"_ch" . $this->
getId();
539 if (!$this[
"channel_maxclients"] || ($this[
"channel_maxclients"] != -1 && $this[
"channel_maxclients"] <= $this[
"total_clients"])) {
540 return "channel_full";
541 } elseif ($this[
"channel_flag_password"]) {
542 return "channel_pass";
544 return "channel_open";
565 return (
string)$this[
"channel_name"];
Enhanced exception class for PlanetTeamSpeak\TeamSpeak3Framework\Adapter\Adapter objects.
Enhanced exception class for PlanetTeamSpeak\TeamSpeak3Framework\Helper* objects.
Enhanced exception class for PlanetTeamSpeak\TeamSpeak3Framework\Adapter\ServerQuery objects.
Helper class for string handling.
Class describing a TeamSpeak 3 channel and all it's parameters.
fileList(string $cpw="", string $path="/", bool $recursive=false)
fileRename(string $cpw="", string $oldname="/", string $newname="/", int $tcid=null, string $tcpw=null)
clientPermRemove(int $cldbid, int|array $permid)
modify(array $properties)
move(int $pid, int $order=null)
clientPermRemoveByName($cldbid, $permname)
permRemoveByName($permname)
clientPermList(int $cldbid, bool $permsid=false)
permList(bool $permsid=false)
message(string $msg, string $cpw=null)
__construct(Server $server, array $info, string $index="cid")
subChannelGetByName(int $name)
clientList(array $filter=[])
subChannelGetById(int $cid)
permAssign(int|array $permid, int|array $permvalue)
clientPermAssignByName($cldbid, $permname, $permvalue)
dirCreate(string $cpw="", string $dirname="/")
permAssignByName($permname, $permvalue)
sendPluginCmd(string $plugin, string $data, string $cpw=null, bool $subscribed=false)
fileDelete(string $cpw="", string $name="/")
clientPermAssign(int $cldbid, int|array $permid, int|array $permvalue)
clientGetByName(int $name)
subChannelList(array $filter=[])
fileInfo(string $cpw="", string $name="/")
permRemove(int|array $permid)
Class describing a TeamSpeak 3 client and all it's parameters.
filterList(array $nodes=[], array $rules=[])
execute($cmd, array $params=[])
Class describing a TeamSpeak 3 virtual server and all it's parameters.
Factory class all for TeamSpeak 3 PHP Framework objects.
const PLUGINCMD_CHANNEL
1: send plugincmd to all clients in current channel
static factory(string $uri)
const PLUGINCMD_CHANNEL_SUBSCRIBED
4: send plugincmd to all subscribed clients in current channel
const TEXTMSG_CHANNEL
2: target is a channel