Crate ts3plugin

Source
Expand description

TeamSpeak 3.6 updates the plugin api version to 26.
Version 0.3 is compatible with this version.

At the moment, not all methods that are exposed by the TeamSpeak API are available for plugins. If a method that you need is missing, please file an issue or open a pull request.

§Usage

Add the following to your Cargo.toml:

[package]
name = "<pluginname>"
version = "<version>"
authors = ["<your name>"]
description = "<description>"

[lib]
name = "<pluginname>"
crate-type = ["cdylib"]

[dependencies]
ts3plugin = "0.3"

§Example

A fully working example, which creates a plugin that does nothing:

#[macro_use]
extern crate ts3plugin;

use ts3plugin::*;

struct MyTsPlugin;

impl Plugin for MyTsPlugin {
    // The default name is the crate name, but we can overwrite it here.
    fn name()        -> String { String::from("My Ts Plugin") }
    fn command() -> Option<String> { Some(String::from("myplugin")) }
    fn autoload() -> bool { false }
    fn configurable() -> ConfigureOffer { ConfigureOffer::No }

    // The only required method
    fn new(api: &TsApi) -> Result<Box<MyTsPlugin>, InitError> {
        api.log_or_print("Inited", "MyTsPlugin", LogLevel::Info);
        Ok(Box::new(MyTsPlugin))
        // Or return Err(InitError::Failure) on failure
    }

    // Implement callbacks here

    fn shutdown(&mut self, api: &TsApi) {
        api.log_or_print("Shutdown", "MyTsPlugin", LogLevel::Info);
    }
}

create_plugin!(MyTsPlugin);

Re-exports§

pub use plugin::*;

Modules§

plugin
ts3interface

Macros§

create_plugin
Create a plugin.

Structs§

BBCodeTags
BookmarkItem
BookmarkList
Channel
ChannelGroup
ChannelGroupId
ChannelId
A wrapper for a channel id.
ClientMiniExport
Connection
ConnectionId
A wrapper for a connection id.
FileTransferCallbackExport
Hotkey
Invoker
The invoker is maybe not visible to the user, but we can get events caused by him, so some information about him are passed along with his id.
InvokerData
MenuItem
MytsDataUnsetFlags
Permission
PermissionId
Permissions
Permissions - TODO not yet implemented
PluginLock
Server
ServerGroup
ServerGroupId
ServerId
A wrapper for a server id.
Speaker
Speaker locations used by some sound callbacks
TransformFilePathExport
Structure used to describe a file transfer in the \ref ServerLibFunctions.onTransformFilePath callback. This describes the original values, and also contains hints for length limitations of the result parameter of the callback. Important: Which values of the struct can be modified is defined by the action value of the original parameter.
TransformFilePathExportReturns
Structure to rewrite the file transfer file name and path in the \ref ServerLibFunctions.onTransformFilePath callback. The lengths are limited as described in the original parameter. Important: Which values of the struct can be modified is defined by the action value of the original parameter.
Ts3Functions
Functions exported to plugin from main binary
Ts3Vector
Describes a client position in 3 dimensional space, used for 3D Sound.
TsApi
The main struct that contains all permanently save data.
TsApiLock
VariablesExport
VariablesExportItem
Some structs to handle variables in callbacks

Enums§

ACLType
Access Control List
AwayStatus
ChannelBoolProperty
ChannelCodecTypeProperty
ChannelHostbannerModeProperty
ChannelI32Property
ChannelOptionChannelProperty
ChannelProperties
ChannelProperty
ChannelStringProperty
ClientCommand
This enum is used to disable client commands on the server
ClientProperties
ClientType
CodecEncryptionMode
CodecType
CommandLinePropertiesRare
ConfigureOffer
Return values for offersConfigure
ConnectStatus
ConnectTab
ConnectionAwayStatusProperty
ConnectionBoolProperty
ConnectionChannelGroupIdProperty
ConnectionChannelIdProperty
ConnectionChannelProperty
ConnectionDateTimeUtcProperty
ConnectionDurationProperty
ConnectionHardwareInputStatusProperty
ConnectionHardwareOutputStatusProperty
ConnectionI32Property
ConnectionInputDeactivationStatusProperty
ConnectionMuteInputStatusProperty
ConnectionMuteOutputStatusProperty
ConnectionProperties
ConnectionProperty
ConnectionStringProperty
ConnectionTalkStatusProperty
ConnectionU16Property
ConnectionU64Property
ConnectionVecServerGroupIdProperty
Error
FileListType
File transfer type
FileTransferAction
File transfer actions
FileTransferState
File transfer status
GroupShowNameTreeMode
GroupWhisperTargetMode
GroupWhisperType
GuiProfile
HardwareInputStatus
HardwareOutputStatus
HostbannerMode
HostmessageMode
InputDeactivationStatus
ItemType
LicenseIssue
LocalTestMode
LogLevel
LogTypes
MenuType
MessageReceiver
The possible receivers of a message. A message can be sent to a specific connection, to the current channel chat or to the server chat.
MessageTarget
MonoSoundDestination
MuteInputStatus
MuteOutputStatus
PluginTargetMode
ProtocolEncryptionCipher
ReasonIdentifier
SecuritySaltOptions
ServerBinding
ServerBoolProperty
ServerChannelGroupIdProperty
ServerCodecEncryptionModeProperty
ServerConnectionProperty
ServerDateTimeUtcProperty
ServerDurationProperty
ServerHostbannerModeProperty
ServerHostmessageModeProperty
ServerI32Property
ServerInstancePropertiesRare
ServerProperty
ServerServerGroupIdProperty
ServerStringProperty
TalkStatus
TextMessageTargetMode
VirtualServerProperties
Visibility

Constants§

BANDWIDTH_LIMIT_UNLIMITED
HOTKEY_BUFSZ
MAX_SIZE_AWAY_MESSAGE
MAX_SIZE_CHANNEL_DESCRIPTION
channel description length limit, measured in bytes (utf8 encoded)
MAX_SIZE_CHANNEL_NAME
channel name maximum length in characters
MAX_SIZE_CHANNEL_TOPIC
// channel topic lengt limith, measured in bytes (utf8 encoded)
MAX_SIZE_CLIENT_DESCRIPTION
MAX_SIZE_CLIENT_NICKNAME
client display name length limit in characters
MAX_SIZE_CLIENT_NICKNAME_NONSDK
MAX_SIZE_COMPLAIN_MESSAGE
MAX_SIZE_GROUP_NAME
MAX_SIZE_HOSTBUTTON_TOOLTIP
MAX_SIZE_HOST_MESSAGE
MAX_SIZE_OFFLINE_MESSAGE
MAX_SIZE_OFFLINE_MESSAGE_SUBJECT
MAX_SIZE_POKE_MESSAGE
MAX_SIZE_REASON_MESSAGE
length limit in characters for kick, move, etc reasons
MAX_SIZE_TALK_REQUEST_MESSAGE
MAX_SIZE_TEXTMESSAGE
text message length limit, measured in bytes (utf8 encoded)
MAX_SIZE_USER_TAG
MAX_SIZE_VIRTUALSERVER_HOSTBANNER_GFX_URL
MAX_SIZE_VIRTUALSERVER_NAME
virtual server name maximum length in characters
MAX_SIZE_VIRTUALSERVER_WELCOMEMESSAGE
server welcome message length limit measured in bytes (utf8 encoded)
MAX_VARIABLES_EXPORT_COUNT
MENU_BUFSZ
MIN_SECONDS_CLIENTID_REUSE
Minimum amount of seconds before a clientID that was in use can be assigned to a new client
MIN_SIZE_CLIENT_NICKNAME
client display name minimum length in characters
MIN_SIZE_CLIENT_NICKNAME_NONSDK
SIZE_MYTSID

Type Aliases§

ChannelChanges
ConnectionChanges
ServerChanges