ts3phpframework
Loading...
Searching...
No Matches
Host.php
Go to the documentation of this file.
1<?php
2
3namespace PlanetTeamSpeak\TeamSpeak3Framework\Node;
4
5use PlanetTeamSpeak\TeamSpeak3Framework\Adapter\ServerQuery;
6use PlanetTeamSpeak\TeamSpeak3Framework\Exception\AdapterException;
7use PlanetTeamSpeak\TeamSpeak3Framework\Exception\HelperException;
8use PlanetTeamSpeak\TeamSpeak3Framework\Exception\ServerQueryException;
9use PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert;
10use PlanetTeamSpeak\TeamSpeak3Framework\Helper\Crypt;
11use PlanetTeamSpeak\TeamSpeak3Framework\Helper\Signal;
12use PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper;
13use PlanetTeamSpeak\TeamSpeak3Framework\TeamSpeak3;
14use ReflectionClass;
15
22class Host extends Node
23{
27 protected array|null $whoami = null;
28
32 protected array|null $version = null;
33
37 protected array|null $serverList = null;
38
42 protected array|null $permissionEnds = null;
43
47 protected array|null $permissionList = null;
48
52 protected array|null $permissionCats = null;
53
57 protected string|null $predefined_query_name = null;
58
62 protected bool $exclude_query_clients = false;
63
67 protected bool $start_offline_virtual = false;
68
72 protected bool $sort_clients_channels = false;
73
79 public function __construct(ServerQuery $squery)
80 {
81 $this->parent = $squery;
82 }
83
91 public function serverSelectedId(): int
92 {
93 return $this->whoamiGet("virtualserver_id", 0);
94 }
95
103 public function serverSelectedPort(): int
104 {
105 return $this->whoamiGet("virtualserver_port", 0);
106 }
107
116 public function version(string $ident = null): mixed
117 {
118 if ($this->version === null) {
119 $this->version = $this->request("version")->toList();
120 }
121
122 return ($ident && isset($this->version[$ident])) ? $this->version[$ident] : $this->version;
123 }
124
135 public function serverSelect(int $sid, bool $virtual = null): void
136 {
137 if ($this->whoami !== null && $this->serverSelectedId() == $sid) {
138 return;
139 }
140
141 $virtual = ($virtual !== null) ? $virtual : $this->start_offline_virtual;
142 $getargs = func_get_args();
143
144 if ($sid != 0 && $this->predefined_query_name !== null) {
145 $this->execute("use", ["sid" => $sid, "client_nickname" => (string)$this->predefined_query_name, $virtual ? "-virtual" : null]);
146 } else {
147 $this->execute("use", ["sid" => $sid, $virtual ? "-virtual" : null]);
148 }
149
150 $this->whoamiReset();
151
152 if ($sid != 0 && $this->predefined_query_name !== null && $this->whoamiGet("client_nickname") != $this->predefined_query_name) {
153 $this->execute("clientupdate", ["client_nickname" => (string)$this->predefined_query_name]);
154 }
155
156 $this->setStorage("_server_use", [__FUNCTION__, $getargs]);
157
158 Signal::getInstance()->emit("notifyServerselected", $this);
159 }
160
170 public function serverSelectById(int $sid, bool $virtual = null): void
171 {
172 $this->serverSelect($sid, $virtual);
173 }
174
185 public function serverSelectByPort(int $port, bool $virtual = null): void
186 {
187 if ($this->whoami !== null && $this->serverSelectedPort() == $port) {
188 return;
189 }
190
191 $virtual = ($virtual !== null) ? $virtual : $this->start_offline_virtual;
192 $getargs = func_get_args();
193
194 if ($port != 0 && $this->predefined_query_name !== null) {
195 $this->execute("use", ["port" => $port, "client_nickname" => (string)$this->predefined_query_name, $virtual ? "-virtual" : null]);
196 } else {
197 $this->execute("use", ["port" => $port, $virtual ? "-virtual" : null]);
198 }
199
200 $this->whoamiReset();
201
202 if ($port != 0 && $this->predefined_query_name !== null && $this->whoamiGet("client_nickname") != $this->predefined_query_name) {
203 $this->execute("clientupdate", ["client_nickname" => (string)$this->predefined_query_name]);
204 }
205
206 $this->setStorage("_server_use", [__FUNCTION__, $getargs]);
207
208 Signal::getInstance()->emit("notifyServerselected", $this);
209 }
210
218 public function serverDeselect(): void
219 {
220 $this->serverSelect(0);
221
222 $this->delStorage("_server_use");
223 }
224
233 public function serverIdGetByPort(int $port): int
234 {
235 $sid = $this->execute("serveridgetbyport", ["virtualserver_port" => $port])->toList();
236
237 return $sid["server_id"];
238 }
239
248 public function serverGetPortById(int $sid): int
249 {
250 if (!array_key_exists((string)$sid, $this->serverList())) {
251 throw new ServerQueryException("invalid serverID", 0x400);
252 }
253
254 return $this->serverList[intval((string)$sid)]["virtualserver_port"];
255 }
256
264 public function serverGetSelected(): Server
265 {
266 return $this->serverGetById($this->serverSelectedId());
267 }
268
277 public function serverGetById(int $sid): Server
278 {
279 $this->serverSelectById($sid);
280
281 return new Server($this, ["virtualserver_id" => $sid]);
282 }
283
292 public function serverGetByPort(int $port): Server
293 {
294 $this->serverSelectByPort($port);
295
296 return new Server($this, ["virtualserver_id" => $this->serverSelectedId()]);
297 }
298
307 public function serverGetByName(string $name): Server
308 {
309 foreach ($this->serverList() as $server) {
310 if ($server["virtualserver_name"] == $name) {
311 return $server;
312 }
313 }
314
315 throw new ServerQueryException("invalid serverID", 0x400);
316 }
317
326 public function serverGetByUid(string $uid): Server
327 {
328 foreach ($this->serverList() as $server) {
329 if ($server["virtualserver_unique_identifier"] == $uid) {
330 return $server;
331 }
332 }
333
334 throw new ServerQueryException("invalid serverID", 0x400);
335 }
336
346 public function serverCreate(array $properties = []): array
347 {
348 $this->serverListReset();
349
350 $detail = $this->execute("servercreate", $properties)->toList();
351 $server = new Server($this, ["virtualserver_id" => intval($detail["sid"])]);
352
353 Signal::getInstance()->emit("notifyServercreated", $this, $detail["sid"]);
354 Signal::getInstance()->emit("notifyTokencreated", $server, $detail["token"]);
355
356 return $detail;
357 }
358
367 public function serverDelete(int $sid): void
368 {
369 if ($sid == $this->serverSelectedId()) {
370 $this->serverDeselect();
371 }
372
373 $this->execute("serverdelete", ["sid" => $sid]);
374 $this->serverListReset();
375
376 Signal::getInstance()->emit("notifyServerdeleted", $this, $sid);
377 }
378
387 public function serverStart(int $sid): void
388 {
389 if ($sid == $this->serverSelectedId()) {
390 $this->serverDeselect();
391 }
392
393 $this->execute("serverstart", ["sid" => $sid]);
394 $this->serverListReset();
395
396 Signal::getInstance()->emit("notifyServerstarted", $this, $sid);
397 }
398
408 public function serverStop(int $sid, string $msg = null): void
409 {
410 if ($sid == $this->serverSelectedId()) {
411 $this->serverDeselect();
412 }
413
414 $this->execute("serverstop", ["sid" => $sid, "reasonmsg" => $msg]);
415 $this->serverListReset();
416
417 Signal::getInstance()->emit("notifyServerstopped", $this, $sid);
418 }
419
428 public function serverStopProcess(string $msg = null): void
429 {
430 Signal::getInstance()->emit("notifyServershutdown", $this);
431
432 $this->execute("serverprocessstop", ["reasonmsg" => $msg]);
433 }
434
443 public function serverList(array $filter = []): array|Server
444 {
445 if ($this->serverList === null) {
446 $servers = $this->request("serverlist -uid")->toAssocArray("virtualserver_id");
447
448 $this->serverList = [];
449
450 foreach ($servers as $sid => $server) {
451 $this->serverList[$sid] = new Server($this, $server);
452 }
453
454 $this->resetNodeList();
455 }
456
457 return $this->filterList($this->serverList, $filter);
458 }
459
465 public function serverListReset(): void
466 {
467 $this->resetNodeList();
468 $this->serverList = null;
469 }
470
479 public function bindingList(string $subsystem = "voice"): array
480 {
481 return $this->execute("bindinglist", ["subsystem" => $subsystem])->toArray();
482 }
483
491 public function apiKeyCount(): int
492 {
493 return current($this->execute("apikeylist -count", ["duration" => 1])->toList("count"));
494 }
495
508 public function apiKeyList(int $offset = null, int $limit = null, mixed $cldbid = null): array
509 {
510 return $this->execute("apikeylist -count", ["start" => $offset, "duration" => $limit, "cldbid" => $cldbid])->toAssocArray("id");
511 }
512
525 public function apiKeyCreate(string $scope = TeamSpeak3::APIKEY_READ, int $lifetime = 14, int $cldbid = null): array
526 {
527 $detail = $this->execute("apikeyadd", ["scope" => $scope, "lifetime" => $lifetime, "cldbid" => $cldbid])->toList();
528
529 Signal::getInstance()->emit("notifyApikeycreated", $this, $detail["apikey"]);
530
531 return $detail;
532 }
533
542 public function apiKeyDelete(int $id): void
543 {
544 $this->execute("apikeydel", ["id" => $id]);
545 }
546
554 public function permissionList(): array
555 {
556 if ($this->permissionList === null) {
557 $this->fetchPermissionList();
558 }
559
560 foreach ($this->permissionList as $permname => $permdata) {
561 if (isset($permdata["permcatid"]) && $permdata["permgrant"]) {
562 continue;
563 }
564
565 $this->permissionList[$permname]["permcatid"] = $this->permissionGetCategoryById($permdata["permid"]);
566 $this->permissionList[$permname]["permgrant"] = $this->permissionGetGrantById($permdata["permid"]);
567
568 $grantsid = "i_needed_modify_power_" . substr($permname, 2);
569
570 if (!$permdata["permname"]->startsWith("i_needed_modify_power_") && !isset($this->permissionList[$grantsid])) {
571 $this->permissionList[$grantsid]["permid"] = $this->permissionList[$permname]["permgrant"];
572 $this->permissionList[$grantsid]["permname"] = StringHelper::factory($grantsid);
573 $this->permissionList[$grantsid]["permdesc"] = null;
574 $this->permissionList[$grantsid]["permcatid"] = 0xFF;
575 $this->permissionList[$grantsid]["permgrant"] = $this->permissionList[$permname]["permgrant"];
576 }
577 }
578
580 }
581
587 public function permissionCats(): array
588 {
589 if ($this->permissionCats === null) {
590 $this->fetchPermissionCats();
591 }
592
594 }
595
603 public function permissionEnds(): array
604 {
605 if ($this->permissionEnds === null) {
606 $this->fetchPermissionList();
607 }
608
610 }
611
620 public function permissionTree(): array
621 {
623
624 $permtree = [];
625
626 foreach ($this->permissionCats() as $val) {
627 $permtree[$val]["permcatid"] = $val;
628 $permtree[$val]["permcathex"] = "0x" . dechex($val);
629 $permtree[$val]["permcatname"] = StringHelper::factory(Convert::permissionCategory($val));
630 $permtree[$val]["permcatparent"] = $permtree[$val]["permcathex"][3] == 0 ? 0 : hexdec($permtree[$val]["permcathex"][2] . 0);
631 $permtree[$val]["permcatchilren"] = 0;
632 $permtree[$val]["permcatcount"] = 0;
633
634 if (isset($permtree[$permtree[$val]["permcatparent"]])) {
635 $permtree[$permtree[$val]["permcatparent"]]["permcatchilren"]++;
636 }
637
638 if ($permtree[$val]["permcatname"]->contains("/")) {
639 $permtree[$val]["permcatname"] = $permtree[$val]["permcatname"]->section("/", 1)->trim();
640 }
641
642 foreach ($permissionList as $permission) {
643 if ((! array_key_exists("permid", $permission)) or (! array_key_exists("permcatid", $permission["permid"]))) {
644 continue;
645 }
646 if ($permission["permid"]["permcatid"] == $val) {
647 $permtree[$val]["permcatcount"]++;
648 }
649 }
650 }
651
652 return $permtree;
653 }
654
664 public function permissionFind(int|array $permissionId): array
665 {
666 if (!is_array($permissionId)) {
667 $permident = (is_numeric($permissionId)) ? "permid" : "permsid";
668 } else {
669 $permident = (is_numeric(current($permissionId))) ? "permid" : "permsid";
670 }
671
672 return $this->execute("permfind", [$permident => $permissionId])->toArray();
673 }
674
683 public function permissionGetIdByName(string $name): int
684 {
685 if (!array_key_exists($name, $this->permissionList())) {
686 throw new ServerQueryException("invalid permission ID", 0xA02);
687 }
688
689 return $this->permissionList[$name]["permid"];
690 }
691
700 public function permissionGetNameById(int $permissionId): StringHelper
701 {
702 foreach ($this->permissionList() as $name => $perm) {
703 if ($perm["permid"] == $permissionId) {
704 return new StringHelper($name);
705 }
706 }
707
708 throw new ServerQueryException("invalid permission ID", 0xA02);
709 }
710
722 public function permissionGetCategoryById(int $permid): int
723 {
724 if (!is_numeric($permid)) {
725 $permid = $this->permissionGetIdByName($permid);
726 }
727
728 if ($permid < 0x1000) {
729 if ($this->permissionEnds === null) {
730 $this->fetchPermissionList();
731 }
732
733 if ($this->permissionCats === null) {
734 $this->fetchPermissionCats();
735 }
736
737 $catids = array_values($this->permissionCats());
738
739 foreach ($this->permissionEnds as $key => $val) {
740 if ($val >= $permid && isset($catids[$key])) {
741 return $catids[$key];
742 }
743 }
744
745 return 0;
746 } else {
747 return (int)$permid >> 8;
748 }
749 }
750
762 public function permissionGetGrantById(int $permid): int
763 {
764 if (!is_numeric($permid)) {
765 $permid = $this->permissionGetIdByName($permid);
766 }
767
768 if ($permid < 0x1000) {
769 return (int)$permid + 0x8000;
770 } else {
771 return (int)bindec(substr(decbin($permid), -8)) + 0xFF00;
772 }
773 }
774
788 public function serverGroupPermAutoAssign(int $sgtype, int|array $permid, int|array $permvalue, int|array $permnegated = 0, array|bool $permskip = false): void
789 {
790 if (!is_array($permid)) {
791 $permident = (is_numeric($permid)) ? "permid" : "permsid";
792 } else {
793 $permident = (is_numeric(current($permid))) ? "permid" : "permsid";
794 }
795
796 $this->execute("servergroupautoaddperm", ["sgtype" => $sgtype, $permident => $permid, "permvalue" => $permvalue, "permnegated" => $permnegated, "permskip" => $permskip]);
797 }
798
809 public function serverGroupPermAutoRemove(int $sgtype, int|array $permid): void
810 {
811 if (!is_array($permid)) {
812 $permident = (is_numeric($permid)) ? "permid" : "permsid";
813 } else {
814 $permident = (is_numeric(current($permid))) ? "permid" : "permsid";
815 }
816
817 $this->execute("servergroupautodelperm", ["sgtype" => $sgtype, $permident => $permid]);
818 }
819
828 public function selfPermCheck(int|array $permid): array
829 {
830 if (!is_array($permid)) {
831 $permident = (is_numeric($permid)) ? "permid" : "permsid";
832 } else {
833 $permident = (is_numeric(current($permid))) ? "permid" : "permsid";
834 }
835
836 return $this->execute("permget", [$permident => $permid])->toAssocArray("permsid");
837 }
838
847 public function modify(array $properties): void
848 {
849 $this->execute("instanceedit", $properties);
850 $this->resetNodeInfo();
851 }
852
861 public function message(string $msg): void
862 {
863 $this->execute("gm", ["msg" => $msg]);
864 }
865
877 public function logView(int $lines = 30, int $begin_pos = null, bool $reverse = null, bool $instance = true): array
878 {
879 return $this->execute("logview", ["lines" => $lines, "begin_pos" => $begin_pos, "instance" => $instance, "reverse" => $reverse])->toArray();
880 }
881
891 public function logAdd(string $logmsg, int $loglevel = TeamSpeak3::LOGLEVEL_INFO): void
892 {
893 $sid = $this->serverSelectedId();
894
895 $this->serverDeselect();
896 $this->execute("logadd", ["logmsg" => $logmsg, "loglevel" => $loglevel]);
897 $this->serverSelect($sid);
898 }
899
910 public function login(string $username, string $password): void
911 {
912 $this->execute("login", ["client_login_name" => $username, "client_login_password" => $password]);
913 $this->whoamiReset();
914
915 $crypt = new Crypt($username);
916
917 $this->setStorage("_login_user", $username);
918 $this->setStorage("_login_pass", $crypt->encrypt($password));
919
920 Signal::getInstance()->emit("notifyLogin", $this);
921 }
922
930 public function logout(): void
931 {
932 $this->request("logout");
933 $this->whoamiReset();
934
935 $this->delStorage("_login_user");
936 $this->delStorage("_login_pass");
937
938 Signal::getInstance()->emit("notifyLogout", $this);
939 }
940
949 public function queryCountLogin(string $pattern = null): mixed
950 {
951 return current($this->execute("queryloginlist -count", ["duration" => 1, "pattern" => $pattern])->toList("count"));
952 }
953
965 public function queryListLogin(int $offset = null, int $limit = null, string $pattern = null): array
966 {
967 return $this->execute("queryloginlist -count", ["start" => $offset, "duration" => $limit, "pattern" => $pattern])->toAssocArray("cldbid");
968 }
969
981 public function queryLoginCreate(string $username, int $cldbid = 0): array
982 {
983 if ($this->serverSelectedId()) {
984 return $this->execute("queryloginadd", ["client_login_name" => $username, "cldbid" => $cldbid])->toList();
985 } else {
986 return $this->execute("queryloginadd", ["client_login_name" => $username])->toList();
987 }
988 }
989
997 public function queryLoginDelete(int $cldbid)
998 {
999 $this->execute("querylogindel", ["cldbid" => $cldbid]);
1000 }
1001
1009 public function whoami(): array
1010 {
1011 if ($this->whoami === null) {
1012 $this->whoami = $this->request("whoami")->toList();
1013 }
1014
1015 return $this->whoami;
1016 }
1017
1027 public function whoamiGet(string $ident, mixed $default = null): mixed
1028 {
1029 if (array_key_exists($ident, $this->whoami())) {
1030 return $this->whoami[$ident];
1031 }
1032
1033 return $default;
1034 }
1035
1044 public function whoamiSet(string $ident, mixed $value = null)
1045 {
1046 $this->whoami();
1047
1048 $this->whoami[$ident] = (is_numeric($value)) ? (int)$value : StringHelper::factory($value);
1049 }
1050
1054 public function whoamiReset()
1055 {
1056 $this->whoami = null;
1057 }
1058
1064 public function getAdapterHost(): string
1065 {
1066 return $this->getParent()->getTransportHost();
1067 }
1068
1074 public function getAdapterPort(): string
1075 {
1076 return $this->getParent()->getTransportPort();
1077 }
1078
1084 protected function fetchNodeList()
1085 {
1086 $servers = $this->serverList();
1087
1088 foreach ($servers as $server) {
1089 $this->nodeList[] = $server;
1090 }
1091 }
1092
1098 protected function fetchNodeInfo()
1099 {
1100 $info1 = $this->request("hostinfo")->toList();
1101 $info2 = $this->request("instanceinfo")->toList();
1102
1103 $this->nodeInfo = array_merge($this->nodeInfo, $info1, $info2);
1104 }
1105
1111 protected function fetchPermissionList()
1112 {
1113 $reply = $this->request("permissionlist -new")->toArray();
1114 $start = 1;
1115
1116 $this->permissionEnds = [];
1117 $this->permissionList = [];
1118
1119 foreach ($reply as $line) {
1120 if (array_key_exists("group_id_end", $line)) {
1121 $this->permissionEnds[] = $line["group_id_end"];
1122 } else {
1123 $this->permissionList[$line["permname"]->toString()] = array_merge(["permid" => $start++], $line);
1124 }
1125 }
1126 }
1127
1131 protected function fetchPermissionCats()
1132 {
1133 $permcats = [];
1134 $reflects = new ReflectionClass("TeamSpeak3");
1135
1136 foreach ($reflects->getConstants() as $key => $val) {
1137 if (!StringHelper::factory($key)->startsWith("PERM_CAT") || $val == 0xFF) {
1138 continue;
1139 }
1140
1141 $permcats[$key] = $val;
1142 }
1143
1144 $this->permissionCats = $permcats;
1145 }
1146
1153 public function setPredefinedQueryName(string $name = null)
1154 {
1155 $this->setStorage("_query_nick", $name);
1156
1157 $this->predefined_query_name = $name;
1158 }
1159
1166 public function getPredefinedQueryName(): ?string
1167 {
1169 }
1170
1178 public function setExcludeQueryClients(bool $exclude = false): void
1179 {
1180 $this->setStorage("_query_hide", $exclude);
1181
1182 $this->exclude_query_clients = $exclude;
1183 }
1184
1191 public function getExcludeQueryClients(): bool
1192 {
1194 }
1195
1203 public function setUseOfflineAsVirtual(bool $virtual = false): void
1204 {
1205 $this->setStorage("_do_virtual", $virtual);
1206
1207 $this->start_offline_virtual = $virtual;
1208 }
1209
1216 public function getUseOfflineAsVirtual(): bool
1217 {
1219 }
1220
1227 public function setLoadClientlistFirst(bool $first = false)
1228 {
1229 $this->setStorage("_client_top", $first);
1230
1231 $this->sort_clients_channels = $first;
1232 }
1233
1240 public function getLoadClientlistFirst(): bool
1241 {
1243 }
1244
1250 public function getAdapter(): ServerQuery
1251 {
1252 return $this->getParent();
1253 }
1254
1260 public function getUniqueId(): string
1261 {
1262 return "ts3_h";
1263 }
1264
1270 public function getIcon(): string
1271 {
1272 return "host";
1273 }
1274
1280 public function getSymbol(): string
1281 {
1282 return "+";
1283 }
1284
1293 public function __wakeup()
1294 {
1295 $username = $this->getStorage("_login_user");
1296 $password = $this->getStorage("_login_pass");
1297
1298 if ($username && $password) {
1299 $crypt = new Crypt($username);
1300
1301 $this->login($username, $crypt->decrypt($password));
1302 }
1303
1304 $this->predefined_query_name = $this->getStorage("_query_nick");
1305 $this->exclude_query_clients = $this->getStorage("_query_hide", false);
1306 $this->start_offline_virtual = $this->getStorage("_do_virtual", false);
1307 $this->sort_clients_channels = $this->getStorage("_client_top", false);
1308
1309 if ($server = $this->getStorage("_server_use")) {
1310 $func = array_shift($server);
1311 $args = array_shift($server);
1312
1313 call_user_func_array([$this, $func], $args);
1314 }
1315 }
1316
1322 public function __toString()
1323 {
1324 return $this->getAdapterHost();
1325 }
1326}
Enhanced exception class for PlanetTeamSpeak\TeamSpeak3Framework\Adapter\ServerQuery objects.
Helper class for data encryption.
Definition Crypt.php:16
Class describing a TeamSpeak 3 server instance and all it's parameters.
Definition Host.php:23
bindingList(string $subsystem="voice")
Definition Host.php:479
setUseOfflineAsVirtual(bool $virtual=false)
Definition Host.php:1203
whoamiGet(string $ident, mixed $default=null)
Definition Host.php:1027
serverGroupPermAutoAssign(int $sgtype, int|array $permid, int|array $permvalue, int|array $permnegated=0, array|bool $permskip=false)
Definition Host.php:788
serverGroupPermAutoRemove(int $sgtype, int|array $permid)
Definition Host.php:809
whoamiSet(string $ident, mixed $value=null)
Definition Host.php:1044
serverSelectByPort(int $port, bool $virtual=null)
Definition Host.php:185
apiKeyCreate(string $scope=TeamSpeak3::APIKEY_READ, int $lifetime=14, int $cldbid=null)
Definition Host.php:525
logView(int $lines=30, int $begin_pos=null, bool $reverse=null, bool $instance=true)
Definition Host.php:877
queryLoginCreate(string $username, int $cldbid=0)
Definition Host.php:981
login(string $username, string $password)
Definition Host.php:910
queryListLogin(int $offset=null, int $limit=null, string $pattern=null)
Definition Host.php:965
apiKeyList(int $offset=null, int $limit=null, mixed $cldbid=null)
Definition Host.php:508
setExcludeQueryClients(bool $exclude=false)
Definition Host.php:1178
logAdd(string $logmsg, int $loglevel=TeamSpeak3::LOGLEVEL_INFO)
Definition Host.php:891
serverSelect(int $sid, bool $virtual=null)
Definition Host.php:135
permissionFind(int|array $permissionId)
Definition Host.php:664
serverStop(int $sid, string $msg=null)
Definition Host.php:408
serverSelectById(int $sid, bool $virtual=null)
Definition Host.php:170
filterList(array $nodes=[], array $rules=[])
Definition Node.php:225
request(string $cmd, bool $throw=true)
Definition Node.php:64
getStorage(string $key, mixed $default=null)
Definition Node.php:382
setStorage(string $key, mixed $val)
Definition Node.php:370
Class describing a TeamSpeak 3 virtual server and all it's parameters.
Definition Server.php:21
const LOGLEVEL_INFO
4: informational output
const APIKEY_READ
allow access to read-only calls