Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like ts3admin often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use ts3admin, and based on these observations, apply Extract Interface, too.
1 | <?PHP |
||
44 | class ts3admin { |
||
|
|||
45 | |||
46 | //******************************************************************************************* |
||
47 | //****************************************** Vars ******************************************* |
||
48 | //******************************************************************************************* |
||
49 | |||
50 | /** |
||
51 | * runtime is an private handle and configuration storage |
||
52 | * |
||
53 | * @author Par0noid Solutions |
||
54 | */ |
||
55 | private $runtime = array('socket' => '', 'selected' => false, 'host' => '', 'queryport' => '10011', 'timeout' => 2, 'debug' => array(), 'fileSocket' => ''); |
||
56 | |||
57 | |||
58 | //******************************************************************************************* |
||
59 | //************************************ Public Functions ************************************* |
||
60 | //****************************************************************************************** |
||
61 | |||
62 | /** |
||
63 | * banAddByIp |
||
64 | * |
||
65 | * Adds a new ban rule on the selected virtual server. |
||
66 | * |
||
67 | * <b>Output:</b> |
||
68 | * <pre> |
||
69 | * Array |
||
70 | * { |
||
71 | * [banid] => 109 |
||
72 | * } |
||
73 | * </pre> |
||
74 | * |
||
75 | * @author Par0noid Solutions |
||
76 | * @param string $ip clientIp |
||
77 | * @param integer $time bantime in seconds (0=unlimited) |
||
78 | * @param string $banreason Banreason [optional] |
||
79 | * @return array banId |
||
80 | */ |
||
81 | View Code Duplication | function banAddByIp($ip, $time, $banreason = NULL) { |
|
88 | |||
89 | /** |
||
90 | * banAddByUid |
||
91 | * |
||
92 | * Adds a new ban rule on the selected virtual server. |
||
93 | * |
||
94 | * <b>Output:</b> |
||
95 | * <pre> |
||
96 | * Array |
||
97 | * { |
||
98 | * [banid] => 110 |
||
99 | * } |
||
100 | * </pre> |
||
101 | * |
||
102 | * @author Par0noid Solutions |
||
103 | * @param string $uid clientUniqueId |
||
104 | * @param integer $time bantime in seconds (0=unlimited) |
||
105 | * @param string $banreason Banreason [optional] |
||
106 | * @return array banId |
||
107 | */ |
||
108 | View Code Duplication | function banAddByUid($uid, $time, $banreason = NULL) { |
|
115 | |||
116 | /** |
||
117 | * banAddByName |
||
118 | * |
||
119 | * Adds a new ban rule on the selected virtual server. |
||
120 | * |
||
121 | * <b>Output:</b> |
||
122 | * <pre> |
||
123 | * Array |
||
124 | * { |
||
125 | * [banid] => 111 |
||
126 | * } |
||
127 | * </pre> |
||
128 | * |
||
129 | * @author Par0noid Solutions |
||
130 | * @param string $name clientName |
||
131 | * @param integer $time bantime in seconds (0=unlimited) |
||
132 | * @param string $banreason Banreason [optional] |
||
133 | * @return array banId |
||
134 | */ |
||
135 | View Code Duplication | function banAddByName($name, $time, $banreason = NULL) { |
|
142 | |||
143 | /** |
||
144 | * banClient |
||
145 | * |
||
146 | * Bans the client specified with ID clid from the server. Please note that this will create two separate ban rules for the targeted clients IP address and his unique identifier. |
||
147 | * |
||
148 | * <b>Output:</b> |
||
149 | * <pre> |
||
150 | * Array |
||
151 | * { |
||
152 | * [1] => 129 |
||
153 | * [2] => 130 |
||
154 | * } |
||
155 | * </pre> |
||
156 | * |
||
157 | * @author Par0noid Solutions |
||
158 | * @param integer $clid clientId |
||
159 | * @param integer $time bantime in seconds (0=unlimited) |
||
160 | * @param string $banreason Banreason [optional] |
||
161 | * @return array banIds |
||
162 | */ |
||
163 | function banClient($clid, $time, $banreason = NULL) { |
||
176 | |||
177 | /** |
||
178 | * banDelete |
||
179 | * |
||
180 | * Deletes the ban rule with ID banid from the server. |
||
181 | * |
||
182 | * @author Par0noid Solutions |
||
183 | * @param integer $banID banID |
||
184 | * @return boolean success |
||
185 | */ |
||
186 | function banDelete($banID) { |
||
190 | |||
191 | /** |
||
192 | * banDeleteAll |
||
193 | * |
||
194 | * Deletes all active ban rules from the server. |
||
195 | * |
||
196 | * @author Par0noid Solutions |
||
197 | * @return boolean success |
||
198 | */ |
||
199 | function banDeleteAll() { |
||
203 | |||
204 | /** |
||
205 | * banList |
||
206 | * |
||
207 | * Displays a list of active bans on the selected virtual server. |
||
208 | * |
||
209 | * <b>Output:</b> |
||
210 | * <pre> |
||
211 | * Array |
||
212 | * { |
||
213 | * [banid] => 131 |
||
214 | * [ip] => 1.2.3.4 |
||
215 | * [name] => eugen |
||
216 | * [uid] => IYAntAcZHgVC7s3n3DNWmuJB/aM= |
||
217 | * [created] => 1286660391 |
||
218 | * [duration] => 0 |
||
219 | * [invokername] => Par0noid |
||
220 | * [invokercldbid] => 2086 |
||
221 | * [invokeruid] => nUixbsq/XakrrmbqU8O30R/D8Gc= |
||
222 | * [reason] => insult |
||
223 | * [enforcements] => 0 |
||
224 | * } |
||
225 | * </pre> |
||
226 | * |
||
227 | * @author Par0noid Solutions |
||
228 | * @return array banlist |
||
229 | */ |
||
230 | function banList() { |
||
234 | |||
235 | /** |
||
236 | * bindingList |
||
237 | * |
||
238 | * Displays a list of IP addresses used by the server instance on multi-homed machines. |
||
239 | * |
||
240 | * <b>Output:</b> |
||
241 | * <pre> |
||
242 | * Array |
||
243 | * { |
||
244 | * [ip] => 0.0.0.0 |
||
245 | * } |
||
246 | * </pre> |
||
247 | * |
||
248 | * @author Par0noid Solutions |
||
249 | * @return array bindingList |
||
250 | */ |
||
251 | function bindingList() { |
||
254 | |||
255 | /** |
||
256 | * channelAddPerm |
||
257 | * |
||
258 | * Adds a set of specified permissions to a channel. Multiple permissions can be added by providing the two parameters of each permission. A permission can be specified by permid or permsid. |
||
259 | * |
||
260 | * <b>Input-Array like this:</b> |
||
261 | * <pre> |
||
262 | * $permissions = array(); |
||
263 | * $permissions['permissionID'] = 'permissionValue'; |
||
264 | * //or you could use Permission Name |
||
265 | * $permissions['permissionName'] = 'permissionValue'; |
||
266 | * </pre> |
||
267 | * |
||
268 | * @author Par0noid Solutions |
||
269 | * @param integer $cid channelId |
||
270 | * @param array $permissions permissions |
||
271 | * @return boolean success |
||
272 | */ |
||
273 | View Code Duplication | function channelAddPerm($cid, $permissions) { |
|
320 | |||
321 | /** |
||
322 | * channelClientAddPerm |
||
323 | * |
||
324 | * Adds a set of specified permissions to a client in a specific channel. Multiple permissions can be added by providing the three parameters of each permission. A permission can be specified by permid or permsid. |
||
325 | * |
||
326 | * <b>Input-Array like this:</b> |
||
327 | * <pre> |
||
328 | * $permissions = array(); |
||
329 | * $permissions['permissionID'] = 'permissionValue'; |
||
330 | * //or you could use Permission Name |
||
331 | * $permissions['permissionName'] = 'permissionValue'; |
||
332 | * </pre> |
||
333 | * |
||
334 | * @author Par0noid Solutions |
||
335 | * @param integer $cid channelID |
||
336 | * @param integer $cldbid clientDBID |
||
337 | * @param array $permissions permissions |
||
338 | * @return boolean success |
||
339 | */ |
||
340 | View Code Duplication | function channelClientAddPerm($cid, $cldbid, $permissions) { |
|
387 | |||
388 | /** |
||
389 | * channelClientDelPerm |
||
390 | * |
||
391 | * Removes a set of specified permissions from a client in a specific channel. Multiple permissions can be removed at once. A permission can be specified by permid or permsid. |
||
392 | * |
||
393 | * <b>Input-Array like this:</b> |
||
394 | * <pre> |
||
395 | * $permissions = array(); |
||
396 | * $permissions[] = 'permissionID'; |
||
397 | * $permissions[] = 'permissionName'; |
||
398 | * //or |
||
399 | * $permissions = array('permissionID', 'permissionName', 'permissionID'); |
||
400 | * </pre> |
||
401 | * |
||
402 | * @author Par0noid Solutions |
||
403 | * @param integer $cid channelID |
||
404 | * @param integer $cldbid clientDBID |
||
405 | * @param array $permissions permissions |
||
406 | * @return boolean success |
||
407 | */ |
||
408 | function channelClientDelPerm($cid, $cldbid, $permissions) { |
||
422 | |||
423 | /** |
||
424 | * channelClientPermList |
||
425 | * |
||
426 | * Displays a list of permissions defined for a client in a specific channel. |
||
427 | * |
||
428 | * <b>Output:</b> |
||
429 | * <pre> |
||
430 | * Array |
||
431 | * { |
||
432 | * [cid] => 250 (only in first result) |
||
433 | * [cldbid] => 2086 (only in first result) |
||
434 | * [permid] => 12876 (if permsid = false) |
||
435 | * [permsid] => b_client_info_view (if permsid = true) |
||
436 | * [permvalue] => 1 |
||
437 | * [permnegated] => 0 |
||
438 | * [permskip] => 0 |
||
439 | * } |
||
440 | * </pre> |
||
441 | * |
||
442 | * @author Par0noid Solutions |
||
443 | * @param integer $cid channelID |
||
444 | * @param integer $cldbid clientDBID |
||
445 | * @param boolean $permsid displays permissionName instead of permissionID |
||
446 | * @return array channelclientpermlist |
||
447 | */ |
||
448 | function channelClientPermList($cid, $cldbid, $permsid = false) { |
||
452 | |||
453 | /** |
||
454 | * channelCreate |
||
455 | * |
||
456 | * Creates a new channel using the given properties and displays its ID. Note that this command accepts multiple properties which means that you're able to specifiy all settings of the new channel at once. |
||
457 | * |
||
458 | * <b style="color:red">Hint:</b> don't forget to set channel_flag_semi_permanent = 1 or channel_flag_permanent = 1 |
||
459 | * |
||
460 | * <b style="color:red">Hint:</b> you'll get an error if you want to create a channel without channel_name |
||
461 | * |
||
462 | * <b>Input-Array like this:</b> |
||
463 | * <pre> |
||
464 | * $data = array(); |
||
465 | * |
||
466 | * $data['setting'] = 'value'; |
||
467 | * $data['setting'] = 'value'; |
||
468 | * </pre> |
||
469 | * |
||
470 | * <b>Output:</b> |
||
471 | * <pre> |
||
472 | * Array |
||
473 | * { |
||
474 | * [cid] => 257 |
||
475 | * } |
||
476 | * </pre> |
||
477 | * |
||
478 | * @author Par0noid Solutions |
||
479 | * @param array $data properties |
||
480 | * @return array channelInfo |
||
481 | */ |
||
482 | View Code Duplication | function channelCreate($data) { |
|
493 | |||
494 | /** |
||
495 | * channelDelete |
||
496 | * |
||
497 | * Deletes an existing channel by ID. If force is set to 1, the channel will be deleted even if there are clients within. The clients will be kicked to the default channel with an appropriate reason message. |
||
498 | * |
||
499 | * @author Par0noid Solutions |
||
500 | * @param integer $cid channelID |
||
501 | * @param integer $force {1|0} (default: 1) |
||
502 | * @return boolean success |
||
503 | */ |
||
504 | function channelDelete($cid, $force = 1) { |
||
508 | |||
509 | /** |
||
510 | * channelDelPerm |
||
511 | * |
||
512 | * Removes a set of specified permissions from a channel. Multiple permissions can be removed at once. A permission can be specified by permid or permsid. |
||
513 | * |
||
514 | * <b>Input-Array like this:</b> |
||
515 | * <pre> |
||
516 | * $permissions = array(); |
||
517 | * $permissions[] = 'permissionID'; |
||
518 | * //or you could use |
||
519 | * $permissions[] = 'permissionName'; |
||
520 | * </pre> |
||
521 | * |
||
522 | * @author Par0noid Solutions |
||
523 | * @param integer $cid channelID |
||
524 | * @param array $permissions permissions |
||
525 | * @return boolean success |
||
526 | */ |
||
527 | function channelDelPerm($cid, $permissions) { |
||
541 | |||
542 | /** |
||
543 | * channelEdit |
||
544 | * |
||
545 | * Changes a channels configuration using given properties. Note that this command accepts multiple properties which means that you're able to change all settings of the channel specified with cid at once. |
||
546 | * |
||
547 | * <b>Input-Array like this:</b> |
||
548 | <pre> |
||
549 | $data = array(); |
||
550 | |||
551 | $data['setting'] = 'value'; |
||
552 | $data['setting'] = 'value'; |
||
553 | </pre> |
||
554 | * |
||
555 | * @author Par0noid Solutions |
||
556 | * @param integer $cid $channelID |
||
557 | * @param array $data edited settings |
||
558 | * @return boolean success |
||
559 | */ |
||
560 | View Code Duplication | function channelEdit($cid, $data) { |
|
571 | |||
572 | /** |
||
573 | * channelFind |
||
574 | * |
||
575 | * displays a list of channels matching a given name pattern. |
||
576 | * |
||
577 | * <b>Output:</b> |
||
578 | * <pre> |
||
579 | * Array |
||
580 | * { |
||
581 | * [cid] => 2 |
||
582 | * [channel_name] => Lobby |
||
583 | * } |
||
584 | * </pre> |
||
585 | * |
||
586 | * @author Par0noid Solutions |
||
587 | * @param string $pattern channelName |
||
588 | * @return array channelList |
||
589 | */ |
||
590 | function channelFind($pattern) { |
||
594 | |||
595 | /** |
||
596 | * channelGroupAdd |
||
597 | * |
||
598 | * Creates a new channel group using a given name and displays its ID. The optional type parameter can be used to create ServerQuery groups and template groups. |
||
599 | * |
||
600 | * <b>groupDbTypes:</b> |
||
601 | * <ol start="0"> |
||
602 | * <li>template group (used for new virtual servers)</li> |
||
603 | * <li>regular group (used for regular clients)</li> |
||
604 | * <li>global query group (used for ServerQuery clients)</li> |
||
605 | * </ol> |
||
606 | * |
||
607 | * <b>Output:</b> |
||
608 | * <pre> |
||
609 | * Array |
||
610 | * { |
||
611 | * [cgid] => 86 |
||
612 | * } |
||
613 | * </pre> |
||
614 | * |
||
615 | * @author Par0noid Solutions |
||
616 | * @param integer $name groupName |
||
617 | * @param integer $type groupDbType [optional] (default: 1) |
||
618 | * @return boolean success |
||
619 | */ |
||
620 | function channelGroupAdd($name, $type = 1) { |
||
624 | |||
625 | /** |
||
626 | * channelGroupAddPerm |
||
627 | * |
||
628 | * Adds a set of specified permissions to a channel group. Multiple permissions can be added by providing the two parameters of each permission. A permission can be specified by permid or permsid. |
||
629 | * |
||
630 | * <b>Input-Array like this:</b> |
||
631 | * <pre> |
||
632 | * $permissions = array(); |
||
633 | * $permissions['permissionID'] = 'permissionValue'; |
||
634 | * //or you could use: |
||
635 | * $permissions['permissionName'] = 'permissionValue'; |
||
636 | * </pre> |
||
637 | * |
||
638 | * @author Par0noid Solutions |
||
639 | * @param integer $cgid channelGroupID |
||
640 | * @param array $permissions permissions |
||
641 | * @return boolean success |
||
642 | */ |
||
643 | View Code Duplication | function channelGroupAddPerm($cgid, $permissions) { |
|
689 | |||
690 | /** |
||
691 | * channelGroupClientList |
||
692 | * |
||
693 | * Displays all the client and/or channel IDs currently assigned to channel groups. All three parameters are optional so you're free to choose the most suitable combination for your requirement |
||
694 | * |
||
695 | * <b>Output:</b> |
||
696 | * <pre> |
||
697 | * Array |
||
698 | * { |
||
699 | * [cid] => 2 |
||
700 | * [cldbid] => 9 |
||
701 | * [cgid] => 9 |
||
702 | * } |
||
703 | * </pre> |
||
704 | * |
||
705 | * @author Par0noid Solutions |
||
706 | * @param integer $cid channelID [optional] |
||
707 | * @param integer $cldbid clientDBID [optional] |
||
708 | * @param integer $cgid channelGroupID [optional] |
||
709 | * @return array channelGroupClientList |
||
710 | */ |
||
711 | function channelGroupClientList($cid = NULL, $cldbid = NULL, $cgid = NULL) { |
||
716 | |||
717 | /** |
||
718 | * channelGroupCopy |
||
719 | * |
||
720 | * Creates a copy of the channel group specified with scgid. If tcgid is set to 0, the server will create a new group. To overwrite an existing group, simply set tcgid to the ID of a designated target group. If a target group is set, the name parameter will be ignored. The type parameter can be used to create ServerQuery groups and template groups. |
||
721 | * |
||
722 | * <b>groupDbTypes:</b> |
||
723 | * <ol start="0"> |
||
724 | * <li>template group (used for new virtual servers)</li> |
||
725 | * <li>regular group (used for regular clients)</li> |
||
726 | * <li>global query group (used for ServerQuery clients)</li> |
||
727 | * </ol> |
||
728 | * |
||
729 | * <b>Output:</b> |
||
730 | * <pre> |
||
731 | * Array |
||
732 | * { |
||
733 | * [cgid] => 86 |
||
734 | * } |
||
735 | * </pre> |
||
736 | * |
||
737 | * @author Par0noid Solutions |
||
738 | * @param integer $scgid sourceChannelGroupID |
||
739 | * @param integer $tcgid targetChannelGroupID |
||
740 | * @param integer $name groupName |
||
741 | * @param integer $type groupDbType |
||
742 | * @return array groupId |
||
743 | */ |
||
744 | function channelGroupCopy($scgid, $tcgid, $name, $type = 1) { |
||
748 | |||
749 | /** |
||
750 | * channelGroupDelete |
||
751 | * |
||
752 | * Deletes a channel group by ID. If force is set to 1, the channel group will be deleted even if there are clients within. |
||
753 | * |
||
754 | * @author Par0noid Solutions |
||
755 | * @param integer $cgid channelGroupID |
||
756 | * @param integer $force forces deleting channelGroup (default: 1) |
||
757 | * @return boolean success |
||
758 | */ |
||
759 | function channelGroupDelete($cgid, $force = 1) { |
||
763 | |||
764 | /** |
||
765 | * channelGroupDelPerm |
||
766 | * |
||
767 | * Removes a set of specified permissions from the channel group. Multiple permissions can be removed at once. A permission can be specified by permid or permsid. |
||
768 | * |
||
769 | * <b>Input-Array like this:</b> |
||
770 | * <pre> |
||
771 | * $permissions = array(); |
||
772 | * $permissions[] = 'permissionID'; |
||
773 | * $permissions[] = 'permissionName'; |
||
774 | * </pre> |
||
775 | * |
||
776 | * @author Par0noid Solutions |
||
777 | * @param integer $cgid channelGroupID |
||
778 | * @param array $permissions permissions |
||
779 | * @return boolean success |
||
780 | */ |
||
781 | function channelGroupDelPerm($cgid, $permissions) { |
||
795 | |||
796 | /** |
||
797 | * channelGroupList |
||
798 | * |
||
799 | * Displays a list of channel groups available on the selected virtual server. |
||
800 | * |
||
801 | * <b>Output:</b> |
||
802 | * <pre> |
||
803 | * Array |
||
804 | * { |
||
805 | * [cgid] => 3 |
||
806 | * [name] => Testname |
||
807 | * [type] => 0 |
||
808 | * [iconid] => 100 |
||
809 | * [savedb] => 1 |
||
810 | * [sortid] => 0 |
||
811 | * [namemode] => 0 |
||
812 | * [n_modifyp] => 75 |
||
813 | * [n_member_addp] => 50 |
||
814 | * [n_member_removep] => 50 |
||
815 | * } |
||
816 | * </pre> |
||
817 | * |
||
818 | * @author Par0noid Solutions |
||
819 | * @return array channelGroupList |
||
820 | */ |
||
821 | function channelGroupList() { |
||
826 | |||
827 | /** |
||
828 | * channelGroupPermList |
||
829 | * |
||
830 | * Displays a list of permissions assigned to the channel group specified with cgid. |
||
831 | * If the permsid option is specified, the output will contain the permission names instead of the internal IDs. |
||
832 | * |
||
833 | * <b>Output:</b> |
||
834 | * <pre> |
||
835 | * Array |
||
836 | * { |
||
837 | * [permid] => 8471 (displayed if permsid is false) |
||
838 | * [permsid] => i_channel_create_modify_with_codec_latency_factor_min (displayed if permsid is true) |
||
839 | * [permvalue] => 1 |
||
840 | * [permnegated] => 0 |
||
841 | * [permskip] => 0 |
||
842 | * } |
||
843 | * </pre> |
||
844 | * |
||
845 | * @author Par0noid Solutions |
||
846 | * @param integer $cgid channelGroupID |
||
847 | * @param boolean $permsid permsid |
||
848 | * @return array channelGroupPermlist |
||
849 | */ |
||
850 | function channelGroupPermList($cgid, $permsid = false) { |
||
854 | |||
855 | /** |
||
856 | * channelGroupRename |
||
857 | * |
||
858 | * Changes the name of a specified channel group. |
||
859 | * |
||
860 | * @author Par0noid Solutions |
||
861 | * @param integer $cgid groupID |
||
862 | * @param integer $name groupName |
||
863 | * @return boolean success |
||
864 | */ |
||
865 | function channelGroupRename($cgid, $name) { |
||
869 | |||
870 | /** |
||
871 | * channelInfo |
||
872 | * |
||
873 | * Displays detailed configuration information about a channel including ID, topic, description, etc. |
||
874 | |||
875 | * <b>Output:</b> |
||
876 | * <pre> |
||
877 | * Array |
||
878 | * { |
||
879 | * [pid] => 0 |
||
880 | * [channel_name] => Test |
||
881 | * [channel_topic] => |
||
882 | * [channel_description] => |
||
883 | * [channel_password] => cc97Pm4oOYq0J9fXDAgiWv/qScQ= |
||
884 | * [channel_codec] => 2 |
||
885 | * [channel_codec_quality] => 7 |
||
886 | * [channel_maxclients] => -1 |
||
887 | * [channel_maxfamilyclients] => -1 |
||
888 | * [channel_order] => 1 |
||
889 | * [channel_flag_permanent] => 1 |
||
890 | * [channel_flag_semi_permanent] => 0 |
||
891 | * [channel_flag_default] => 0 |
||
892 | * [channel_flag_password] => 0 |
||
893 | * [channel_codec_latency_factor] => 1 |
||
894 | * [channel_codec_is_unencrypted] => 1 |
||
895 | * [channel_flag_maxclients_unlimited] => 1 |
||
896 | * [channel_flag_maxfamilyclients_unlimited] => 0 |
||
897 | * [channel_flag_maxfamilyclients_inherited] => 1 |
||
898 | * [channel_filepath] => files\\virtualserver_1\\channel_2 |
||
899 | * [channel_needed_talk_power] => 0 |
||
900 | * [channel_forced_silence] => 0 |
||
901 | * [channel_name_phonetic] => |
||
902 | * [channel_icon_id] => 0 |
||
903 | * [seconds_empty] => 61 (If it's a temporary channel with a channel delete delay) |
||
904 | * } |
||
905 | * </pre> |
||
906 | * |
||
907 | * @author Par0noid Solutions |
||
908 | * @param integer $cid channelID |
||
909 | * @return array channelInfo |
||
910 | */ |
||
911 | function channelInfo($cid) { |
||
915 | |||
916 | /** |
||
917 | * channelList |
||
918 | * |
||
919 | * Displays a list of channels created on a virtual server including their ID, order, name, etc. The output can be modified using several command options. |
||
920 | * |
||
921 | * <b>Possible parameters:</b> [-topic] [-flags] [-voice] [-limits] [-icon] |
||
922 | * |
||
923 | * <b>Output: (without parameters)</b> |
||
924 | * <pre> |
||
925 | * Array |
||
926 | * { |
||
927 | * [cid] => 2 |
||
928 | * [pid] => 0 |
||
929 | * [channel_order] => 1 |
||
930 | * [channel_name] => Test |
||
931 | * [total_clients] => 0 |
||
932 | * [channel_needed_subscribe_power] => 0 |
||
933 | * } |
||
934 | * </pre> |
||
935 | * <b>Output: (from parameters)</b> |
||
936 | * <pre> |
||
937 | * Array |
||
938 | * { |
||
939 | * [-topic] => [channel_topic] => Default Channel has no topic |
||
940 | * [-flags] => [channel_flag_default] => 1 |
||
941 | * [-flags] => [channel_flag_password] => 0 |
||
942 | * [-flags] => [channel_flag_permanent] => 1 |
||
943 | * [-flags] => [channel_flag_semi_permanent] => 0 |
||
944 | * [-voice] => [channel_codec] => 2 |
||
945 | * [-voice] => [channel_codec_quality] => 7 |
||
946 | * [-voice] => [channel_needed_talk_power] => 0 |
||
947 | * [-limits] => [total_clients_family] => 1 |
||
948 | * [-limits] => [channel_maxclients] => -1 |
||
949 | * [-limits] => [channel_maxfamilyclients] => -1 |
||
950 | * [-icon] => [channel_icon_id] => 0 |
||
951 | * } |
||
952 | * </pre> |
||
953 | * <b>Usage:</b> |
||
954 | * <pre> |
||
955 | * $ts3->channelList(); //No parameters |
||
956 | * $ts3->channelList("-flags"); //Single parameter |
||
957 | * $ts3->channelList("-topic -flags -voice -limits -icon"); //Multiple parameters / all |
||
958 | * </pre> |
||
959 | * |
||
960 | * @author Par0noid Solutions |
||
961 | * @param string $params additional parameters [optional] |
||
962 | * @return array channelList |
||
963 | */ |
||
964 | function channelList($params = null) { |
||
970 | |||
971 | /** |
||
972 | * channelMove |
||
973 | * |
||
974 | * Moves a channel to a new parent channel with the ID cpid. If order is specified, the channel will be sorted right under the channel with the specified ID. If order is set to 0, the channel will be sorted right below the new parent. |
||
975 | * |
||
976 | * @author Par0noid Solutions |
||
977 | * @param integer $cid channelID |
||
978 | * @param integer $cpid channelParentID |
||
979 | * @param integer $order channelSortOrder |
||
980 | * @return boolean success |
||
981 | */ |
||
982 | function channelMove($cid, $cpid, $order = null) { |
||
986 | |||
987 | /** |
||
988 | * channelPermList |
||
989 | * |
||
990 | * Displays a list of permissions defined for a channel. |
||
991 | * |
||
992 | * <b>Output:</b> |
||
993 | * <pre> |
||
994 | * Array |
||
995 | * { |
||
996 | * [cid] => 2 (only in first result) |
||
997 | * [permid] => 8471 (if permsid = false) |
||
998 | * [permsid] => i_channel_needed_delete_power (if permsid = true) |
||
999 | * [permvalue] => 1 |
||
1000 | * [permnegated] => 0 |
||
1001 | * [permskip] => 0 |
||
1002 | * } |
||
1003 | * </pre> |
||
1004 | * |
||
1005 | * @author Par0noid Solutions |
||
1006 | * @param integer $cid channelID |
||
1007 | * @param boolean $permsid displays permissionName instead of permissionID [optional] |
||
1008 | * @return array channelpermlist |
||
1009 | */ |
||
1010 | function channelPermList($cid, $permsid = false) { |
||
1014 | |||
1015 | /** |
||
1016 | * clientAddPerm |
||
1017 | * |
||
1018 | * Adds a set of specified permissions to a client. Multiple permissions can be added by providing the three parameters of each permission. A permission can be specified by permid or permsid. |
||
1019 | * |
||
1020 | * <b>Input-Array like this:</b> |
||
1021 | * <pre> |
||
1022 | * $permissions = array(); |
||
1023 | * $permissions['permissionID'] = array('permissionValue', 'permskip'); |
||
1024 | * //or you could use Permission Name |
||
1025 | * $permissions['permissionName'] = array('permissionValue', 'permskip'); |
||
1026 | * </pre> |
||
1027 | * |
||
1028 | * @author Par0noid Solutions |
||
1029 | * @param integer $cldbid clientDBID |
||
1030 | * @param array $permissions permissions |
||
1031 | * @return boolean success |
||
1032 | */ |
||
1033 | function clientAddPerm($cldbid, $permissions) { |
||
1079 | |||
1080 | /** |
||
1081 | * clientAvatar |
||
1082 | * |
||
1083 | * Will return the base64 encoded binary of the clients avatar |
||
1084 | * |
||
1085 | * <pre> |
||
1086 | * $result = $tsAdmin->clientAvatar($uid); |
||
1087 | * You can display it like: echo '<img src="data:image/png;base64,'.$result["data"].'" />'; |
||
1088 | * </pre> |
||
1089 | * |
||
1090 | * @author Par0noid Solutions |
||
1091 | * @param string $uid clientUID |
||
1092 | * @return array base64 image |
||
1093 | */ |
||
1094 | function clientAvatar($uid) { |
||
1128 | |||
1129 | /** |
||
1130 | * clientDbDelete |
||
1131 | * |
||
1132 | * Deletes a clients properties from the database. |
||
1133 | * |
||
1134 | * @author Par0noid Solutions |
||
1135 | * @param integer $cldbid clientDBID |
||
1136 | * @return boolean success |
||
1137 | */ |
||
1138 | function clientDbDelete($cldbid) { |
||
1142 | |||
1143 | /** |
||
1144 | * clientDbEdit |
||
1145 | * |
||
1146 | * Changes a clients settings using given properties. |
||
1147 | * |
||
1148 | * <b>Input-Array like this:</b> |
||
1149 | * <pre> |
||
1150 | * $data = array(); |
||
1151 | * |
||
1152 | * $data['property'] = 'value'; |
||
1153 | * $data['property'] = 'value'; |
||
1154 | * </pre> |
||
1155 | * |
||
1156 | * @author Par0noid Solutions |
||
1157 | * @param integer $cldbid clientDBID |
||
1158 | * @param array $data clientProperties |
||
1159 | * @return boolean success |
||
1160 | */ |
||
1161 | View Code Duplication | function clientDbEdit($cldbid, $data) { |
|
1172 | |||
1173 | /** |
||
1174 | * clientDbFind |
||
1175 | * |
||
1176 | * Displays a list of client database IDs matching a given pattern. You can either search for a clients last known nickname or his unique identity by using the -uid option. |
||
1177 | * |
||
1178 | * <b>Output:</b> |
||
1179 | * <pre> |
||
1180 | * Array |
||
1181 | * { |
||
1182 | * [cldbid] => 2 |
||
1183 | * } |
||
1184 | * </pre> |
||
1185 | * |
||
1186 | * @author Par0noid Solutions |
||
1187 | * @param string $pattern clientName |
||
1188 | * @param boolean $uid set true to add -uid param [optional] |
||
1189 | * @return array clientList |
||
1190 | */ |
||
1191 | function clientDbFind($pattern, $uid = false) { |
||
1195 | |||
1196 | /** |
||
1197 | * clientDbInfo |
||
1198 | * |
||
1199 | * Displays detailed database information about a client including unique ID, creation date, etc. |
||
1200 | * |
||
1201 | * <b>Output:</b> |
||
1202 | * <pre> |
||
1203 | * Array |
||
1204 | * { |
||
1205 | * [client_unique_identifier] => nUixbsq/XakrrmbqU8O30R/D8Gc= |
||
1206 | * [client_nickname] => par0noid |
||
1207 | * [client_database_id] => 2 |
||
1208 | * [client_created] => 1361027850 |
||
1209 | * [client_lastconnected] => 1361027850 |
||
1210 | * [client_totalconnections] => 1 |
||
1211 | * [client_flag_avatar] => |
||
1212 | * [client_description] => |
||
1213 | * [client_month_bytes_uploaded] => 0 |
||
1214 | * [client_month_bytes_downloaded] => 0 |
||
1215 | * [client_total_bytes_uploaded] => 0 |
||
1216 | * [client_total_bytes_downloaded] => 0 |
||
1217 | * [client_icon_id] => 0 |
||
1218 | * [client_base64HashClientUID] => jneilbgomklpfnkjclkoggokfdmdlhnbbpmdpagh |
||
1219 | * [client_lastip] => 127.0.0.1 |
||
1220 | * } |
||
1221 | * </pre> |
||
1222 | * |
||
1223 | * @author Par0noid Solutions |
||
1224 | * @param integer $cldbid clientDBID |
||
1225 | * @return array clientDbInfo |
||
1226 | */ |
||
1227 | function clientDbInfo($cldbid) { |
||
1231 | |||
1232 | /** |
||
1233 | * clientDbList |
||
1234 | * |
||
1235 | * Displays a list of client identities known by the server including their database ID, last nickname, etc. |
||
1236 | * |
||
1237 | * <b>Possible params:</b> [start={offset}] [duration={limit}] [-count] |
||
1238 | * |
||
1239 | * <b>Output:</b> |
||
1240 | * <pre> |
||
1241 | * Array |
||
1242 | * { |
||
1243 | * [count] => 1 (if count parameter is set) |
||
1244 | * [cldbid] => 2 |
||
1245 | * [client_unique_identifier] => nUixbsq/XakrrmbqU8O30R/D8Gc= |
||
1246 | * [client_nickname] => par0noid |
||
1247 | * [client_created] => 1361027850 |
||
1248 | * [client_lastconnected] => 1361027850 |
||
1249 | * [client_totalconnections] => 1 |
||
1250 | * [client_description] => |
||
1251 | * [client_lastip] => 127.0.0.1 |
||
1252 | * } |
||
1253 | * </pre> |
||
1254 | * |
||
1255 | * @author Par0noid Solutions |
||
1256 | * @param integer $start offset [optional] (Default: 0) |
||
1257 | * @param integer $duration limit [optional] (Default: -1) |
||
1258 | * @param boolean $count set true to add -count param [optional] |
||
1259 | * @return array clientdblist |
||
1260 | */ |
||
1261 | function clientDbList($start = 0, $duration = -1, $count = false) { |
||
1265 | |||
1266 | /** |
||
1267 | * clientDelPerm |
||
1268 | * |
||
1269 | * Removes a set of specified permissions from a client. Multiple permissions can be removed at once. A permission can be specified by permid or permsid. |
||
1270 | * |
||
1271 | * <b>Input-Array like this:</b> |
||
1272 | * <pre> |
||
1273 | * $permissions = array(); |
||
1274 | * $permissions['permissionID'] = 'permissionValue'; |
||
1275 | * //or you could use Permission Name |
||
1276 | * $permissions['permissionName'] = 'permissionValue'; |
||
1277 | * </pre> |
||
1278 | * |
||
1279 | * @author Par0noid Solutions |
||
1280 | * @param integer $cldbid clientDBID |
||
1281 | * @param array $permissionIds permissionIDs |
||
1282 | * @return boolean success |
||
1283 | */ |
||
1284 | function clientDelPerm($cldbid, $permissionIds) { |
||
1299 | |||
1300 | /** |
||
1301 | * clientEdit |
||
1302 | * |
||
1303 | * Changes a clients settings using given properties. |
||
1304 | * |
||
1305 | * <b>Input-Array like this:</b> |
||
1306 | * <pre> |
||
1307 | * $data = array(); |
||
1308 | * |
||
1309 | * $data['property'] = 'value'; |
||
1310 | * $data['property'] = 'value'; |
||
1311 | * </pre> |
||
1312 | * |
||
1313 | * @author Par0noid Solutions |
||
1314 | * @param integer $clid clientID |
||
1315 | * @param array $data clientProperties |
||
1316 | * @return boolean success |
||
1317 | */ |
||
1318 | View Code Duplication | function clientEdit($clid, $data) { |
|
1329 | |||
1330 | /** |
||
1331 | * clientFind |
||
1332 | * |
||
1333 | * Displays a list of clients matching a given name pattern. |
||
1334 | * |
||
1335 | * <b>Output:</b> |
||
1336 | * <pre> |
||
1337 | * Array |
||
1338 | * { |
||
1339 | * [clid] => 18 |
||
1340 | * [client_nickname] => par0noid |
||
1341 | * } |
||
1342 | * </pre> |
||
1343 | * |
||
1344 | * @author Par0noid Solutions |
||
1345 | * @param string $pattern clientName |
||
1346 | * @return array clienList |
||
1347 | */ |
||
1348 | function clientFind($pattern) { |
||
1352 | |||
1353 | /** |
||
1354 | * clientGetDbIdFromUid |
||
1355 | * |
||
1356 | * Displays the database ID matching the unique identifier specified by cluid. |
||
1357 | * |
||
1358 | * <b>Output:</b> |
||
1359 | * <pre> |
||
1360 | * Array |
||
1361 | * { |
||
1362 | * [cluid] => nUixbsq/XakrrmbqU8O30R/D8Gc= |
||
1363 | * [cldbid] => 2 |
||
1364 | * } |
||
1365 | * </pre> |
||
1366 | * |
||
1367 | * @author Par0noid Solutions |
||
1368 | * @param string $cluid clientUID |
||
1369 | * @return array clientInfo |
||
1370 | */ |
||
1371 | function clientGetDbIdFromUid($cluid) { |
||
1375 | |||
1376 | /** |
||
1377 | * clientGetIds |
||
1378 | * |
||
1379 | * Displays all client IDs matching the unique identifier specified by cluid. |
||
1380 | * |
||
1381 | * <b>Output:</b> |
||
1382 | * <pre> |
||
1383 | * Array |
||
1384 | * { |
||
1385 | * [cluid] => nUixbdf/XakrrmsdffO30R/D8Gc= |
||
1386 | * [clid] => 7 |
||
1387 | * [name] => Par0noid |
||
1388 | * } |
||
1389 | * </pre> |
||
1390 | * |
||
1391 | * @author Par0noid Solutions |
||
1392 | * @param string $cluid clientUID |
||
1393 | * @return array clientList |
||
1394 | */ |
||
1395 | function clientGetIds($cluid) { |
||
1399 | |||
1400 | /** |
||
1401 | * clientGetNameFromDbid |
||
1402 | * |
||
1403 | * Displays the unique identifier and nickname matching the database ID specified by cldbid. |
||
1404 | * |
||
1405 | * <b>Output:</b> |
||
1406 | * <pre> |
||
1407 | * Array |
||
1408 | * { |
||
1409 | * [cluid] => nUixbsq/XakrrmbqU8O30R/D8Gc= |
||
1410 | * [cldbid] => 2 |
||
1411 | * [name] => Par0noid |
||
1412 | * } |
||
1413 | * </pre> |
||
1414 | * |
||
1415 | * @author Par0noid Solutions |
||
1416 | * @param integer $cldbid clientDBID |
||
1417 | * @return array clientInfo |
||
1418 | */ |
||
1419 | function clientGetNameFromDbid($cldbid) { |
||
1423 | |||
1424 | /** |
||
1425 | * clientGetNameFromUid |
||
1426 | * |
||
1427 | * Displays the database ID and nickname matching the unique identifier specified by cluid. |
||
1428 | * |
||
1429 | * <b>Output:</b> |
||
1430 | * <pre> |
||
1431 | * Array |
||
1432 | * { |
||
1433 | * [cluid] => nUixbsq/XakrrmbqU8O30R/D8Gc= |
||
1434 | * [cldbid] => 2 |
||
1435 | * [name] => Par0noid |
||
1436 | * } |
||
1437 | * </pre> |
||
1438 | * |
||
1439 | * @author Par0noid Solutions |
||
1440 | * @param string $cluid clientUID |
||
1441 | * @return array clientInfo |
||
1442 | */ |
||
1443 | function clientGetNameFromUid($cluid) { |
||
1447 | |||
1448 | /** |
||
1449 | * clientInfo |
||
1450 | * |
||
1451 | * Displays detailed configuration information about a client including unique ID, nickname, client version, etc. |
||
1452 | * |
||
1453 | * <b>Output:</b> |
||
1454 | * <pre> |
||
1455 | * Array |
||
1456 | * { |
||
1457 | * [cid] => 2 |
||
1458 | * [client_idle_time] => 4445369 |
||
1459 | * [client_unique_identifier] => nUixbsq/XakrrmbqU8O30R/D8Gc= |
||
1460 | * [client_nickname] => par0noid |
||
1461 | * [client_version] => 3.0.9.2 [Build: 1351504843] |
||
1462 | * [client_platform] => Windows |
||
1463 | * [client_input_muted] => 1 |
||
1464 | * [client_output_muted] => 1 |
||
1465 | * [client_outputonly_muted] => 0 |
||
1466 | * [client_input_hardware] => 1 |
||
1467 | * [client_output_hardware] => 1 |
||
1468 | * [client_default_channel] => |
||
1469 | * [client_meta_data] => |
||
1470 | * [client_is_recording] => 0 |
||
1471 | * [client_login_name] => |
||
1472 | * [client_database_id] => 2 |
||
1473 | * [client_channel_group_id] => 5 |
||
1474 | * [client_servergroups] => 6 |
||
1475 | * [client_created] => 1361027850 |
||
1476 | * [client_lastconnected] => 1361027850 |
||
1477 | * [client_totalconnections] => 1 |
||
1478 | * [client_away] => 0 |
||
1479 | * [client_away_message] => |
||
1480 | * [client_type] => 0 |
||
1481 | * [client_flag_avatar] => |
||
1482 | * [client_talk_power] => 75 |
||
1483 | * [client_talk_request] => 0 |
||
1484 | * [client_talk_request_msg] => |
||
1485 | * [client_description] => |
||
1486 | * [client_is_talker] => 0 |
||
1487 | * [client_month_bytes_uploaded] => 0 |
||
1488 | * [client_month_bytes_downloaded] => 0 |
||
1489 | * [client_total_bytes_uploaded] => 0 |
||
1490 | * [client_total_bytes_downloaded] => 0 |
||
1491 | * [client_is_priority_speaker] => 0 |
||
1492 | * [client_nickname_phonetic] => |
||
1493 | * [client_needed_serverquery_view_power] => 75 |
||
1494 | * [client_default_token] => |
||
1495 | * [client_icon_id] => 0 |
||
1496 | * [client_is_channel_commander] => 0 |
||
1497 | * [client_country] => |
||
1498 | * [client_channel_group_inherited_channel_id] => 2 |
||
1499 | * [client_base64HashClientUID] => jneilbgomklpfnkjclkoggokfdmdlhnbbpmdpagh |
||
1500 | * [connection_filetransfer_bandwidth_sent] => 0 |
||
1501 | * [connection_filetransfer_bandwidth_received] => 0 |
||
1502 | * [connection_packets_sent_total] => 12130 |
||
1503 | * [connection_bytes_sent_total] => 542353 |
||
1504 | * [connection_packets_received_total] => 12681 |
||
1505 | * [connection_bytes_received_total] => 592935 |
||
1506 | * [connection_bandwidth_sent_last_second_total] => 82 |
||
1507 | * [connection_bandwidth_sent_last_minute_total] => 92 |
||
1508 | * [connection_bandwidth_received_last_second_total] => 84 |
||
1509 | * [connection_bandwidth_received_last_minute_total] => 88 |
||
1510 | * [connection_connected_time] => 5908749 |
||
1511 | * [connection_client_ip] => 127.0.0.1 |
||
1512 | * } |
||
1513 | * </pre> |
||
1514 | * |
||
1515 | * @author Par0noid Solutions |
||
1516 | * @param integer $clid clientID |
||
1517 | * @return array clientInformation |
||
1518 | */ |
||
1519 | function clientInfo($clid) { |
||
1523 | |||
1524 | /** |
||
1525 | * clientKick |
||
1526 | * |
||
1527 | * Kicks one or more clients specified with clid from their currently joined channel or from the server, depending on reasonid. The reasonmsg parameter specifies a text message sent to the kicked clients. This parameter is optional and may only have a maximum of 40 characters. |
||
1528 | * |
||
1529 | * @author Par0noid Solutions |
||
1530 | * @param integer $clid clientID |
||
1531 | * @param string $kickMode kickMode (server or channel) (Default: servera) |
||
1532 | * @param string $kickmsg kick reason [optional] |
||
1533 | * @return boolean success |
||
1534 | */ |
||
1535 | function clientKick($clid, $kickMode = "server", $kickmsg = "") { |
||
1551 | |||
1552 | /** |
||
1553 | * clientList |
||
1554 | * |
||
1555 | * Displays a list of clients online on a virtual server including their ID, nickname, status flags, etc. The output can be modified using several command options. Please note that the output will only contain clients which are currently in channels you're able to subscribe to. |
||
1556 | * |
||
1557 | * <b>Possible params:</b> [-uid] [-away] [-voice] [-times] [-groups] [-info] [-icon] [-country] [-ip] [-badges] |
||
1558 | * |
||
1559 | * <b>Output: (without parameters)</b> |
||
1560 | * <pre> |
||
1561 | * Array |
||
1562 | * { |
||
1563 | * [clid] => 1 |
||
1564 | * [cid] => 1 |
||
1565 | * [client_database_id] => 2 |
||
1566 | * [client_nickname] => Par0noid |
||
1567 | * [client_type] => 0 |
||
1568 | * [-uid] => [client_unique_identifier] => nUixbsq/XakrrmbqU8O30R/D8Gc= |
||
1569 | * [-away] => [client_away] => 0 |
||
1570 | * [-away] => [client_away_message] => |
||
1571 | * [-voice] => [client_flag_talking] => 0 |
||
1572 | * [-voice] => [client_input_muted] => 0 |
||
1573 | * [-voice] => [client_output_muted] => 0 |
||
1574 | * [-voice] => [client_input_hardware] => 0 |
||
1575 | * [-voice] => [client_output_hardware] => 0 |
||
1576 | * [-voice] => [client_talk_power] => 0 |
||
1577 | * [-voice] => [client_is_talker] => 0 |
||
1578 | * [-voice] => [client_is_priority_speaker] => 0 |
||
1579 | * [-voice] => [client_is_recording] => 0 |
||
1580 | * [-voice] => [client_is_channel_commander] => 0 |
||
1581 | * [-times] => [client_idle_time] => 1714 |
||
1582 | * [-times] => [client_created] => 1361027850 |
||
1583 | * [-times] => [client_lastconnected] => 1361042955 |
||
1584 | * [-groups] => [client_servergroups] => 6,7 |
||
1585 | * [-groups] => [client_channel_group_id] => 8 |
||
1586 | * [-groups] => [client_channel_group_inherited_channel_id] => 1 |
||
1587 | * [-info] => [client_version] => 3.0.9.2 [Build: 1351504843] |
||
1588 | * [-info] => [client_platform] => Windows |
||
1589 | * [-icon] => [client_icon_id] => 0 |
||
1590 | * [-country] => [client_country] => |
||
1591 | * [-ip] => [connection_client_ip] => 127.0.0.1 |
||
1592 | * [-badges] => [client_badges] => Overwolf=0 |
||
1593 | * } |
||
1594 | * |
||
1595 | * <b>Usage:</b> |
||
1596 | * |
||
1597 | * $ts3->clientList(); //No parameters |
||
1598 | * $ts3->clientList("-uid"); //Single parameter |
||
1599 | * $ts3->clientList("-uid -away -voice -times -groups -info -country -icon -ip -badges"); //Multiple parameters |
||
1600 | * </pre> |
||
1601 | * |
||
1602 | * @author Par0noid Solutions |
||
1603 | * @param string $params additional parameters [optional] |
||
1604 | * @return array clientList |
||
1605 | */ |
||
1606 | function clientList($params = null) { |
||
1613 | |||
1614 | /** |
||
1615 | * clientMove |
||
1616 | * |
||
1617 | * Moves one or more clients specified with clid to the channel with ID cid. If the target channel has a password, it needs to be specified with cpw. If the channel has no password, the parameter can be omitted. |
||
1618 | * |
||
1619 | * @author Par0noid Solutions |
||
1620 | * @param integer $clid clientID |
||
1621 | * @param integer $cid channelID |
||
1622 | * @param string $cpw channelPassword [optional] |
||
1623 | * @return boolean success |
||
1624 | */ |
||
1625 | function clientMove($clid, $cid, $cpw = null) { |
||
1629 | |||
1630 | /** |
||
1631 | * clientPermList |
||
1632 | * |
||
1633 | * Displays a list of permissions defined for a client. |
||
1634 | * |
||
1635 | * <b>Output:</b> |
||
1636 | * <pre> |
||
1637 | * Array |
||
1638 | * { |
||
1639 | * [permid] => 20654 //with permsid = false |
||
1640 | * [permsid] => b_client_ignore_bans //with permsid = true |
||
1641 | * [permvalue] => 1 |
||
1642 | * [permnegated] => 0 |
||
1643 | * [permskip] => 0 |
||
1644 | * } |
||
1645 | * </pre> |
||
1646 | * |
||
1647 | * @author Par0noid Solutions |
||
1648 | * @param intege $cldbid clientDBID |
||
1649 | * @param boolean $permsid set true to add -permsid param [optional] |
||
1650 | * @return array clientPermList |
||
1651 | */ |
||
1652 | function clientPermList($cldbid, $permsid = false) { |
||
1656 | |||
1657 | /** |
||
1658 | * clientPoke |
||
1659 | * |
||
1660 | * Sends a poke message to the client specified with clid. |
||
1661 | * |
||
1662 | * @author Par0noid Solutions |
||
1663 | * @param integer $clid clientID |
||
1664 | * @param string $msg pokeMessage |
||
1665 | * @return boolean success |
||
1666 | */ |
||
1667 | function clientPoke($clid, $msg) { |
||
1671 | |||
1672 | /** |
||
1673 | * clientSetServerQueryLogin |
||
1674 | * |
||
1675 | * Updates your own ServerQuery login credentials using a specified username. The password will be auto-generated. |
||
1676 | * |
||
1677 | * <b>Output:</b> |
||
1678 | * <pre> |
||
1679 | * Array |
||
1680 | * { |
||
1681 | * [client_login_password] => +r\/TQqvR |
||
1682 | * } |
||
1683 | * </pre> |
||
1684 | * |
||
1685 | * @author Par0noid Solutions |
||
1686 | * @param string $username username |
||
1687 | * @return array userInfomation |
||
1688 | */ |
||
1689 | function clientSetServerQueryLogin($username) { |
||
1692 | |||
1693 | /** |
||
1694 | * clientUpdate |
||
1695 | * |
||
1696 | * Change your ServerQuery clients settings using given properties. |
||
1697 | * |
||
1698 | * <b>Input-Array like this:</b> |
||
1699 | * <pre> |
||
1700 | * $data = array(); |
||
1701 | * $data['property'] = 'value'; |
||
1702 | * $data['property'] = 'value'; |
||
1703 | * </pre> |
||
1704 | * |
||
1705 | * @author Par0noid Solutions |
||
1706 | * @param array $data clientProperties |
||
1707 | * @return boolean success |
||
1708 | */ |
||
1709 | function clientUpdate($data) { |
||
1718 | |||
1719 | /** |
||
1720 | * complainAdd |
||
1721 | * |
||
1722 | * Submits a complaint about the client with database ID tcldbid to the server. |
||
1723 | * |
||
1724 | * @author Par0noid Solutions |
||
1725 | * @param integer $tcldbid targetClientDBID |
||
1726 | * @param string $msg complainMessage |
||
1727 | * @return boolean success |
||
1728 | */ |
||
1729 | function complainAdd($tcldbid, $msg) { |
||
1733 | |||
1734 | /** |
||
1735 | * complainDelete |
||
1736 | * |
||
1737 | * Deletes the complaint about the client with ID tcldbid submitted by the client with ID fcldbid from the server. |
||
1738 | * |
||
1739 | * @author Par0noid Solutions |
||
1740 | * @param integer $tcldbid targetClientDBID |
||
1741 | * @param integer $fcldbid fromClientDBID |
||
1742 | * @return boolean success |
||
1743 | */ |
||
1744 | function complainDelete($tcldbid, $fcldbid) { |
||
1748 | |||
1749 | /** |
||
1750 | * complainDeleteAll |
||
1751 | * |
||
1752 | * Deletes all complaints about the client with database ID tcldbid from the server. |
||
1753 | * |
||
1754 | * @author Par0noid Solutions |
||
1755 | * @param integer $tcldbid targetClientDBID |
||
1756 | * @return boolean success |
||
1757 | */ |
||
1758 | function complainDeleteAll($tcldbid) { |
||
1762 | |||
1763 | /** |
||
1764 | * complainList |
||
1765 | * |
||
1766 | * Displays a list of complaints on the selected virtual server. If tcldbid is specified, only complaints about the targeted client will be shown. |
||
1767 | * |
||
1768 | * <b>Output:</b> |
||
1769 | * <pre> |
||
1770 | * Array |
||
1771 | * { |
||
1772 | * [tcldbid] => 2 |
||
1773 | * [tname] => par0noid |
||
1774 | * [fcldbid] => 1 |
||
1775 | * [fname] => serveradmin from 127.0.0.1:6814 |
||
1776 | * [message] => Steals crayons |
||
1777 | * [timestamp] => 1361044090 |
||
1778 | * } |
||
1779 | * </pre> |
||
1780 | * |
||
1781 | * @author Par0noid Solutions |
||
1782 | * @param string $tcldbid targetClientDBID [optional] |
||
1783 | * @return array complainList |
||
1784 | */ |
||
1785 | function complainList($tcldbid = null) { |
||
1790 | |||
1791 | /** |
||
1792 | * execOwnCommand |
||
1793 | * |
||
1794 | * executes a command that isn't defined in class and returns data like your propose |
||
1795 | * |
||
1796 | * <b>Modes:</b> |
||
1797 | * <ul> |
||
1798 | * <li><b>0:</b> execute -> return boolean</li> |
||
1799 | * <li><b>1:</b> execute -> return normal array</li> |
||
1800 | * <li><b>2:</b> execute -> return multidimensional array</li> |
||
1801 | * <li><b>3:</b> execute -> return plaintext serverquery</li> |
||
1802 | * </ul> |
||
1803 | * |
||
1804 | * @author Par0noid Solutions |
||
1805 | * @param string $mode executionMode |
||
1806 | * @param string $command command |
||
1807 | * @return mixed result |
||
1808 | */ |
||
1809 | function execOwnCommand($mode, $command) { |
||
1823 | |||
1824 | /** |
||
1825 | * ftCreateDir |
||
1826 | * |
||
1827 | * Creates new directory in a channels file repository. |
||
1828 | * |
||
1829 | * @author Par0noid Solutions |
||
1830 | * @param string $cid channelId |
||
1831 | * @param string $cpw channelPassword (leave blank if not needed) |
||
1832 | * @param string $dirname dirPath |
||
1833 | * @return boolean success |
||
1834 | */ |
||
1835 | function ftCreateDir($cid, $cpw = null, $dirname) { |
||
1839 | |||
1840 | /** |
||
1841 | * ftDeleteFile |
||
1842 | * |
||
1843 | * Deletes one or more files stored in a channels file repository. |
||
1844 | * |
||
1845 | * <b>Input-Array like this:</b> |
||
1846 | * <pre> |
||
1847 | * $files = array(); |
||
1848 | * |
||
1849 | * $files[] = '/pic1.jpg'; |
||
1850 | * $files[] = '/dokumente/test.txt'; |
||
1851 | * $files[] = '/dokumente'; |
||
1852 | * </pre> |
||
1853 | * |
||
1854 | * @author Par0noid Solutions |
||
1855 | * @param string $cid channelID |
||
1856 | * @param string $cpw channelPassword (leave blank if not needed) |
||
1857 | * @param array $files files |
||
1858 | * @return boolean success |
||
1859 | */ |
||
1860 | View Code Duplication | function ftDeleteFile($cid, $cpw = '', $files) { |
|
1874 | |||
1875 | /** |
||
1876 | * ftDownloadFile |
||
1877 | * |
||
1878 | * Ddownloads a file and returns its contents |
||
1879 | * |
||
1880 | * @author Par0noid Solutions |
||
1881 | * @param array $data return of ftInitDownload |
||
1882 | * @return array downloadedFile |
||
1883 | */ |
||
1884 | function ftDownloadFile($data) { |
||
1899 | |||
1900 | /** |
||
1901 | * ftGetFileInfo |
||
1902 | * |
||
1903 | * Displays detailed information about one or more specified files stored in a channels file repository. |
||
1904 | * |
||
1905 | * |
||
1906 | * @author Par0noid Solutions |
||
1907 | * @param string $cid channelID |
||
1908 | * @param string $cpw channelPassword (leave blank if not needed) |
||
1909 | * @param string $file path to file |
||
1910 | * @return boolean success |
||
1911 | */ |
||
1912 | function ftGetFileInfo($cid, $cpw = '', $file) { |
||
1917 | |||
1918 | /** |
||
1919 | * ftGetFileList |
||
1920 | * |
||
1921 | * Displays a list of files and directories stored in the specified channels file repository. |
||
1922 | * |
||
1923 | * <b>Output:</b> |
||
1924 | * <pre> |
||
1925 | * Array |
||
1926 | * { |
||
1927 | * [cid] => 231 |
||
1928 | * [path] => / |
||
1929 | * [name] => Documents |
||
1930 | * [size] => 0 |
||
1931 | * [datetime] => 1286633633 |
||
1932 | * [type] => 0 |
||
1933 | * } |
||
1934 | * </pre> |
||
1935 | * |
||
1936 | * @author Par0noid Solutions |
||
1937 | * @param string $cid channelID |
||
1938 | * @param string $cpw channelPassword (leave blank if not needed) |
||
1939 | * @param string $path filePath |
||
1940 | * @return array fileList |
||
1941 | */ |
||
1942 | function ftGetFileList($cid, $cpw = '', $path) { |
||
1946 | |||
1947 | /** |
||
1948 | * ftInitDownload |
||
1949 | * |
||
1950 | * Initializes a file transfer download. clientftfid is an arbitrary ID to identify the file transfer on client-side. On success, the server generates a new ftkey which is required to start downloading the file through TeamSpeak 3's file transfer interface. |
||
1951 | * |
||
1952 | * <b>Output:</b> |
||
1953 | * <pre> |
||
1954 | * Array |
||
1955 | * { |
||
1956 | * [clientftfid] => 89 |
||
1957 | * [serverftfid] => 3 |
||
1958 | * [ftkey] => jSzWiRmFGdZnoJzW7BSDYJRUWB2WAUhb |
||
1959 | * [port] => 30033 |
||
1960 | * [size] => 94 |
||
1961 | * } |
||
1962 | * </pre> |
||
1963 | * |
||
1964 | * @author Par0noid Solutions |
||
1965 | * @param string $name filePath |
||
1966 | * @param string $cid channelID |
||
1967 | * @param string $cpw channelPassword (leave blank if not needed) |
||
1968 | * @param integer $seekpos seekpos (default = 0) [optional] |
||
1969 | * @return array initDownloadFileInfo |
||
1970 | */ |
||
1971 | function ftInitDownload($name, $cid, $cpw = '', $seekpos = 0) { |
||
1975 | |||
1976 | /** |
||
1977 | * ftInitUpload |
||
1978 | * |
||
1979 | * Initializes a file transfer upload. clientftfid is an arbitrary ID to identify the file transfer on client-side. On success, the server generates a new ftkey which is required to start uploading the file through TeamSpeak 3's file transfer interface. |
||
1980 | * |
||
1981 | * <b>Output:</b> |
||
1982 | * <pre> |
||
1983 | * Array |
||
1984 | * { |
||
1985 | * [clientftfid] => 84 |
||
1986 | * [serverftfid] => 41 |
||
1987 | * [ftkey] => HCnXpunOdAorqj3dGqfiuLszX18O0PHP |
||
1988 | * [port] => 30033 |
||
1989 | * [seekpos] => 0 |
||
1990 | * } |
||
1991 | * </pre> |
||
1992 | * |
||
1993 | * @author Par0noid Solutions |
||
1994 | * @param string $filename filePath |
||
1995 | * @param string $cid channelID |
||
1996 | * @param integer $size fileSize in bytes |
||
1997 | * @param string $cpw channelPassword (leave blank if not needed) |
||
1998 | * @param boolean $overwrite overwrite [optional] (default = 0) |
||
1999 | * @param boolean $resume resume [optional] (default = 0) |
||
2000 | * @return array initUploadFileInfo |
||
2001 | */ |
||
2002 | function ftInitUpload($filename, $cid, $size, $cpw = '', $overwrite = false, $resume = false) { |
||
2010 | |||
2011 | /** |
||
2012 | * ftList |
||
2013 | * |
||
2014 | * Displays a list of running file transfers on the selected virtual server. The output contains the path to which a file is uploaded to, the current transfer rate in bytes per second, etc |
||
2015 | * |
||
2016 | * <b>Output:</b> |
||
2017 | * <pre> |
||
2018 | * Array |
||
2019 | * { |
||
2020 | * [clid] => 1 |
||
2021 | * [cldbid] => 2019 |
||
2022 | * [path] => files/virtualserver_11/channel_231 |
||
2023 | * [name] => 1285412348878.png |
||
2024 | * [size] => 1161281 |
||
2025 | * [sizedone] => 275888 |
||
2026 | * [clientftfid] => 15 |
||
2027 | * [serverftfid] => 52 |
||
2028 | * [sender] => 0 |
||
2029 | * [status] => 1 |
||
2030 | * [current_speed] => 101037.4453 |
||
2031 | * [average_speed] => 101037.4453 |
||
2032 | * [runtime] => 2163 |
||
2033 | * } |
||
2034 | * </pre> |
||
2035 | * |
||
2036 | * @author Par0noid Solutions |
||
2037 | * @return array fileTransferList |
||
2038 | */ |
||
2039 | function ftList() { |
||
2043 | |||
2044 | /** |
||
2045 | * ftRenameFile |
||
2046 | * |
||
2047 | * Renames a file in a channels file repository. If the two parameters tcid and tcpw are specified, the file will be moved into another channels file repository. |
||
2048 | * |
||
2049 | * @author Par0noid Solutions |
||
2050 | * @param integer $cid channelID |
||
2051 | * @param string $cpw channelPassword (leave blank if not needed) |
||
2052 | * @param string $oldname oldFilePath |
||
2053 | * @param string $newname newFilePath |
||
2054 | * @param string $tcid targetChannelID [optional] |
||
2055 | * @param string $tcpw targetChannelPassword [optional] |
||
2056 | * @return boolean success |
||
2057 | */ |
||
2058 | function ftRenameFile($cid, $cpw = null, $oldname, $newname, $tcid = null, $tcpw = null) { |
||
2063 | |||
2064 | /** |
||
2065 | * ftStop |
||
2066 | * |
||
2067 | * Stops the running file transfer with server-side ID serverftfid. |
||
2068 | * |
||
2069 | * @author Par0noid Solutions |
||
2070 | * @param integer $serverftfid serverFileTransferID |
||
2071 | * @param boolean $delete delete incomplete file [optional] (default: true) |
||
2072 | * @return boolean success |
||
2073 | */ |
||
2074 | function ftStop($serverftfid, $delete = true) { |
||
2078 | |||
2079 | /** |
||
2080 | * ftUploadFile |
||
2081 | * |
||
2082 | * Uploads a file to server |
||
2083 | * To check if upload was successful, you have to search for this file in fileList after |
||
2084 | * |
||
2085 | * @author Par0noid Solutions |
||
2086 | * @param array $data return of ftInitUpload |
||
2087 | * @param string $uploadData data which should be uploaded |
||
2088 | * @return array response |
||
2089 | */ |
||
2090 | function ftUploadFile($data, $uploadData) { |
||
2103 | |||
2104 | /** |
||
2105 | * gm |
||
2106 | * |
||
2107 | * Sends a text message to all clients on all virtual servers in the TeamSpeak 3 Server instance. |
||
2108 | * |
||
2109 | * @author Par0noid Solutions |
||
2110 | * @param string $msg message |
||
2111 | * @return boolean success |
||
2112 | */ |
||
2113 | function gm($msg) { |
||
2120 | |||
2121 | /** |
||
2122 | * hostInfo |
||
2123 | * |
||
2124 | * Displays detailed connection information about the server instance including uptime, number of virtual servers online, traffic information, etc. |
||
2125 | * |
||
2126 | * <b>Output:</b> |
||
2127 | * <pre> |
||
2128 | * Array |
||
2129 | * { |
||
2130 | * [instance_uptime] => 19038 |
||
2131 | * [host_timestamp_utc] => 1361046825 |
||
2132 | * [virtualservers_running_total] => 1 |
||
2133 | * [virtualservers_total_maxclients] => 32 |
||
2134 | * [virtualservers_total_clients_online] => 1 |
||
2135 | * [virtualservers_total_channels_online] => 2 |
||
2136 | * [connection_filetransfer_bandwidth_sent] => 0 |
||
2137 | * [connection_filetransfer_bandwidth_received] => 0 |
||
2138 | * [connection_filetransfer_bytes_sent_total] => 0 |
||
2139 | * [connection_filetransfer_bytes_received_total] => 0 |
||
2140 | * [connection_packets_sent_total] => 24853 |
||
2141 | * [connection_bytes_sent_total] => 1096128 |
||
2142 | * [connection_packets_received_total] => 25404 |
||
2143 | * [connection_bytes_received_total] => 1153918 |
||
2144 | * [connection_bandwidth_sent_last_second_total] => 82 |
||
2145 | * [connection_bandwidth_sent_last_minute_total] => 81 |
||
2146 | * [connection_bandwidth_received_last_second_total] => 84 |
||
2147 | * [connection_bandwidth_received_last_minute_total] => 87 |
||
2148 | * } |
||
2149 | * </pre> |
||
2150 | * |
||
2151 | * @author Par0noid Solutions |
||
2152 | * @return array hostInformation |
||
2153 | */ |
||
2154 | function hostInfo() { |
||
2157 | |||
2158 | /** |
||
2159 | * instanceEdit |
||
2160 | * |
||
2161 | * Changes the server instance configuration using given properties. |
||
2162 | * |
||
2163 | * <b>Input-Array like this:</b> |
||
2164 | * <pre> |
||
2165 | * $data = array(); |
||
2166 | * |
||
2167 | * $data['setting'] = 'value'; |
||
2168 | * $data['setting'] = 'value'; |
||
2169 | * </pre> |
||
2170 | * |
||
2171 | * @author Par0noid Solutions |
||
2172 | * @param array $data instanceProperties |
||
2173 | * @return boolean success |
||
2174 | */ |
||
2175 | function instanceEdit($data) { |
||
2188 | |||
2189 | /** |
||
2190 | * instanceInfo |
||
2191 | * |
||
2192 | * Displays the server instance configuration including database revision number, the file transfer port, default group IDs, etc. |
||
2193 | * |
||
2194 | * <b>Output:</b> |
||
2195 | * <pre> |
||
2196 | * Array |
||
2197 | * { |
||
2198 | * [serverinstance_database_version] => 20 |
||
2199 | * [serverinstance_filetransfer_port] => 30033 |
||
2200 | * [serverinstance_max_download_total_bandwidth] => 18446744073709551615 |
||
2201 | * [serverinstance_max_upload_total_bandwidth] => 18446744073709551615 |
||
2202 | * [serverinstance_guest_serverquery_group] => 1 |
||
2203 | * [serverinstance_serverquery_flood_commands] => 10 |
||
2204 | * [serverinstance_serverquery_flood_time] => 3 |
||
2205 | * [serverinstance_serverquery_ban_time] => 600 |
||
2206 | * [serverinstance_template_serveradmin_group] => 3 |
||
2207 | * [serverinstance_template_serverdefault_group] => 5 |
||
2208 | * [serverinstance_template_channeladmin_group] => 1 |
||
2209 | * [serverinstance_template_channeldefault_group] => 4 |
||
2210 | * [serverinstance_permissions_version] => 15 |
||
2211 | * } |
||
2212 | * </pre> |
||
2213 | * |
||
2214 | * @author Par0noid Solutions |
||
2215 | * @return array instanceInformation |
||
2216 | */ |
||
2217 | function instanceInfo() { |
||
2220 | |||
2221 | /** |
||
2222 | * logAdd |
||
2223 | * |
||
2224 | * Writes a custom entry into the servers log. Depending on your permissions, you'll be able to add entries into the server instance log and/or your virtual servers log. The loglevel parameter specifies the type of the entry. |
||
2225 | * |
||
2226 | * @author Par0noid Solutions |
||
2227 | * @param integer $logLevel loglevel between 1 and 4 |
||
2228 | * @param string $logMsg logMessage |
||
2229 | * @return boolean success |
||
2230 | */ |
||
2231 | function logAdd($logLevel, $logMsg) { |
||
2244 | |||
2245 | /** |
||
2246 | * login |
||
2247 | * |
||
2248 | * Authenticates with the TeamSpeak 3 Server instance using given ServerQuery login credentials. |
||
2249 | * |
||
2250 | * @author Par0noid Solutions |
||
2251 | * @param string $username username |
||
2252 | * @param string $password password |
||
2253 | * @return boolean success |
||
2254 | */ |
||
2255 | function login($username, $password) { |
||
2258 | |||
2259 | /** |
||
2260 | * logout |
||
2261 | * |
||
2262 | * Deselects the active virtual server and logs out from the server instance. |
||
2263 | * |
||
2264 | * @author Par0noid Solutions |
||
2265 | * @return boolean success |
||
2266 | */ |
||
2267 | function logout() { |
||
2271 | |||
2272 | /** |
||
2273 | * logView |
||
2274 | * |
||
2275 | * Displays a specified number of entries from the servers log. If instance is set to 1, the server will return lines from the master logfile (ts3server_0.log) instead of the selected virtual server logfile. |
||
2276 | * |
||
2277 | * <b>Output:</b> |
||
2278 | * <pre> |
||
2279 | * Array |
||
2280 | * { |
||
2281 | * [last_pos] => 0 |
||
2282 | * [file_size] => 1085 |
||
2283 | * [l] => 2012-01-10 20:34:31.379260|INFO |ServerLibPriv | | TeamSpeak 3 Server 3.0.1 (2011-11-17 07:34:30) |
||
2284 | * } |
||
2285 | * { |
||
2286 | * [l] => 2012-01-10 20:34:31.380260|INFO |DatabaseQuery | | dbPlugin name: SQLite3 plugin, Version 2, (c)TeamSpeak Systems GmbH |
||
2287 | * } |
||
2288 | * { |
||
2289 | * [l] => 2012-01-10 20:34:31.380260|INFO |DatabaseQuery | | dbPlugin version: 3.7.3 |
||
2290 | * } |
||
2291 | * </pre> |
||
2292 | * |
||
2293 | * @author Par0noid Solutions |
||
2294 | * @param integer $lines between 1 and 100 |
||
2295 | * @param integer $reverse {1|0} [optional] |
||
2296 | * @param integer $instance {1|0} [optional] |
||
2297 | * @param integer $begin_pos {1|0} [optional] |
||
2298 | * @return multidimensional-array logEntries |
||
2299 | */ |
||
2300 | function logView($lines, $reverse = 0, $instance = 0, $begin_pos = 0) { |
||
2308 | |||
2309 | /** |
||
2310 | * permIdGetByName |
||
2311 | * |
||
2312 | * Displays the database ID of one or more permissions specified by permsid. |
||
2313 | * |
||
2314 | * <b>Input-Array like this:</b> |
||
2315 | * <pre> |
||
2316 | * $permissions = array(); |
||
2317 | * $permissions[] = 'permissionName'; |
||
2318 | * </pre> |
||
2319 | * <b>Output:</b> |
||
2320 | * <pre> |
||
2321 | * Array |
||
2322 | * { |
||
2323 | * [permsid] => b_serverinstance_help_view |
||
2324 | * [permid] => 4353 |
||
2325 | * } |
||
2326 | * </pre> |
||
2327 | * |
||
2328 | * @author Par0noid Solutions |
||
2329 | * @param string $permsids permNames |
||
2330 | * @return array permissionList |
||
2331 | */ |
||
2332 | function permIdGetByName($permsids) { |
||
2346 | |||
2347 | |||
2348 | /** |
||
2349 | * permissionList |
||
2350 | * |
||
2351 | * Displays a list of permissions available on the server instance including ID, name and description. |
||
2352 | * If the new parameter is set the permissionlist will return with the new output format. |
||
2353 | * |
||
2354 | * <b>Output: (with new parameter)</b> |
||
2355 | * <pre> |
||
2356 | * [0] => Array |
||
2357 | * ( |
||
2358 | * [num] => 1 |
||
2359 | * [group_id_end] => 0 |
||
2360 | * [pcount] => 0 |
||
2361 | * ) |
||
2362 | * |
||
2363 | * [1] => Array |
||
2364 | * ( |
||
2365 | * [num] => 2 |
||
2366 | * [group_id_end] => 7 |
||
2367 | * [pcount] => 7 |
||
2368 | * [permissions] => Array |
||
2369 | * ( |
||
2370 | * [0] => Array |
||
2371 | * ( |
||
2372 | * [permid] => 1 |
||
2373 | * [permname] => b_serverinstance_help_view |
||
2374 | * [permdesc] => Retrieve information about ServerQuery commands |
||
2375 | * [grantpermid] => 32769 |
||
2376 | * ) |
||
2377 | * |
||
2378 | * [1] => Array |
||
2379 | * ( |
||
2380 | * [permid] => 2 |
||
2381 | * [permname] => b_serverinstance_version_view |
||
2382 | * [permdesc] => Retrieve global server version (including platform and build number) |
||
2383 | * [grantpermid] => 32770 |
||
2384 | * ) |
||
2385 | * |
||
2386 | * [2] => Array |
||
2387 | * ( |
||
2388 | * [permid] => 3 |
||
2389 | * [permname] => b_serverinstance_info_view |
||
2390 | * [permdesc] => Retrieve global server information |
||
2391 | * [grantpermid] => 32771 |
||
2392 | * ) |
||
2393 | * |
||
2394 | * [3] => Array |
||
2395 | * ( |
||
2396 | * [permid] => 4 |
||
2397 | * [permname] => b_serverinstance_virtualserver_list |
||
2398 | * [permdesc] => List virtual servers stored in the database |
||
2399 | * [grantpermid] => 32772 |
||
2400 | * ) |
||
2401 | * |
||
2402 | * [4] => Array |
||
2403 | * ( |
||
2404 | * [permid] => 5 |
||
2405 | * [permname] => b_serverinstance_binding_list |
||
2406 | * [permdesc] => List active IP bindings on multi-homed machines |
||
2407 | * [grantpermid] => 32773 |
||
2408 | * ) |
||
2409 | * |
||
2410 | * [5] => Array |
||
2411 | * ( |
||
2412 | * [permid] => 6 |
||
2413 | * [permname] => b_serverinstance_permission_list |
||
2414 | * [permdesc] => List permissions available available on the server instance |
||
2415 | * [grantpermid] => 32774 |
||
2416 | * ) |
||
2417 | * |
||
2418 | * [6] => Array |
||
2419 | * ( |
||
2420 | * [permid] => 7 |
||
2421 | * [permname] => b_serverinstance_permission_find |
||
2422 | * [permdesc] => Search permission assignments by name or ID |
||
2423 | * [grantpermid] => 32775 |
||
2424 | * ) |
||
2425 | * |
||
2426 | * ) |
||
2427 | * |
||
2428 | * ) |
||
2429 | * </pre> |
||
2430 | * |
||
2431 | * @author Par0noid Solutions |
||
2432 | * @param boolean $new [optional] add new parameter |
||
2433 | * @return array permissionList |
||
2434 | */ |
||
2435 | function permissionList($new = false) { |
||
2470 | |||
2471 | /** |
||
2472 | * permOverview |
||
2473 | * |
||
2474 | * Displays all permissions assigned to a client for the channel specified with cid. If permid is set to 0, all permissions will be displayed. A permission can be specified by permid or permsid. |
||
2475 | * |
||
2476 | * <b>Output:</b> |
||
2477 | * <pre> |
||
2478 | * Array |
||
2479 | * { |
||
2480 | * [t] => 0 |
||
2481 | * [id1] => 2 |
||
2482 | * [id2] => 0 |
||
2483 | * [p] => 16777 |
||
2484 | * [v] => 1 |
||
2485 | * [n] => 0 |
||
2486 | * [s] => 0 |
||
2487 | * } |
||
2488 | * </pre> |
||
2489 | * |
||
2490 | * @author Par0noid Solutions |
||
2491 | * @param integer $cid cchannelId |
||
2492 | * @param integer $cldbid clientDbId |
||
2493 | * @param integer $permid permId (Default: 0) |
||
2494 | * @param string $permsid permName |
||
2495 | * @return array permOverview |
||
2496 | */ |
||
2497 | function permOverview($cid, $cldbid, $permid='0', $permsid=false ) { |
||
2503 | |||
2504 | /** |
||
2505 | * quit closes the connection to host |
||
2506 | * |
||
2507 | * @author Par0noid Solutions |
||
2508 | * @return none |
||
2509 | */ |
||
2510 | private function quit() { |
||
2515 | |||
2516 | /** |
||
2517 | * selectServer |
||
2518 | * |
||
2519 | * Selects the virtual server specified with sid or port to allow further interaction. The ServerQuery client will appear on the virtual server and acts like a real TeamSpeak 3 Client, except it's unable to send or receive voice data. If your database contains multiple virtual servers using the same UDP port, use will select a random virtual server using the specified port. |
||
2520 | * |
||
2521 | * @author Par0noid Solutions |
||
2522 | * @param integer $value Port or ID |
||
2523 | * @param string $type value type ('port', 'serverId') (default='port') |
||
2524 | * @param boolean $virtual set true to add -virtual param [optional] |
||
2525 | * @return boolean success |
||
2526 | */ |
||
2527 | function selectServer($value, $type = 'port', $virtual = false) { |
||
2549 | |||
2550 | /** |
||
2551 | * sendMessage |
||
2552 | * |
||
2553 | * Sends a text message a specified target. The type of the target is determined by targetmode while target specifies the ID of the recipient, whether it be a virtual server, a channel or a client. |
||
2554 | * <b>Hint:</b> You can just write to the channel the query client is in. See link in description for details. |
||
2555 | * |
||
2556 | * <b>Modes:</b> |
||
2557 | * <ul> |
||
2558 | * <li><b>1:</b> send to client</li> |
||
2559 | * <li><b>2:</b> send to channel</li> |
||
2560 | * <li><b>3:</b> send to server</li> |
||
2561 | * </ul> |
||
2562 | * <b>Targets:</b> |
||
2563 | * <ul> |
||
2564 | * <li>clientID</li> |
||
2565 | * <li>channelID</li> |
||
2566 | * <li>serverID</li> |
||
2567 | * </ul> |
||
2568 | * |
||
2569 | * @author Par0noid Solutions |
||
2570 | * @param integer $mode |
||
2571 | * @param integer $target |
||
2572 | * @param string $msg Message |
||
2573 | * @see http://forum.teamspeak.com/showthread.php/84280-Sendtextmessage-by-query-client http://forum.teamspeak.com/showthread.php/84280-Sendtextmessage-by-query-client |
||
2574 | * @return boolean success |
||
2575 | */ |
||
2576 | function sendMessage($mode, $target, $msg) { |
||
2580 | |||
2581 | /** |
||
2582 | * serverCreate |
||
2583 | * |
||
2584 | * Creates a new virtual server using the given properties and displays its ID, port and initial administrator privilege key. If virtualserver_port is not specified, the server will test for the first unused UDP port. The first virtual server will be running on UDP port 9987 by default. Subsequently started virtual servers will be running on increasing UDP port numbers. |
||
2585 | * |
||
2586 | * <b>Input-Array like this:</b> |
||
2587 | * <pre> |
||
2588 | * $data = array(); |
||
2589 | * |
||
2590 | * $data['setting'] = 'value'; |
||
2591 | * $data['setting'] = 'value'; |
||
2592 | * </pre> |
||
2593 | * |
||
2594 | * <b>Output:</b> |
||
2595 | * <pre> |
||
2596 | * Array |
||
2597 | * { |
||
2598 | * [sid] => 2 |
||
2599 | * [virtualserver_port] => 9988 |
||
2600 | * [token] => eKnFZQ9EK7G7MhtuQB6+N2B1PNZZ6OZL3ycDp2OW |
||
2601 | * } |
||
2602 | * </pre> |
||
2603 | * |
||
2604 | * @author Par0noid Solutions |
||
2605 | * @param array $data serverSettings [optional] |
||
2606 | * @return array serverInfo |
||
2607 | */ |
||
2608 | function serverCreate($data = array()) { |
||
2620 | |||
2621 | /** |
||
2622 | * serverDelete |
||
2623 | * |
||
2624 | * Deletes the virtual server specified with sid. Please note that only virtual servers in stopped state can be deleted. |
||
2625 | * |
||
2626 | * @author Par0noid Solutions |
||
2627 | * @param integer $sid serverID |
||
2628 | * @return boolean success |
||
2629 | */ |
||
2630 | function serverDelete($sid) { |
||
2634 | |||
2635 | /** |
||
2636 | * serverEdit |
||
2637 | * |
||
2638 | * Changes the selected virtual servers configuration using given properties. Note that this command accepts multiple properties which means that you're able to change all settings of the selected virtual server at once. |
||
2639 | * |
||
2640 | * <b>Input-Array like this:</b> |
||
2641 | * <pre> |
||
2642 | * $data = array(); |
||
2643 | * |
||
2644 | * $data['setting'] = 'value'; |
||
2645 | * $data['setting'] = 'value'; |
||
2646 | * </pre> |
||
2647 | * |
||
2648 | * @author Par0noid Solutions |
||
2649 | * @param array $data serverSettings |
||
2650 | * @return boolean success |
||
2651 | */ |
||
2652 | View Code Duplication | function serverEdit($data) { |
|
2663 | |||
2664 | /** |
||
2665 | * serverGroupAdd |
||
2666 | * |
||
2667 | * Creates a new server group using the name specified with name and displays its ID. The optional type parameter can be used to create ServerQuery groups and template groups. For detailed information, see |
||
2668 | * |
||
2669 | * <b>Output:</b> |
||
2670 | * <pre> |
||
2671 | * Array |
||
2672 | * { |
||
2673 | * [sgid] => 86 |
||
2674 | * } |
||
2675 | * </pre> |
||
2676 | * |
||
2677 | * @author Par0noid Solutions |
||
2678 | * @param integer $name groupName |
||
2679 | * @param integer $type groupDbType (0 = template, 1 = normal, 2 = query | Default: 1) |
||
2680 | * @return array groupId |
||
2681 | */ |
||
2682 | function serverGroupAdd($name, $type = 1) { |
||
2686 | |||
2687 | /** |
||
2688 | * serverGroupAddClient |
||
2689 | * |
||
2690 | * Adds a client to the server group specified with sgid. Please note that a client cannot be added to default groups or template groups. |
||
2691 | * |
||
2692 | * @author Par0noid Solutions |
||
2693 | * @param integer $sgid serverGroupId |
||
2694 | * @param integer $cldbid clientDBID |
||
2695 | * @return boolean success |
||
2696 | */ |
||
2697 | function serverGroupAddClient($sgid, $cldbid) { |
||
2701 | |||
2702 | /** |
||
2703 | * serverGroupAddPerm |
||
2704 | * |
||
2705 | * Adds a set of specified permissions to the server group specified with sgid. Multiple permissions can be added by providing the four parameters of each permission. A permission can be specified by permid or permsid. |
||
2706 | * |
||
2707 | * <b>Input-Array like this:</b> |
||
2708 | * <pre> |
||
2709 | * $permissions = array(); |
||
2710 | * $permissions['permissionID'] = array('permissionValue', 'permskip', 'permnegated'); |
||
2711 | * //or you could use |
||
2712 | * $permissions['permissionName'] = array('permissionValue', 'permskip', 'permnegated'); |
||
2713 | * </pre> |
||
2714 | * |
||
2715 | * @author Par0noid Solutions |
||
2716 | * @param integer $sgid groupID |
||
2717 | * @param array $permissions permissions |
||
2718 | * @return boolean success |
||
2719 | */ |
||
2720 | function serverGroupAddPerm($sgid, $permissions) { |
||
2811 | |||
2812 | /** |
||
2813 | * serverGroupClientList |
||
2814 | * |
||
2815 | * Displays the IDs of all clients currently residing in the server group specified with sgid. If you're using the optional -names option, the output will also contain the last known nickname and the unique identifier of the clients. |
||
2816 | * |
||
2817 | * <b>Possible params:</b> -names |
||
2818 | * |
||
2819 | * <b>Output: (with -names param)</b> |
||
2820 | * <pre> |
||
2821 | * Array |
||
2822 | * { |
||
2823 | * [cldbid] => 2017 |
||
2824 | * [client_nickname] => Par0noid //with -names parameter |
||
2825 | * [client_unique_identifier] => nUixbsq/XakrrmbqU8O30R/D8Gc= |
||
2826 | * } |
||
2827 | * </pre> |
||
2828 | * |
||
2829 | * @author Par0noid Solutions |
||
2830 | * @param integer $sgid groupId |
||
2831 | * @param boolean $names set true to add -names param [optional] |
||
2832 | * @return multidimensional-array serverGroupClientList |
||
2833 | */ |
||
2834 | function serverGroupClientList($sgid, $names = false) { |
||
2839 | |||
2840 | /** |
||
2841 | * serverGroupCopy |
||
2842 | * |
||
2843 | * Creates a copy of the server group specified with ssgid. If tsgid is set to 0, the server will create a new group. To overwrite an existing group, simply set tsgid to the ID of a designated target group. If a target group is set, the name parameter will be ignored. |
||
2844 | * |
||
2845 | * <b>Output:</b> |
||
2846 | * <pre> |
||
2847 | * Array |
||
2848 | * { |
||
2849 | * [sgid] => 86 |
||
2850 | * } |
||
2851 | * </pre> |
||
2852 | * |
||
2853 | * @author Par0noid Solutions |
||
2854 | * @param integer $ssgid sourceGroupID |
||
2855 | * @param integer $tsgid targetGroupID |
||
2856 | * @param integer $name groupName |
||
2857 | * @param integer $type groupDbType (0 = template, 1 = normal, 2 = query | Default: 1) |
||
2858 | * @return array groupId |
||
2859 | */ |
||
2860 | function serverGroupCopy($ssgid, $tsgid, $name, $type = 1) { |
||
2864 | |||
2865 | /** |
||
2866 | * serverGroupDelete |
||
2867 | * |
||
2868 | * Deletes the server group specified with sgid. If force is set to 1, the server group will be deleted even if there are clients within. |
||
2869 | * |
||
2870 | * @author Par0noid Solutions |
||
2871 | * @param integer $sgid serverGroupID |
||
2872 | * @param integer $force forces deleting group (Default: 1) |
||
2873 | * @return boolean success |
||
2874 | */ |
||
2875 | function serverGroupDelete($sgid, $force = 1) { |
||
2879 | |||
2880 | /** |
||
2881 | * serverGroupDeleteClient |
||
2882 | * |
||
2883 | * Removes a client specified with cldbid from the server group specified with sgid. |
||
2884 | * |
||
2885 | * @author Par0noid Solutions |
||
2886 | * @param integer $sgid groupID |
||
2887 | * @param integer $cldbid clientDBID |
||
2888 | * @return boolean success |
||
2889 | */ |
||
2890 | function serverGroupDeleteClient($sgid, $cldbid) { |
||
2894 | |||
2895 | /** |
||
2896 | * serverGroupDeletePerm |
||
2897 | * |
||
2898 | * Removes a set of specified permissions from the server group specified with sgid. Multiple permissions can be removed at once. A permission can be specified by permid or permsid. |
||
2899 | * |
||
2900 | * <b>Input-Array like this:</b> |
||
2901 | * <pre> |
||
2902 | * $permissions = array(); |
||
2903 | * $permissions[] = 'permissionID'; |
||
2904 | * //or you could use |
||
2905 | * $permissions[] = 'permissionName'; |
||
2906 | * </pre> |
||
2907 | * |
||
2908 | * @author Par0noid Solutions |
||
2909 | * @param integer $sgid serverGroupID |
||
2910 | * @param array $permissionIds permissionIds |
||
2911 | * @return boolean success |
||
2912 | */ |
||
2913 | View Code Duplication | function serverGroupDeletePerm($sgid, $permissionIds) { |
|
2927 | |||
2928 | /** |
||
2929 | * serverGroupList |
||
2930 | * |
||
2931 | * Displays a list of server groups available. Depending on your permissions, the output may also contain global ServerQuery groups and template groups. |
||
2932 | * |
||
2933 | * <b>Output:</b> |
||
2934 | * <pre> |
||
2935 | * Array |
||
2936 | * { |
||
2937 | * [sgid] => 1 |
||
2938 | * [name] => Guest Server Query |
||
2939 | * [type] => 2 |
||
2940 | * [iconid] => 0 |
||
2941 | * [savedb] => 0 |
||
2942 | * } |
||
2943 | * </pre> |
||
2944 | * |
||
2945 | * @author Par0noid Solutions |
||
2946 | * @return array serverGroupList |
||
2947 | */ |
||
2948 | function serverGroupList() { |
||
2952 | |||
2953 | /** |
||
2954 | * serverGroupPermList |
||
2955 | * |
||
2956 | * Displays a list of permissions assigned to the server group specified with sgid. If the permsid option is specified, the output will contain the permission names instead of the internal IDs. |
||
2957 | * |
||
2958 | * <b>Output:</b> |
||
2959 | * <pre> |
||
2960 | * Array |
||
2961 | * { |
||
2962 | * [permid] => 12876 (if permsid = false) |
||
2963 | * [permsid] => b_client_info_view (if permsid = true) |
||
2964 | * [permvalue] => 1 |
||
2965 | * [permnegated] => 0 |
||
2966 | * [permskip] => 0 |
||
2967 | * } |
||
2968 | * </pre> |
||
2969 | * |
||
2970 | * @author Par0noid Solutions |
||
2971 | * @param integer $sgid serverGroupID |
||
2972 | * @param boolean $permsid set true to add -permsid param [optional] |
||
2973 | * @return array serverGroupPermList |
||
2974 | */ |
||
2975 | function serverGroupPermList($sgid, $permsid = false) { |
||
2980 | |||
2981 | /** |
||
2982 | * serverGroupRename |
||
2983 | * |
||
2984 | * Changes the name of the server group specified with sgid. |
||
2985 | * |
||
2986 | * @author Par0noid Solutions |
||
2987 | * @param integer $sgid serverGroupID |
||
2988 | * @param integer $name groupName |
||
2989 | * @return boolean success |
||
2990 | */ |
||
2991 | function serverGroupRename($sgid, $name) { |
||
2995 | |||
2996 | /** |
||
2997 | * serverGroupsByClientID |
||
2998 | * |
||
2999 | * Displays all server groups the client specified with cldbid is currently residing in. |
||
3000 | * |
||
3001 | * <b>Output:</b> |
||
3002 | * <pre> |
||
3003 | * Array |
||
3004 | * { |
||
3005 | * [name] => Guest |
||
3006 | * [sgid] => 73 |
||
3007 | * [cldbid] => 2 |
||
3008 | * } |
||
3009 | * </pre> |
||
3010 | * |
||
3011 | * @author Par0noid Solutions |
||
3012 | * @param integer $cldbid clientDBID |
||
3013 | * @return array serverGroupsByClientId |
||
3014 | */ |
||
3015 | function serverGroupsByClientID($cldbid) { |
||
3019 | |||
3020 | /** |
||
3021 | * serverIdGetByPort |
||
3022 | * |
||
3023 | * Displays the database ID of the virtual server running on the UDP port specified by virtualserver_port. |
||
3024 | * |
||
3025 | * <b>Output:</b> |
||
3026 | * <pre> |
||
3027 | * Array |
||
3028 | * { |
||
3029 | * [server_id] => 1 |
||
3030 | * } |
||
3031 | * </pre> |
||
3032 | * |
||
3033 | * @author Par0noid Solutions |
||
3034 | * @param integer $port serverPort |
||
3035 | * @return array serverInfo |
||
3036 | */ |
||
3037 | function serverIdGetByPort($port) { |
||
3040 | |||
3041 | /** |
||
3042 | * serverInfo |
||
3043 | * |
||
3044 | * Displays detailed configuration information about the selected virtual server including unique ID, number of clients online, configuration, etc. |
||
3045 | * |
||
3046 | * <b>Output:</b> |
||
3047 | * <pre> |
||
3048 | * Array |
||
3049 | * { |
||
3050 | * [virtualserver_unique_identifier] => 2T3SRCPoWKojKlNMx6qxV7gOe8A= |
||
3051 | * [virtualserver_name] => TeamSpeak ]I[ Server |
||
3052 | * [virtualserver_welcomemessage] => Welcome to TeamSpeak |
||
3053 | * [virtualserver_platform] => Windows |
||
3054 | * [virtualserver_version] => 3.0.6.1 [Build: 1340956745] |
||
3055 | * [virtualserver_maxclients] => 32 |
||
3056 | * [virtualserver_password] => |
||
3057 | * [virtualserver_clientsonline] => 2 |
||
3058 | * [virtualserver_channelsonline] => 2 |
||
3059 | * [virtualserver_created] => 1361027787 |
||
3060 | * [virtualserver_uptime] => 2804 |
||
3061 | * [virtualserver_codec_encryption_mode] => 0 |
||
3062 | * [virtualserver_hostmessage] => |
||
3063 | * [virtualserver_hostmessage_mode] => 0 |
||
3064 | * [virtualserver_filebase] => files\\virtualserver_1 |
||
3065 | * [virtualserver_default_server_group] => 8 |
||
3066 | * [virtualserver_default_channel_group] => 8 |
||
3067 | * [virtualserver_flag_password] => 0 |
||
3068 | * [virtualserver_default_channel_admin_group] => 5 |
||
3069 | * [virtualserver_max_download_total_bandwidth] => 18446744073709551615 |
||
3070 | * [virtualserver_max_upload_total_bandwidth] => 18446744073709551615 |
||
3071 | * [virtualserver_hostbanner_url] => |
||
3072 | * [virtualserver_hostbanner_gfx_url] => |
||
3073 | * [virtualserver_hostbanner_gfx_interval] => 0 |
||
3074 | * [virtualserver_complain_autoban_count] => 5 |
||
3075 | * [virtualserver_complain_autoban_time] => 1200 |
||
3076 | * [virtualserver_complain_remove_time] => 3600 |
||
3077 | * [virtualserver_min_clients_in_channel_before_forced_silence] => 100 |
||
3078 | * [virtualserver_priority_speaker_dimm_modificator] => -18.0000 |
||
3079 | * [virtualserver_id] => 1 |
||
3080 | * [virtualserver_antiflood_points_tick_reduce] => 5 |
||
3081 | * [virtualserver_antiflood_points_needed_command_block] => 150 |
||
3082 | * [virtualserver_antiflood_points_needed_ip_block] => 250 |
||
3083 | * [virtualserver_client_connections] => 1 |
||
3084 | * [virtualserver_query_client_connections] => 6 |
||
3085 | * [virtualserver_hostbutton_tooltip] => |
||
3086 | * [virtualserver_hostbutton_url] => |
||
3087 | * [virtualserver_hostbutton_gfx_url] => |
||
3088 | * [virtualserver_queryclientsonline] => 1 |
||
3089 | * [virtualserver_download_quota] => 18446744073709551615 |
||
3090 | * [virtualserver_upload_quota] => 18446744073709551615 |
||
3091 | * [virtualserver_month_bytes_downloaded] => 0 |
||
3092 | * [virtualserver_month_bytes_uploaded] => 0 |
||
3093 | * [virtualserver_total_bytes_downloaded] => 0 |
||
3094 | * [virtualserver_total_bytes_uploaded] => 0 |
||
3095 | * [virtualserver_port] => 9987 |
||
3096 | * [virtualserver_autostart] => 1 |
||
3097 | * [virtualserver_machine_id] => |
||
3098 | * [virtualserver_needed_identity_security_level] => 8 |
||
3099 | * [virtualserver_log_client] => 0 |
||
3100 | * [virtualserver_log_query] => 0 |
||
3101 | * [virtualserver_log_channel] => 0 |
||
3102 | * [virtualserver_log_permissions] => 1 |
||
3103 | * [virtualserver_log_server] => 0 |
||
3104 | * [virtualserver_log_filetransfer] => 0 |
||
3105 | * [virtualserver_min_client_version] => 12369 |
||
3106 | * [virtualserver_name_phonetic] => |
||
3107 | * [virtualserver_icon_id] => 0 |
||
3108 | * [virtualserver_reserved_slots] => 0 |
||
3109 | * [virtualserver_total_packetloss_speech] => 0.0000 |
||
3110 | * [virtualserver_total_packetloss_keepalive] => 0.0000 |
||
3111 | * [virtualserver_total_packetloss_control] => 0.0000 |
||
3112 | * [virtualserver_total_packetloss_total] => 0.0000 |
||
3113 | * [virtualserver_total_ping] => 0.0000 |
||
3114 | * [virtualserver_ip] => |
||
3115 | * [virtualserver_weblist_enabled] => 1 |
||
3116 | * [virtualserver_ask_for_privilegekey] => 0 |
||
3117 | * [virtualserver_hostbanner_mode] => 0 |
||
3118 | * [virtualserver_status] => online |
||
3119 | * [connection_filetransfer_bandwidth_sent] => 0 |
||
3120 | * [connection_filetransfer_bandwidth_received] => 0 |
||
3121 | * [connection_filetransfer_bytes_sent_total] => 0 |
||
3122 | * [connection_filetransfer_bytes_received_total] => 0 |
||
3123 | * [connection_packets_sent_speech] => 0 |
||
3124 | * [connection_bytes_sent_speech] => 0 |
||
3125 | * [connection_packets_received_speech] => 0 |
||
3126 | * [connection_bytes_received_speech] => 0 |
||
3127 | * [connection_packets_sent_keepalive] => 2055 |
||
3128 | * [connection_bytes_sent_keepalive] => 84255 |
||
3129 | * [connection_packets_received_keepalive] => 2055 |
||
3130 | * [connection_bytes_received_keepalive] => 86309 |
||
3131 | * [connection_packets_sent_control] => 90 |
||
3132 | * [connection_bytes_sent_control] => 13343 |
||
3133 | * [connection_packets_received_control] => 90 |
||
3134 | * [connection_bytes_received_control] => 9176 |
||
3135 | * [connection_packets_sent_total] => 2145 |
||
3136 | * [connection_bytes_sent_total] => 97598 |
||
3137 | * [connection_packets_received_total] => 2145 |
||
3138 | * [connection_bytes_received_total] => 95485 |
||
3139 | * [connection_bandwidth_sent_last_second_total] => 82 |
||
3140 | * [connection_bandwidth_sent_last_minute_total] => 81 |
||
3141 | * [connection_bandwidth_received_last_second_total] => 84 |
||
3142 | * [connection_bandwidth_received_last_minute_total] => 87 |
||
3143 | * } |
||
3144 | * </pre> |
||
3145 | * |
||
3146 | * @author Par0noid Solutions |
||
3147 | * @return array serverInformation |
||
3148 | */ |
||
3149 | function serverInfo() { |
||
3153 | |||
3154 | /** |
||
3155 | * serverList |
||
3156 | * |
||
3157 | * Displays a list of virtual servers including their ID, status, number of clients online, etc. If you're using the -all option, the server will list all virtual servers stored in the database. This can be useful when multiple server instances with different machine IDs are using the same database. The machine ID is used to identify the server instance a virtual server is associated with. The status of a virtual server can be either online, offline, deploy running, booting up, shutting down and virtual online. While most of them are self-explanatory, virtual online is a bit more complicated. Please note that whenever you select a virtual server which is currently stopped, it will be started in virtual mode which means you are able to change its configuration, create channels or change permissions, but no regular TeamSpeak 3 Client can connect. As soon as the last ServerQuery client deselects the virtual server, its status will be changed back to offline. |
||
3158 | * |
||
3159 | * <b>Possible params:</b> [-uid] [-short] [-all] [-onlyoffline] |
||
3160 | * |
||
3161 | * <b>Output:</b> |
||
3162 | * <pre> |
||
3163 | * Array |
||
3164 | * { |
||
3165 | * [virtualserver_id] => 1 //displayed on -short |
||
3166 | * [virtualserver_port] => 9987 //displayed on -short |
||
3167 | * [virtualserver_status] => online //displayed on -short |
||
3168 | * [virtualserver_clientsonline] => 2 |
||
3169 | * [virtualserver_queryclientsonline] => 1 |
||
3170 | * [virtualserver_maxclients] => 32 |
||
3171 | * [virtualserver_uptime] => 3045 |
||
3172 | * [virtualserver_name] => TeamSpeak ]I[ Server |
||
3173 | * [virtualserver_autostart] => 1 |
||
3174 | * [virtualserver_machine_id] => |
||
3175 | * [-uid] => [virtualserver_unique_identifier] => bYrybKl/APfKq7xzpIJ1Xb6C06U= |
||
3176 | * } |
||
3177 | * </pre> |
||
3178 | * |
||
3179 | * @author Par0noid Solutions |
||
3180 | * @param string $options optional parameters |
||
3181 | * @return array serverList |
||
3182 | */ |
||
3183 | function serverList($options = NULL) { |
||
3186 | |||
3187 | /** |
||
3188 | * serverProcessStop |
||
3189 | * |
||
3190 | * Stops the entire TeamSpeak 3 Server instance by shutting down the process. |
||
3191 | * |
||
3192 | * @author Par0noid Solutions |
||
3193 | * @return boolean success |
||
3194 | */ |
||
3195 | function serverProcessStop() { |
||
3198 | |||
3199 | /** |
||
3200 | * serverRequestConnectionInfo |
||
3201 | * |
||
3202 | * Displays detailed connection information about the selected virtual server including uptime, traffic information, etc. |
||
3203 | * |
||
3204 | * <b>Output:</b> |
||
3205 | * <pre> |
||
3206 | * Array |
||
3207 | * { |
||
3208 | * [connection_filetransfer_bandwidth_sent] => 0 |
||
3209 | * [connection_filetransfer_bandwidth_received] => 0 |
||
3210 | * [connection_filetransfer_bytes_sent_total] => 0 |
||
3211 | * [connection_filetransfer_bytes_received_total] => 0 |
||
3212 | * [connection_packets_sent_total] => 3333 |
||
3213 | * [connection_bytes_sent_total] => 149687 |
||
3214 | * [connection_packets_received_total] => 3333 |
||
3215 | * [connection_bytes_received_total] => 147653 |
||
3216 | * [connection_bandwidth_sent_last_second_total] => 123 |
||
3217 | * [connection_bandwidth_sent_last_minute_total] => 81 |
||
3218 | * [connection_bandwidth_received_last_second_total] => 352 |
||
3219 | * [connection_bandwidth_received_last_minute_total] => 87 |
||
3220 | * [connection_connected_time] => 3387 |
||
3221 | * [connection_packetloss_total] => 0.0000 |
||
3222 | * [connection_ping] => 0.0000 |
||
3223 | * } |
||
3224 | * </pre> |
||
3225 | * |
||
3226 | * @author Par0noid Solutions |
||
3227 | * @return array serverRequestConnectionInfo |
||
3228 | */ |
||
3229 | function serverRequestConnectionInfo() { |
||
3233 | |||
3234 | /** |
||
3235 | * serverSnapshotCreate |
||
3236 | * |
||
3237 | * Displays a snapshot of the selected virtual server containing all settings, groups and known client identities. The data from a server snapshot can be used to restore a virtual servers configuration, channels and permissions using the serversnapshotdeploy command. |
||
3238 | * |
||
3239 | * @author Par0noid Solutions |
||
3240 | * @return string snapshot |
||
3241 | */ |
||
3242 | function serverSnapshotCreate() { |
||
3246 | |||
3247 | /** |
||
3248 | * serverSnapshotDeploy |
||
3249 | * |
||
3250 | * Restores the selected virtual servers configuration using the data from a previously created server snapshot. Please note that the TeamSpeak 3 Server does NOT check for necessary permissions while deploying a snapshot so the command could be abused to gain additional privileges. |
||
3251 | * |
||
3252 | * @author Par0noid Solutions |
||
3253 | * @param string $snapshot snapshot |
||
3254 | * @return boolean success |
||
3255 | */ |
||
3256 | function serverSnapshotDeploy($snapshot) { |
||
3260 | |||
3261 | /** |
||
3262 | * serverStart |
||
3263 | * |
||
3264 | * Starts the virtual server specified with sid. Depending on your permissions, you're able to start either your own virtual server only or all virtual servers in the server instance. |
||
3265 | * |
||
3266 | * @author Par0noid Solutions |
||
3267 | * @param integer $sid serverID |
||
3268 | * @return boolean success |
||
3269 | */ |
||
3270 | function serverStart($sid) { |
||
3273 | |||
3274 | /** |
||
3275 | * serverStop |
||
3276 | * |
||
3277 | * Stops the virtual server specified with sid. Depending on your permissions, you're able to stop either your own virtual server only or all virtual servers in the server instance. |
||
3278 | * |
||
3279 | * @author Par0noid Solutions |
||
3280 | * @param integer $sid serverID |
||
3281 | * @return boolean success |
||
3282 | */ |
||
3283 | function serverStop($sid) { |
||
3286 | |||
3287 | /** |
||
3288 | * serverTemppasswordAdd |
||
3289 | * |
||
3290 | * Sets a new temporary server password specified with pw. The temporary password will be valid for the number of seconds specified with duration. The client connecting with this password will automatically join the channel specified with tcid. If tcid is set to 0, the client will join the default channel. |
||
3291 | * |
||
3292 | * @author Par0noid Solutions |
||
3293 | * @param string $pw temporary password |
||
3294 | * @param string $duration durations in seconds |
||
3295 | * @param string $desc description [optional] |
||
3296 | * @param string $tcid cid user enters on connect (0 = Default channel) [optional] |
||
3297 | * @param string $tcpw channelPW |
||
3298 | * @return boolean success |
||
3299 | */ |
||
3300 | function serverTempPasswordAdd($pw, $duration, $desc = 'none', $tcid = 0, $tcpw = null) { |
||
3304 | |||
3305 | /** |
||
3306 | * serverTemppasswordDel |
||
3307 | * |
||
3308 | * Deletes the temporary server password specified with pw. |
||
3309 | * |
||
3310 | * @author Par0noid Solutions |
||
3311 | * @param string $pw temporary password |
||
3312 | * @return boolean success |
||
3313 | */ |
||
3314 | function serverTempPasswordDel($pw) { |
||
3318 | |||
3319 | /** |
||
3320 | * serverTemppasswordList |
||
3321 | * |
||
3322 | * Returns a list of active temporary server passwords. The output contains the clear-text password, the nickname and unique identifier of the creating client. |
||
3323 | * |
||
3324 | * <b>Output:</b> |
||
3325 | * <pre> |
||
3326 | * Array |
||
3327 | * { |
||
3328 | * [nickname] => serveradmin |
||
3329 | * [uid] => 1 |
||
3330 | * [desc] => none |
||
3331 | * [pw_clear] => test |
||
3332 | * [start] => 1334996838 |
||
3333 | * [end] => 1335000438 |
||
3334 | * [tcid] => 0 |
||
3335 | * } |
||
3336 | * </pre> |
||
3337 | * |
||
3338 | * @author Par0noid Solutions |
||
3339 | * @return array serverTemppasswordList |
||
3340 | */ |
||
3341 | function serverTempPasswordList() { |
||
3345 | |||
3346 | |||
3347 | /** |
||
3348 | * setClientChannelGroup |
||
3349 | * |
||
3350 | * Sets the channel group of a client to the ID specified with cgid. |
||
3351 | * |
||
3352 | * @author Par0noid Solutions |
||
3353 | * @param integer $cgid groupID |
||
3354 | * @param integer $cid channelID |
||
3355 | * @param integer $cldbid clientDBID |
||
3356 | * @return boolean success |
||
3357 | */ |
||
3358 | function setClientChannelGroup($cgid, $cid, $cldbid) { |
||
3362 | |||
3363 | /** |
||
3364 | * setName |
||
3365 | * |
||
3366 | * Sets your nickname in server query |
||
3367 | * |
||
3368 | * @author Par0noid Solutions |
||
3369 | * @param string $newName new name in server query |
||
3370 | * @return boolean success |
||
3371 | */ |
||
3372 | function setName($newName) { |
||
3375 | |||
3376 | /** |
||
3377 | * tokenAdd |
||
3378 | * |
||
3379 | * Create a new token. If tokentype is set to 0, the ID specified with tokenid1 will be a server group ID. Otherwise, tokenid1 is used as a channel group ID and you need to provide a valid channel ID using tokenid2. The tokencustomset parameter allows you to specify a set of custom client properties. This feature can be used when generating tokens to combine a website account database with a TeamSpeak user. The syntax of the value needs to be escaped using the ServerQuery escape patterns and has to follow the general syntax of: |
||
3380 | * ident=ident1 value=value1|ident=ident2 value=value2|ident=ident3 value=value3 |
||
3381 | * |
||
3382 | * <b>Input-Array like this:</b> |
||
3383 | * <pre> |
||
3384 | * $customFieldSet = array(); |
||
3385 | * |
||
3386 | * $customFieldSet['ident'] = 'value'; |
||
3387 | * $customFieldSet['ident'] = 'value'; |
||
3388 | * </pre> |
||
3389 | * |
||
3390 | * @author Par0noid Solutions |
||
3391 | * @param integer $tokentype token type |
||
3392 | * @param integer $tokenid1 groupID |
||
3393 | * @param integer $tokenid2 channelID |
||
3394 | * @param string $description token description [optional] |
||
3395 | * @param array $customFieldSet customFieldSet [optional] |
||
3396 | * @return array tokenInformation |
||
3397 | */ |
||
3398 | function tokenAdd($tokentype, $tokenid1, $tokenid2, $description ='', $customFieldSet = array()) { |
||
3417 | |||
3418 | /** |
||
3419 | * tokenDelete |
||
3420 | * |
||
3421 | * Deletes an existing token matching the token key specified with token. |
||
3422 | * |
||
3423 | * @author Par0noid Solutions |
||
3424 | * @param string $token token |
||
3425 | * @return boolean success |
||
3426 | */ |
||
3427 | function tokenDelete($token) { |
||
3431 | |||
3432 | /** |
||
3433 | * tokenList |
||
3434 | * |
||
3435 | * Displays a list of privilege keys available including their type and group IDs. Tokens can be used to gain access to specified server or channel groups. A privilege key is similar to a client with administrator privileges that adds you to a certain permission group, but without the necessity of a such a client with administrator privileges to actually exist. It is a long (random looking) string that can be used as a ticket into a specific server group. |
||
3436 | * |
||
3437 | * <b>Output:</b> |
||
3438 | * <pre> |
||
3439 | * Array |
||
3440 | * { |
||
3441 | * [token] => GdqedxSEDle3e9+LtR3o9dO09bURH+vymvF5hOJg |
||
3442 | * [token_type] => 0 |
||
3443 | * [token_id1] => 71 |
||
3444 | * [token_id2] => 0 |
||
3445 | * [token_created] => 1286625908 |
||
3446 | * [token_description] => for you |
||
3447 | * } |
||
3448 | * </pre> |
||
3449 | * |
||
3450 | * @author Par0noid Solutions |
||
3451 | * @return array tokenListist |
||
3452 | */ |
||
3453 | function tokenList() { |
||
3458 | |||
3459 | /** |
||
3460 | * tokenUse |
||
3461 | * |
||
3462 | * Use a token key gain access to a server or channel group. Please note that the server will automatically delete the token after it has been used. |
||
3463 | * |
||
3464 | * @author Par0noid Solutions |
||
3465 | * @param string $token token |
||
3466 | * @return boolean success |
||
3467 | */ |
||
3468 | function tokenUse($token) { |
||
3472 | |||
3473 | /** |
||
3474 | * version |
||
3475 | * |
||
3476 | * Displays the servers version information including platform and build number. |
||
3477 | * |
||
3478 | * <b>Output:</b> |
||
3479 | * <pre> |
||
3480 | * Array |
||
3481 | * { |
||
3482 | * [version] => 3.0.6.1 |
||
3483 | * [build] => 1340956745 |
||
3484 | * [platform] => Windows |
||
3485 | * } |
||
3486 | * </pre> |
||
3487 | * |
||
3488 | * @author Par0noid Solutions |
||
3489 | * @return array versionInformation |
||
3490 | */ |
||
3491 | function version() { |
||
3494 | |||
3495 | /** |
||
3496 | * whoAmI |
||
3497 | * |
||
3498 | * Displays information about your current ServerQuery connection including your loginname, etc. |
||
3499 | * |
||
3500 | * <b>Output:</b> |
||
3501 | * <pre> |
||
3502 | * Array |
||
3503 | * { |
||
3504 | * [virtualserver_status] => online |
||
3505 | * [virtualserver_id] => 1 |
||
3506 | * [virtualserver_unique_identifier] => bYrybKl/APfKq7xzpIJ1Xb6C06U= |
||
3507 | * [virtualserver_port] => 9987 |
||
3508 | * [client_id] => 5 |
||
3509 | * [client_channel_id] => 1 |
||
3510 | * [client_nickname] => serveradmin from 127.0.0.1:15208 |
||
3511 | * [client_database_id] => 1 |
||
3512 | * [client_login_name] => serveradmin |
||
3513 | * [client_unique_identifier] => serveradmin |
||
3514 | * [client_origin_server_id] => 0 |
||
3515 | * } |
||
3516 | * </pre> |
||
3517 | * |
||
3518 | * @author Par0noid Solutions |
||
3519 | * @return array clientinformation |
||
3520 | */ |
||
3521 | function whoAmI() { |
||
3524 | |||
3525 | //******************************************************************************************* |
||
3526 | //************************************ Helper Functions ************************************ |
||
3527 | //******************************************************************************************* |
||
3528 | |||
3529 | /** |
||
3530 | * checkSelected throws out 2 errors |
||
3531 | * |
||
3532 | * <b>Output:</b> |
||
3533 | * <pre> |
||
3534 | * Array |
||
3535 | * { |
||
3536 | * [success] => false |
||
3537 | * [errors] => Array |
||
3538 | * [data] => false |
||
3539 | * } |
||
3540 | * </pre> |
||
3541 | * |
||
3542 | * @author Par0noid Solutions |
||
3543 | * @return array error |
||
3544 | */ |
||
3545 | private function checkSelected() { |
||
3550 | |||
3551 | /** |
||
3552 | * convertSecondsToStrTime |
||
3553 | * |
||
3554 | * Converts seconds to a strTime (bsp. 5d 1h 23m 19s) |
||
3555 | * |
||
3556 | * @author Par0noid Solutions |
||
3557 | * @param integer $seconds time in seconds |
||
3558 | * @return string strTime |
||
3559 | */ |
||
3560 | public function convertSecondsToStrTime($seconds) { |
||
3564 | |||
3565 | /** |
||
3566 | * convertSecondsToArrayTime |
||
3567 | * |
||
3568 | * Converts seconds to a array: time |
||
3569 | * |
||
3570 | * <b>Output:</b> |
||
3571 | * <pre> |
||
3572 | * Array |
||
3573 | * { |
||
3574 | * [days] => 3 |
||
3575 | * [hours] => 9 |
||
3576 | * [minutes] => 45 |
||
3577 | * [seconds] => 17 |
||
3578 | * } |
||
3579 | * </pre> |
||
3580 | * |
||
3581 | * @author Par0noid Solutions |
||
3582 | * @param integer $seconds time in seconds |
||
3583 | * @return array time |
||
3584 | */ |
||
3585 | public function convertSecondsToArrayTime($seconds) { |
||
3593 | |||
3594 | /** |
||
3595 | * getElement |
||
3596 | * |
||
3597 | * Returns the given associated element from an array |
||
3598 | * This can be used to get a result in a one line operation |
||
3599 | * |
||
3600 | * For example you got this array: |
||
3601 | * <pre> |
||
3602 | * Array |
||
3603 | * { |
||
3604 | * [success] => false |
||
3605 | * [errors] => Array |
||
3606 | * [data] => false |
||
3607 | * } |
||
3608 | * </pre> |
||
3609 | * Now you can grab the element like this: |
||
3610 | * <pre> |
||
3611 | * $ts = new ts3admin('***', '***'); |
||
3612 | * |
||
3613 | * if($ts->getElement('success', $ts->connect())) { |
||
3614 | * //operation |
||
3615 | * } |
||
3616 | * </pre> |
||
3617 | * |
||
3618 | * @author Par0noid Solutions |
||
3619 | * @param string $element key of element |
||
3620 | * @param array $array array |
||
3621 | * @return mixed |
||
3622 | */ |
||
3623 | public function getElement($element, $array) { |
||
3626 | |||
3627 | /** |
||
3628 | * succeeded |
||
3629 | * |
||
3630 | * Succeeded will check the success element of a return array |
||
3631 | * <pre> |
||
3632 | * $ts = new ts3admin('***', '***'); |
||
3633 | * |
||
3634 | * if($ts->succeeded($ts->connect())) { |
||
3635 | * //operation |
||
3636 | * } |
||
3637 | * </pre> |
||
3638 | * |
||
3639 | * @author Par0noid Solutions |
||
3640 | * @param array $array result |
||
3641 | * @return boolean |
||
3642 | */ |
||
3643 | public function succeeded($array) { |
||
3650 | |||
3651 | |||
3652 | |||
3653 | //******************************************************************************************* |
||
3654 | //*********************************** Internal Functions ************************************ |
||
3655 | //******************************************************************************************* |
||
3656 | |||
3657 | /** |
||
3658 | * __construct |
||
3659 | * |
||
3660 | * @author Par0noid Solutions |
||
3661 | * @param string $host ts3host |
||
3662 | * @param integer $queryport ts3queryport |
||
3663 | * @param integer $timeout socket timeout (default = 2) [optional] |
||
3664 | * @return void |
||
3665 | */ |
||
3666 | function __construct($host, $queryport, $timeout = 2) { |
||
3679 | |||
3680 | /** |
||
3681 | * __destruct |
||
3682 | * |
||
3683 | * @author Par0noid Solutions |
||
3684 | * @return void |
||
3685 | */ |
||
3686 | function __destruct() { |
||
3689 | |||
3690 | /** |
||
3691 | * __call |
||
3692 | * |
||
3693 | * prevents your website from php errors if you want to execute a method which doesn't exists |
||
3694 | * |
||
3695 | * @author Par0noid Solutions |
||
3696 | * @param string $name method name |
||
3697 | * @param array $args method arguments |
||
3698 | * @return void |
||
3699 | */ |
||
3700 | function __call($name, $args) { |
||
3704 | |||
3705 | /** |
||
3706 | * isConnected |
||
3707 | * |
||
3708 | * Checks if the connection is established |
||
3709 | * |
||
3710 | * @author Par0noid Solutions |
||
3711 | * @return boolean connected |
||
3712 | */ |
||
3713 | private function isConnected() { |
||
3720 | |||
3721 | /** |
||
3722 | * generateOutput |
||
3723 | * |
||
3724 | * Builds a method return as array |
||
3725 | * |
||
3726 | * @author Par0noid Solutions |
||
3727 | * @param boolean $success true/false |
||
3728 | * @param array $errors all errors which occured while executing a method |
||
3729 | * @param mixed $data parsed data from server |
||
3730 | * @return array output |
||
3731 | */ |
||
3732 | private function generateOutput($success, $errors, $data) { |
||
3735 | |||
3736 | /** |
||
3737 | * unEscapeText |
||
3738 | * |
||
3739 | * Turns escaped chars to normals |
||
3740 | * |
||
3741 | * @author Par0noid Solutions |
||
3742 | * @param string $text text which should be escaped |
||
3743 | * @return string text |
||
3744 | */ |
||
3745 | private function unEscapeText($text) { |
||
3751 | |||
3752 | /** |
||
3753 | * escapeText |
||
3754 | * |
||
3755 | * Escapes chars that we can use it in the query |
||
3756 | * |
||
3757 | * @author Par0noid Solutions |
||
3758 | * @param string $text text which should be escaped |
||
3759 | * @return string text |
||
3760 | */ |
||
3761 | private function escapeText($text) { |
||
3772 | |||
3773 | /** |
||
3774 | * splitBanIds |
||
3775 | * |
||
3776 | * Splits banIds to array |
||
3777 | * |
||
3778 | * @author Par0noid Solutions |
||
3779 | * @param string $text plain text server response |
||
3780 | * @return string text |
||
3781 | */ |
||
3782 | private function splitBanIds($text) { |
||
3789 | |||
3790 | //******************************************************************************************* |
||
3791 | //************************************ Network Functions ************************************ |
||
3792 | //******************************************************************************************* |
||
3793 | |||
3794 | /** |
||
3795 | * connect |
||
3796 | * |
||
3797 | * Connects to a ts3instance query port |
||
3798 | * |
||
3799 | * @author Par0noid Solutions |
||
3800 | * @return boolean success |
||
3801 | */ |
||
3802 | function connect() { |
||
3823 | |||
3824 | /** |
||
3825 | * executeCommand |
||
3826 | * |
||
3827 | * Executes a command and fetches the response |
||
3828 | * |
||
3829 | * @author Par0noid Solutions |
||
3830 | * @param string $command command which should be executed |
||
3831 | * @param array $tracert array with information from first exec |
||
3832 | * @return mixed data |
||
3833 | */ |
||
3834 | private function executeCommand($command, $tracert) { |
||
3875 | |||
3876 | /** |
||
3877 | * getData |
||
3878 | * |
||
3879 | * Parses data from query and returns an array |
||
3880 | * |
||
3881 | * @author Par0noid Solutions |
||
3882 | * @access private |
||
3883 | * @param string $mode select return mode ('boolean', 'array', 'multi', 'plain') |
||
3884 | * @param string $command command which should be executed |
||
3885 | * @return mixed data |
||
3886 | */ |
||
3887 | private function getData($mode, $command) { |
||
3974 | |||
3975 | /** |
||
3976 | * ftSendKey |
||
3977 | * |
||
3978 | * Sends down/upload-key to ftHost |
||
3979 | * |
||
3980 | * @author Par0noid Solutions |
||
3981 | * @param string $key |
||
3982 | * @param string $additional |
||
3983 | * @return none |
||
3984 | */ |
||
3985 | private function ftSendKey($key, $additional = NULL) { |
||
3988 | |||
3989 | /** |
||
3990 | * ftSendData |
||
3991 | * |
||
3992 | * Sends data to ftHost |
||
3993 | * |
||
3994 | * @author Par0noid Solutions |
||
3995 | * @param mixed $data |
||
3996 | * @return none |
||
3997 | */ |
||
3998 | private function ftSendData($data) { |
||
4004 | |||
4005 | /** |
||
4006 | * ftRead |
||
4007 | * |
||
4008 | * Reads data from ftHost |
||
4009 | * |
||
4010 | * @author Par0noid Solutions |
||
4011 | * @param int $size |
||
4012 | * @return string data |
||
4013 | */ |
||
4014 | private function ftRead($size) { |
||
4021 | |||
4022 | //******************************************************************************************* |
||
4023 | //************************************* Debug Functions ************************************* |
||
4024 | //******************************************************************************************* |
||
4025 | |||
4026 | /** |
||
4027 | * getDebugLog |
||
4028 | * |
||
4029 | * Returns the debug log |
||
4030 | * |
||
4031 | * <b>Output:</b> |
||
4032 | * <pre> |
||
4033 | * Array |
||
4034 | * { |
||
4035 | * [0] => Error in login() on line 1908: ErrorID: 520 | Message: invalid loginname or password |
||
4036 | * [1] => Error in selectServer() on line 2044: ErrorID: 1540 | Message: convert error |
||
4037 | * } |
||
4038 | * </pre> |
||
4039 | * |
||
4040 | * @author Par0noid Solutions |
||
4041 | * @return array debugLog |
||
4042 | */ |
||
4043 | public function getDebugLog() { |
||
4046 | |||
4047 | /** |
||
4048 | * addDebugLog |
||
4049 | * |
||
4050 | * Adds an entry to debugLog |
||
4051 | * |
||
4052 | * @author Par0noid Solutions |
||
4053 | * @param string $text text which should added to debugLog |
||
4054 | * @param string $methodName name of the executed method [optional] |
||
4055 | * @param string $line line where error triggered [optional] |
||
4056 | * @return array debugLog |
||
4057 | */ |
||
4058 | private function addDebugLog($text, $methodName = '', $line = '') { |
||
4066 | } |
||
4067 | ?> |
||
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.