TeamSpeak API 1.5.2

License Agreement
Freie Lizenz
Website
https://hanashi.dev
Supported Versions
WoltLab Suite 3.0
WoltLab Suite 3.1

This plugin serves as an interface between other plugins and your TeamSpeak server. This plugin is especially relevant for developers. It can also be used as a base plugin for other plugins.

Different server connections can be set, which can then be accessed by other plugins.

Prerequisites

  • WoltLab Suite Core 3.0/3.1

Questions and answers

How do I create a new connection?

Go to ACP -> configuration -> TeamSpeak -> Server -> add TeamSpeak server.

How can I implement the API in my plugin?

Add the dependency to this plugin to your package.xml:

XML: package.xml
  1. <requiredpackage minversion="1.5.0">eu.hanashi.wsc.teamspeak-api</requiredpackage>

Let your users select the server connection in the ACP using the option.xml:

XML: option.xml
  1. <option name="my_plugin_teamspeak_identity">
  2. <categoryname>my_category</categoryname>
  3. <optiontype>TeamSpeakConnectionSelect</optiontype>
  4. </option>

The name (in the example my_plugin_teamspeak_identity) and the correct category (in the example my_category) have to be chosen by yourself.

Now create a PHP class in the directory lib/system/teamspeak which extends the class AbstractTeamSpeakHandler:

PHP: MyPluginTeamSpeakHandler.class.php
  1. <?php
  2. namespace wcf\system\teamspeak;
  3. class MyPluginTeamSpeakHandler extends AbstractTeamSpeakHandler {
  4. protected $teamspeakID = MY_PLUGIN_TEAMSPEAK_IDENTITIY;
  5. }

Of course you can choose the file and class name yourself. Don't forget to use the correct constant instead of MY_PLUGIN_TEAMSPEAK_IDENTITIY.

Now you can access the TeamSpeak API in other classes. Here is an example in an action class::

How do I execute a TeamSpeak command?

The TeamSpeak command is always the same as the method. The parameters are passed to the parameters as an array. Here are some examples:

Images

  • Version 1.5.2

    • FIX: Download and Upload of Files
    • FIX: if file was not found during file transfer, exception is thrown no

  • Version 1.5.0

    • FEATURE: libssh2 is now used instead of phpseclib if this is installed

  • Version 1.4.1

    • CHANGE:Database data types meaningfully changed
    • CHANGE: Class TeamSpeak renamed to TeamSpeakConnectionHandler and now refers to TeamSpeakRawHandler andTeamSpeakSshHandler

  • Kleine Idee für Entwickler:
    Ein TS Bot der, wenn etwas in eine bestimmtes Forum gepostet wurde, daraufhin Member eine bestimmte TS Gruppe via Chat anschreibt, mit folgendem Inhalt:

    Titel,

    Anfangsteil des Inhalts und

    Link zum Posting.


    Quasi ein Notify Funktion für TS3.

    • Sowas ähnliches ist geplant, insofern TS5 global Chats bekommt. Dann wollte ich das wie beim Discord-Sync machen, dass neue Forenbeiträge in einen globalen Chat gepostet werden. Aber erstmal abwarten :)