首次推送

This commit is contained in:
sansen
2026-07-20 19:01:03 +08:00
parent ea01b9cf99
commit ef1bf61f9f
4484 changed files with 937163 additions and 1 deletions
@@ -0,0 +1,528 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Advanced virtual server creation &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Retrieve and store information" href="info.html" />
<link rel="prev" title="Create and stop virtual servers" href="vserver-manage.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Advanced virtual server creation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#create-server-structure-pointer">Create server structure pointer</a></li>
<li class="toctree-l2"><a class="reference internal" href="#set-essential-server-properties">Set essential server properties</a></li>
<li class="toctree-l2"><a class="reference internal" href="#query-and-set-optional-server-properties">Query and set optional server properties</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#query-variables">Query variables</a></li>
<li class="toctree-l3"><a class="reference internal" href="#set-variables">Set variables</a></li>
<li class="toctree-l3"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#initialize-the-channel-tree">Initialize the channel tree</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#set-essential-channel-properties">Set essential channel properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="#set-and-query-optional-channel-properties">Set and query optional channel properties</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#create-the-virtual-server-and-channels">Create the virtual server and channels</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Advanced virtual server creation</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="advanced-virtual-server-creation">
<span id="s-server-create-advanced"></span><h1>Advanced virtual server creation<a class="headerlink" href="#advanced-virtual-server-creation" title="Link to this heading"></a></h1>
<p>In addition to the previously mentioned way to create a virtual server
using <a class="reference internal" href="vserver-manage.html#c.ts3server_createVirtualServer" title="ts3server_createVirtualServer"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_createVirtualServer()</span></code></a>, there is an alternative way to
create a virtual server. The advantage of this method is the possibility
to restore the complete channel structure upon server creation including
the channel IDs in one step. This allows taking and restoring server
snapshots including the channel tree.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>For a complete example please see the “server_creation_params” sample
code in the SDK package.</p>
</div>
<section id="create-server-structure-pointer">
<h2>Create server structure pointer<a class="headerlink" href="#create-server-structure-pointer" title="Link to this heading"></a></h2>
<p>First, a <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3VirtualServerCreationParams</span></code> has to be created, which
will be filled with essential and optional server parameters. This will eventually
contain the entire virtual server structure and is used to create and start the virtual server.</p>
<p>Create a new virtual server parameter structure using</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_makeVirtualServerCreationParams</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3VirtualServerCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Creates a structure to define an entire virtual server including the channel layout for server creation for use with <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a>. </p>
<p>This is the first function to call when using the <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> meachanism of creating virtual servers in one go, including all of their channels. After receiving the structure using this function, you need to call <a class="reference internal" href="../server_api.html#serverlib_8h_1a61075aae119c7d5f16c7601512bbf48e"><span class="std std-ref">ts3server_setVirtualServerCreationParams</span></a> to set basic configuration for this virtual server. Once that is done you can set additional parameters using <a class="reference internal" href="../server_api.html#serverlib_8h_1a57d50ad9f5b070e63d7c1a02b5c8781e"><span class="std std-ref">ts3server_getVirtualServerCreationParamsVariables</span></a> and <a class="reference internal" href="../server_api.html#serverlib_8h_1a08ad40944701d279e0d417f30bebb035"><span class="std std-ref">ts3server_setVariableAsInt</span></a>, <a class="reference internal" href="../server_api.html#serverlib_8h_1ad3245ab7544e8444f76156f35575e84d"><span class="std std-ref">ts3server_setVariableAsUInt64</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a1b584647b5c91c42707494ab631c9213"><span class="std std-ref">ts3server_setVariableAsString</span></a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>result</strong> address of a variable to receive a pointer to a structure defining the virtual server. This must be filled using <a class="reference internal" href="../server_api.html#serverlib_8h_1a61075aae119c7d5f16c7601512bbf48e"><span class="std std-ref">ts3server_setVirtualServerCreationParams</span></a> after this. Pointer must not be freed by caller. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Do not free or dispose of the structure, it must be valid as long
as the virtual server exists.
The server lib will take care of cleaning up the structure at an
appropriate time.</p>
</div>
</section>
<section id="set-essential-server-properties">
<h2>Set essential server properties<a class="headerlink" href="#set-essential-server-properties" title="Link to this heading"></a></h2>
<p>Once the <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3VirtualServerCreationParams</span></code> structure has been created, it
needs to be filled with the essential parameters to create a new virtual
server. Essential parameters include server port, IP, the key pair, maximum number of
clients, number of channels we want to start the server with and the
virtual server ID.</p>
<p>To set these essential parameters call the function</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setVirtualServerCreationParams</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3VirtualServerCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">virtualServerCreationParams</span></span>, <span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">serverPort</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">serverIp</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">serverKeyPair</span></span>, <span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">serverMaxClients</span></span>, <span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">channelCount</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Set mandatory server creation properties for server creation using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a>. </p>
<p>This call is mandatory after calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a721abc40a3ce104064cce4448c455ca4"><span class="std std-ref">ts3server_makeVirtualServerCreationParams</span></a> when using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> and sets the basic information to create a virtual server. After this call you can optionally set other variables by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a57d50ad9f5b070e63d7c1a02b5c8781e"><span class="std std-ref">ts3server_getVirtualServerCreationParamsVariables</span></a> after this.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>virtualServerCreationParams</strong> pointer to a struct of creation parameters obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a721abc40a3ce104064cce4448c455ca4"><span class="std std-ref">ts3server_makeVirtualServerCreationParams</span></a></p></li>
<li><p><strong>serverPort</strong> the UDP port to listen for client connections on </p></li>
<li><p><strong>serverIp</strong> comma separated list of IP address(es) to listen for client connections on. IPv4 and IPv6 addresses are supported. </p></li>
<li><p><strong>serverKeyPair</strong> unique key for encryption. Pass an empty string when originally creating a new server, query the generated encryption key with <a class="reference internal" href="../server_api.html#serverlib_8h_1ad40026c9644902e2e02b50ea18166609"><span class="std std-ref">ts3server_getVirtualServerKeyPair</span></a>, store it and use it on subsequent start ups. </p></li>
<li><p><strong>serverMaxClients</strong> maximum number of clients that can be connected simultaneously at any given time </p></li>
<li><p><strong>channelCount</strong> the amount of channels this server will have after creation. You must call <a class="reference internal" href="../server_api.html#serverlib_8h_1a43b890922f8f205e9b725e79c104abd2"><span class="std std-ref">ts3server_getVirtualServerCreationParamsChannelCreationParams</span></a> with this virtualServerCreationParams exactly this many times. </p></li>
<li><p><strong>serverID</strong> the id this virtual server will have when created. server id must be unique during life time of the server library. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="query-and-set-optional-server-properties">
<h2>Query and set optional server properties<a class="headerlink" href="#query-and-set-optional-server-properties" title="Link to this heading"></a></h2>
<p>After essential virtual server parameters have been defined with
<a class="reference internal" href="#c.ts3server_setVirtualServerCreationParams" title="ts3server_setVirtualServerCreationParams"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVirtualServerCreationParams()</span></code></a>, additional parameters can
be set. For that, we first need to get a <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3Variables</span></code> from the
<code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3VirtualServerCreationParams</span></code>, in which the additional
paramters will be written using the functions
<a class="reference internal" href="#c.ts3server_setVariableAsInt" title="ts3server_setVariableAsInt"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVariableAsInt()</span></code></a>, <a class="reference internal" href="#c.ts3server_setVariableAsUInt64" title="ts3server_setVariableAsUInt64"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVariableAsUInt64()</span></code></a> and
<a class="reference internal" href="#c.ts3server_setVariableAsString" title="ts3server_setVariableAsString"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVariableAsString()</span></code></a>.</p>
<p>To receive a pointer to a <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3Variables</span></code> structure call</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVirtualServerCreationParamsVariables</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3VirtualServerCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">virtualServerCreationParams</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3Variables</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>create struct to define optional server settings for server creation with <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>virtualServerCreationParams</strong></p></li>
<li><p><strong>result</strong> address of a variable to receive a pointer to a TS3Variables struct, to set optional server settings using <a class="reference internal" href="../server_api.html#serverlib_8h_1a08ad40944701d279e0d417f30bebb035"><span class="std std-ref">ts3server_setVariableAsInt</span></a>, <a class="reference internal" href="../server_api.html#serverlib_8h_1a1b584647b5c91c42707494ab631c9213"><span class="std std-ref">ts3server_setVariableAsString</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1ad3245ab7544e8444f76156f35575e84d"><span class="std std-ref">ts3server_setVariableAsUInt64</span></a>. Memory must not be freed by caller. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>Once you have a pointer to a valid <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3Variables</span></code> structure, you can query
and modify various parameters with one of the following functions.
Select the proper function depending of the type of the parameter you
want to query or modify.</p>
<section id="query-variables">
<h3>Query variables<a class="headerlink" href="#query-variables" title="Link to this heading"></a></h3>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3Variables</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">var</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a property of a server or channel when using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a></p>
<p>Not all properties are available as integer. Some are only available as string or unsigned 64 bit integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var</strong> pointer to a TS3Variables struct obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a57d50ad9f5b070e63d7c1a02b5c8781e"><span class="std std-ref">ts3server_getVirtualServerCreationParamsVariables</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a9377f425b1bba45358cd97c579dc9512"><span class="std std-ref">ts3server_getChannelCreationParamsVariables</span></a></p></li>
<li><p><strong>flag</strong> specifies which variable to receive the value of. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the desired value </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3Variables</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">var</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a property of a server or channel when using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a></p>
<p>Not all properties are available as unsigned 64 bit integer. Some are only available as string or integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var</strong> pointer to a TS3Variables struct obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a57d50ad9f5b070e63d7c1a02b5c8781e"><span class="std std-ref">ts3server_getVirtualServerCreationParamsVariables</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a9377f425b1bba45358cd97c579dc9512"><span class="std std-ref">ts3server_getChannelCreationParamsVariables</span></a></p></li>
<li><p><strong>flag</strong> specifies which variable to receive the value of. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the desired value </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVariableAsString</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3Variables</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">var</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a property of a server or channel when using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a></p>
<p>Not all properties are available as string. Some are only available as unsigned 64 bit integer or integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var</strong> pointer to a TS3Variables struct obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a57d50ad9f5b070e63d7c1a02b5c8781e"><span class="std std-ref">ts3server_getVirtualServerCreationParamsVariables</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a9377f425b1bba45358cd97c579dc9512"><span class="std std-ref">ts3server_getChannelCreationParamsVariables</span></a></p></li>
<li><p><strong>flag</strong> specifies which variable to receive the value of. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the desired value. Memory is allocated by the server library and must be freed by caller using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="set-variables">
<h3>Set variables<a class="headerlink" href="#set-variables" title="Link to this heading"></a></h3>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3Variables</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">var</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the value of a property of a server or channel when using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a></p>
<p>Not all properties are available as integer. Some are only available as string or unsigned 64 bit integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var</strong> pointer to a TS3Variables struct obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a57d50ad9f5b070e63d7c1a02b5c8781e"><span class="std std-ref">ts3server_getVirtualServerCreationParamsVariables</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a9377f425b1bba45358cd97c579dc9512"><span class="std std-ref">ts3server_getChannelCreationParamsVariables</span></a></p></li>
<li><p><strong>flag</strong> specifies which variable to receive the value of. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set for the variable. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3Variables</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">var</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the value of a property of a server or channel when using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a></p>
<p>Not all properties are available as unsigned 64 bit integer. Some are only available as string or integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var</strong> pointer to a TS3Variables struct obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a57d50ad9f5b070e63d7c1a02b5c8781e"><span class="std std-ref">ts3server_getVirtualServerCreationParamsVariables</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a9377f425b1bba45358cd97c579dc9512"><span class="std std-ref">ts3server_getChannelCreationParamsVariables</span></a></p></li>
<li><p><strong>flag</strong> specifies which variable to receive the value of. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set for the variable. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setVariableAsString</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3Variables</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">var</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the value of a property of a server or channel when using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a></p>
<p>Not all properties are available as string. Some are only available as unsigned 64 bit integer or integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var</strong> pointer to a TS3Variables struct obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a57d50ad9f5b070e63d7c1a02b5c8781e"><span class="std std-ref">ts3server_getVirtualServerCreationParamsVariables</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a9377f425b1bba45358cd97c579dc9512"><span class="std std-ref">ts3server_getChannelCreationParamsVariables</span></a></p></li>
<li><p><strong>flag</strong> specifies which variable to receive the value of. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>value</strong> utf8 encoded c string containing the value to set the variable to </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="example">
<h3>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h3>
<p>The following will set the virtual server name of the server to be created later to <em>“My Server”</em></p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setVariableAsString</span><span class="p">(</span><span class="n">vars</span><span class="p">,</span><span class="w"> </span><span class="n">VIRTUALSERVER_NAME</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;My Server&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed to set virtual server name: %d</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">error</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
</section>
</section>
<section id="initialize-the-channel-tree">
<h2>Initialize the channel tree<a class="headerlink" href="#initialize-the-channel-tree" title="Link to this heading"></a></h2>
<p>After setting global virtual server parameters we are ready to
initialize the channel tree.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The number of created channels must match exactly the previously
defined <code class="docutils literal notranslate"><span class="pre">channelCount</span></code> in <a class="reference internal" href="#c.ts3server_setVirtualServerCreationParams" title="ts3server_setVirtualServerCreationParams"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVirtualServerCreationParams()</span></code></a>.</p>
</div>
<p>For each channel you need to get a <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3ChannelCreationParams</span></code> and fill it
with the desired channel parameters, including the channel ID.</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVirtualServerCreationParamsChannelCreationParams</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3VirtualServerCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">virtualServerCreationParams</span></span>, <span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">channelIdx</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3ChannelCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Used to specify channels to create during advanced server creation using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a>. </p>
<p>Call this function exactly as often as you indicated channels to be created in the <a class="reference internal" href="../server_api.html#serverlib_8h_1a61075aae119c7d5f16c7601512bbf48e"><span class="std std-ref">ts3server_setVirtualServerCreationParams</span></a> call. Once you have received the struct you must set the details using <a class="reference internal" href="../server_api.html#serverlib_8h_1aa902981e442f7f3eba09518e70b19268"><span class="std std-ref">ts3server_setChannelCreationParams</span></a> and can optionally set additional parameters using <a class="reference internal" href="../server_api.html#serverlib_8h_1a9377f425b1bba45358cd97c579dc9512"><span class="std std-ref">ts3server_getChannelCreationParamsVariables</span></a> to get a structure to fill using <a class="reference internal" href="../server_api.html#serverlib_8h_1a08ad40944701d279e0d417f30bebb035"><span class="std std-ref">ts3server_setVariableAsInt</span></a>, <a class="reference internal" href="../server_api.html#serverlib_8h_1a1b584647b5c91c42707494ab631c9213"><span class="std std-ref">ts3server_setVariableAsString</span></a>, <a class="reference internal" href="../server_api.html#serverlib_8h_1ad3245ab7544e8444f76156f35575e84d"><span class="std std-ref">ts3server_setVariableAsUInt64</span></a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>virtualServerCreationParams</strong> pointer to the server structure on which to create this channel. Obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a721abc40a3ce104064cce4448c455ca4"><span class="std std-ref">ts3server_makeVirtualServerCreationParams</span></a></p></li>
<li><p><strong>channelIdx</strong> specifies the channel to specify creation parameters for. Must be &gt; 0 and &lt; the channelCount parameter specified in the <a class="reference internal" href="../server_api.html#serverlib_8h_1a61075aae119c7d5f16c7601512bbf48e"><span class="std std-ref">ts3server_setVirtualServerCreationParams</span></a> call </p></li>
<li><p><strong>result</strong> address of a variable to receive a pointer that is to be filled using <a class="reference internal" href="../server_api.html#serverlib_8h_1aa902981e442f7f3eba09518e70b19268"><span class="std std-ref">ts3server_setChannelCreationParams</span></a>. Must not be freed by caller. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>These structures are used by the server library and must remain valid
for the life time of the virtual server we are creating.
Do not free or dispose of these structures.</p>
</div>
<section id="set-essential-channel-properties">
<h3>Set essential channel properties<a class="headerlink" href="#set-essential-channel-properties" title="Link to this heading"></a></h3>
<p>Once we have a <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3ChannelCreationParams</span></code> pointer for this channel, we can
start to fill it in two steps. Step 1 is setting the essential data,
step 2 is setting optional additional data.</p>
<p>Essential parameters are channel parent ID and channel ID, which define where the
channel will exist. Set them using</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setChannelCreationParams</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3ChannelCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">channelCreationParams</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelParentID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Specify mandatory details of a channel to be created at server creation using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a>. </p>
<p>Must be called after <a class="reference internal" href="../server_api.html#serverlib_8h_1a43b890922f8f205e9b725e79c104abd2"><span class="std std-ref">ts3server_getVirtualServerCreationParamsChannelCreationParams</span></a> to set basic properties of a channel. After this call you may set additional channel properties by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a9377f425b1bba45358cd97c579dc9512"><span class="std std-ref">ts3server_getChannelCreationParamsVariables</span></a> and <a class="reference internal" href="../server_api.html#serverlib_8h_1a08ad40944701d279e0d417f30bebb035"><span class="std std-ref">ts3server_setVariableAsInt</span></a>, <a class="reference internal" href="../server_api.html#serverlib_8h_1ad3245ab7544e8444f76156f35575e84d"><span class="std std-ref">ts3server_setVariableAsUInt64</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a1b584647b5c91c42707494ab631c9213"><span class="std std-ref">ts3server_setVariableAsString</span></a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>channelCreationParams</strong> defines the channel for which we set basic properties. Obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a43b890922f8f205e9b725e79c104abd2"><span class="std std-ref">ts3server_getVirtualServerCreationParamsChannelCreationParams</span></a></p></li>
<li><p><strong>channelParentID</strong> the id of the channel that this channel is a sub channel of. Pass 0 to make this channel a root channel. </p></li>
<li><p><strong>channelID</strong> the id this channel should have. Pass 0 to have the server lib assign a free ID. This is used to identify the channel in other calls to the client and server library. Must be unique across all virtual servers during the lifetime of the server library. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="set-and-query-optional-channel-properties">
<h3>Set and query optional channel properties<a class="headerlink" href="#set-and-query-optional-channel-properties" title="Link to this heading"></a></h3>
<p>After setting the essential parameters, we can set optional parameters in a similar way
as we did for the virtual server itself.</p>
<p>Retrieve a <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3Variables</span></code> pointer for this channel using</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelCreationParamsVariables</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3ChannelCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">channelCreationParams</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3Variables</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Allows settings optional channel properties for channels to be created either at server creation using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> or using <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a>. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>channelCreationParams</strong> defines which channel to set variables for. Address of the structure obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a43b890922f8f205e9b725e79c104abd2"><span class="std std-ref">ts3server_getVirtualServerCreationParamsChannelCreationParams</span></a> when the channel is to be created at server creation (using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a>) or obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a1eebf07588b2f72c4fe7d77442382e26"><span class="std std-ref">ts3server_makeChannelCreationParams</span></a> when using with <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a></p></li>
<li><p><strong>result</strong> address of a variable to receive a pointer that is to be filled using <a class="reference internal" href="../server_api.html#serverlib_8h_1a08ad40944701d279e0d417f30bebb035"><span class="std std-ref">ts3server_setVariableAsInt</span></a>, <a class="reference internal" href="../server_api.html#serverlib_8h_1ad3245ab7544e8444f76156f35575e84d"><span class="std std-ref">ts3server_setVariableAsUInt64</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a1b584647b5c91c42707494ab631c9213"><span class="std std-ref">ts3server_setVariableAsString</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>Once we have the structure use the previously described functions
<a class="reference internal" href="#c.ts3server_setVariableAsInt" title="ts3server_setVariableAsInt"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVariableAsInt()</span></code></a>, <a class="reference internal" href="#c.ts3server_setVariableAsUInt64" title="ts3server_setVariableAsUInt64"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVariableAsUInt64()</span></code></a> and <a class="reference internal" href="#c.ts3server_setVariableAsString" title="ts3server_setVariableAsString"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVariableAsString()</span></code></a>
to modify the properties. You can use <a class="reference internal" href="#c.ts3server_getVariableAsInt" title="ts3server_getVariableAsInt"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_getVariableAsInt()</span></code></a>, <a class="reference internal" href="#c.ts3server_getVariableAsUInt64" title="ts3server_getVariableAsUInt64"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_getVariableAsUInt64()</span></code></a> and
<a class="reference internal" href="#c.ts3server_getVariableAsString" title="ts3server_getVariableAsString"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_getVariableAsString()</span></code></a> to query current properties for the channel.</p>
</section>
</section>
<section id="create-the-virtual-server-and-channels">
<h2>Create the virtual server and channels<a class="headerlink" href="#create-the-virtual-server-and-channels" title="Link to this heading"></a></h2>
<p>Once we have defined the virtual server, and set up all the channels needed as described before,
we can finally go ahead and actually create the virtual server and all the channels as specified using</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_createVirtualServer2</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3VirtualServerCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">virtualServerCreationParams</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../server_api.html#c.VirtualServerCreateFlags" title="VirtualServerCreateFlags"><span class="n"><span class="pre">VirtualServerCreateFlags</span></span></a><span class="w"> </span><span class="n"><span class="pre">flags</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Create an entire server structure in a single call. Useful for restoring an entire virtual server including channels including their ids after storing them on shutdown. See the SDK documentation for more in depth information. </p>
<p>This requires a few other calls to be made in advance. First you need to call <a class="reference internal" href="../server_api.html#serverlib_8h_1a721abc40a3ce104064cce4448c455ca4"><span class="std std-ref">ts3server_makeVirtualServerCreationParams</span></a> to get a TS3VirtualServerCreationParams struct that then needs to be filled via <a class="reference internal" href="../server_api.html#serverlib_8h_1a61075aae119c7d5f16c7601512bbf48e"><span class="std std-ref">ts3server_setVirtualServerCreationParams</span></a>. You can then use <a class="reference internal" href="../server_api.html#serverlib_8h_1a57d50ad9f5b070e63d7c1a02b5c8781e"><span class="std std-ref">ts3server_getVirtualServerCreationParamsVariables</span></a> to set other server settings and use <a class="reference internal" href="../server_api.html#serverlib_8h_1a43b890922f8f205e9b725e79c104abd2"><span class="std std-ref">ts3server_getVirtualServerCreationParamsChannelCreationParams</span></a> to specify channels to create using <a class="reference internal" href="../server_api.html#serverlib_8h_1aa902981e442f7f3eba09518e70b19268"><span class="std std-ref">ts3server_setChannelCreationParams</span></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>virtualServerCreationParams</strong> pointer to the server parameters obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a721abc40a3ce104064cce4448c455ca4"><span class="std std-ref">ts3server_makeVirtualServerCreationParams</span></a>. These must have been filled using <a class="reference internal" href="../server_api.html#serverlib_8h_1a61075aae119c7d5f16c7601512bbf48e"><span class="std std-ref">ts3server_setVirtualServerCreationParams</span></a> before calling this function. </p></li>
<li><p><strong>flags</strong> defines how certain information is present in the virtualServerCreationParams. Combination of the values from the <a class="reference internal" href="../server_api.html#serverlib_8h_1a065f4f9ad6e60befd2020b457e0f113e"><span class="std std-ref">VirtualServerCreateFlags</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the created servers id. This is used in other calls to the server library to identify this server. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Before this function is called, neither the server nor any of the channels
actually exist anywhere. We merely described how they should look like and
where the channels are.
You cannot use any functions that require things to actually exist before
this function was successfully called</p>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="vserver-manage.html" class="btn btn-neutral float-left" title="Create and stop virtual servers" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="info.html" class="btn btn-neutral float-right" title="Retrieve and store information" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,420 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Getting started &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="List available clients, channels, servers" href="list-items.html" />
<link rel="prev" title="Introduction" href="intro.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Getting started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#the-callback-mechanism">The callback mechanism</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#a-callback-example-in-c">A callback example in C:</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#initializing">Initializing</a></li>
<li class="toctree-l2"><a class="reference internal" href="#querying-the-library-version">Querying the library version</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#shutting-down">Shutting down</a></li>
<li class="toctree-l2"><a class="reference internal" href="#error-handling">Error handling</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#examples">Examples</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Getting started</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="getting-started">
<h1>Getting started<a class="headerlink" href="#getting-started" title="Link to this heading"></a></h1>
<section id="the-callback-mechanism">
<h2>The callback mechanism<a class="headerlink" href="#the-callback-mechanism" title="Link to this heading"></a></h2>
<p>The communication from the Server Lib to the server application takes
place using callbacks. The server application has to define a
series of function pointers using the <a class="reference internal" href="encryption.html#c.ServerLibFunctions" title="ServerLibFunctions"><code class="xref c c-struct docutils literal notranslate"><span class="pre">ServerLibFunctions</span></code></a> struct.
These callbacks are used to let the server application
hook into the library and receive notifications on certain actions.</p>
<section id="a-callback-example-in-c">
<h3>A callback example in C:<a class="headerlink" href="#a-callback-example-in-c" title="Link to this heading"></a></h3>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">my_onClientConnected_callback</span><span class="p">(</span><span class="n">uint64</span><span class="w"> </span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">anyID</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">uint64</span><span class="w"> </span><span class="n">channelID</span><span class="p">,</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="o">*</span><span class="w"> </span><span class="n">removeClientError</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Client %u connected on virtual server %u joining channel %u&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">channelID</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>C++ developers can also use static member functions for the callbacks.</p>
<p>Before calling <a class="reference internal" href="#c.ts3server_initServerLib" title="ts3server_initServerLib"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_initServerLib()</span></code></a>, create an instance of <a class="reference internal" href="encryption.html#c.ServerLibFunctions" title="ServerLibFunctions"><code class="xref c c-struct docutils literal notranslate"><span class="pre">ServerLibFunctions</span></code></a>
, initialize all function pointers with NULL and point
the structs function pointers to your implemented callback functions:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">;</span>
<span class="linenos"> 2</span>
<span class="linenos"> 3</span><span class="cm">/* Create struct */</span>
<span class="linenos"> 4</span><span class="n">ServerLibFunctions</span><span class="w"> </span><span class="n">slFuncs</span><span class="p">;</span>
<span class="linenos"> 5</span>
<span class="linenos"> 6</span><span class="cm">/* Initialize all function pointers with NULL */</span>
<span class="linenos"> 7</span><span class="n">memset</span><span class="p">(</span><span class="o">&amp;</span><span class="n">slFuncs</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="k">sizeof</span><span class="p">(</span><span class="k">struct</span><span class="w"> </span><span class="nc">ServerLibFunctions</span><span class="p">));</span>
<span class="linenos"> 8</span>
<span class="linenos"> 9</span><span class="cm">/* Assign those function pointers you implemented */</span>
<span class="linenos">10</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onVoiceDataEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onVoiceDataEvent_callback</span><span class="p">;</span>
<span class="linenos">11</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onClientStartTalkingEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onClientStartTalkingEvent_callback</span><span class="p">;</span>
<span class="linenos">12</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onClientStopTalkingEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onClientStopTalkingEvent_callback</span><span class="p">;</span>
<span class="linenos">13</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onClientConnected</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onClientConnected_callback</span><span class="p">;</span>
<span class="linenos">14</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onClientDisconnected</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onClientDisconnected_callback</span><span class="p">;</span>
<span class="linenos">15</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onClientMoved</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onClientMoved_callback</span><span class="p">;</span>
<span class="linenos">16</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onChannelCreated</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onChannelCreated_callback</span><span class="p">;</span>
<span class="linenos">17</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onChannelEdited</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onChannelEdited_callback</span><span class="p">;</span>
<span class="linenos">18</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onChannelDeleted</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onChannelDeleted_callback</span><span class="p">;</span>
<span class="linenos">19</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onServerTextMessageEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onServerTextMessageEvent_callback</span><span class="p">;</span>
<span class="linenos">20</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onChannelTextMessageEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onChannelTextMessageEvent_callback</span><span class="p">;</span>
<span class="linenos">21</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onUserLoggingMessageEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onUserLoggingMessageEvent_callback</span><span class="p">;</span>
<span class="linenos">22</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onAccountingErrorEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_onAccountingErrorEvent_callback</span><span class="p">;</span>
<span class="linenos">23</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onCustomPacketEncryptEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"> </span><span class="c1">// Not used by your application</span>
<span class="linenos">24</span><span class="n">slFuncs</span><span class="p">.</span><span class="n">onCustomPacketDecryptEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"> </span><span class="c1">// Not used by your application</span>
<span class="linenos">25</span>
<span class="linenos">26</span><span class="cm">/* Initialize library with callback function pointers */</span>
<span class="linenos">27</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3server_initServerLib</span><span class="p">(</span><span class="o">&amp;</span><span class="n">slFuncs</span><span class="p">,</span><span class="w"> </span><span class="n">LogType_FILE</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">LogType_CONSOLE</span><span class="p">);</span>
<span class="linenos">28</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">error</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">29</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error initializing serverlib: %d</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">error</span><span class="p">);</span>
<span class="linenos">30</span><span class="w"> </span><span class="p">(...)</span>
<span class="linenos">31</span><span class="p">}</span>
</pre></div>
</div>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>As long as you initialize unimplemented callbacks with NULL, the
Server Lib wont attempt to call those function pointers. However, if
you leave unimplemented callbacks undefined, the Server Lib will attempt to call
them, crashing the application.</p>
</div>
<p>The individual callbacks are described in <a class="reference internal" href="encryption.html#c.ServerLibFunctions" title="ServerLibFunctions"><code class="xref c c-struct docutils literal notranslate"><span class="pre">ServerLibFunctions</span></code></a>.</p>
</section>
</section>
<section id="initializing">
<h2>Initializing<a class="headerlink" href="#initializing" title="Link to this heading"></a></h2>
<p>When starting the server application, initialize the Server Lib with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_initServerLib</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="encryption.html#c.ServerLibFunctions" title="ServerLibFunctions"><span class="n"><span class="pre">ServerLibFunctions</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">functionPointers</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">usedLogTypes</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">logFileFolder</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">argc</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">argv</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>initializes the server library and defines callback functions </p>
<p>This is the first function you need to call, before this all calls to the server library will fail. In this call you will also set the functions you would like to have called when certain changes or events happen. This function must not be called multiple times.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>functionPointers</strong> defines which functions in your code are to be called on specific events. Zero initialize it and assign the desired function to call to the respective members of the <a class="reference internal" href="../server_api.html#struct_server_lib_functions"><span class="std std-ref">ServerLibFunctions</span></a> struct </p></li>
<li><p><strong>usedLogTypes</strong> a combination of values from the <a class="reference internal" href="../enumerations.html#logtypes_8h_1a0e4c244f5254ca12ffeadcaf83e225b4"><span class="std std-ref">LogTypes</span></a> enum. Specifies which type(s) of logging you would like to use. </p></li>
<li><p><strong>logFileFolder</strong> path in which to create log files. Pass 0 to use the default of using a folder called logs in the working directory. </p></li>
<li><p><strong>argc</strong> The number of arguments provided to the application in argv. Used to process command line arguments </p></li>
<li><p><strong>argv</strong> The command line arguments provided to the application. These will be processed prior to server lib initialization. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>This function must not be called more than once.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Logging to console can slow down the application on Windows. Hence
we do not recommend to log to the console on Windows other than in
debug builds.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>During initialization the serverlib will attempt to connect to the
TeamSpeak licensing server. This function may block if the licensing
server is unreachable.</p>
</div>
</section>
<section id="querying-the-library-version">
<h2>Querying the library version<a class="headerlink" href="#querying-the-library-version" title="Link to this heading"></a></h2>
<p>The Server Lib version can be queried with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getServerLibVersion</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Retrieve the server version string. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>result</strong> address of a variable to receive the server version. Memory is allocated by the server library and must be freed by caller using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>To get only the version number, which is a part of the complete version
string, as numeric value use</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getServerLibVersionNumber</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Retrieve the server version number. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>result</strong> address of a variable to receive the server version number. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="example">
<h3>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h3>
<p>Query the Server Lib version:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">;</span>
<span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">version</span><span class="p">;</span>
<span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3server_getServerLibVersion</span><span class="p">(</span><span class="o">&amp;</span><span class="n">version</span><span class="p">);</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">error</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error querying serverlib version: %d</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">error</span><span class="p">);</span>
<span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">printf</span><span class="p">(</span><span class="s">&quot;Server library version: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">version</span><span class="p">);</span><span class="w"> </span><span class="cm">/* Print version */</span>
<span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">version</span><span class="p">);</span><span class="w"> </span><span class="cm">/* Release string */</span>
</pre></div>
</div>
</section>
</section>
<section id="shutting-down">
<h2>Shutting down<a class="headerlink" href="#shutting-down" title="Link to this heading"></a></h2>
<p>Before exiting the application, the Server Lib should be shut down using</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_destroyServerLib</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><br /></dt>
<dd><p>Destroys the server lib. Must not be called from within a callback. </p>
<p>All clients will lose connection and timeout, all servers will terminate. This is the last function to call. After this call you will no longer be able to use any server library functions.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>Any call to Server Lib functions after shutting down has undefined
results.</p>
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p>Never destroy the Server Lib from within a callback function. This
might result in a segmentation fault.</p>
</div>
</section>
<section id="error-handling">
<h2>Error handling<a class="headerlink" href="#error-handling" title="Link to this heading"></a></h2>
<p>Each Server Lib function returns either <a class="reference internal" href="../errors.html#c.Ts3ErrorType.ERROR_ok" title="ERROR_ok"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_ok</span></code></a> on success or an error
value as defined in the <a class="reference internal" href="../errors.html#c.Ts3ErrorType" title="Ts3ErrorType"><code class="xref c c-enum docutils literal notranslate"><span class="pre">Ts3ErrorType</span></code></a> enum if the function fails.</p>
<p>The returned error codes are organized in groups, where the first byte
defines the error group and the second the count within the group: The
naming convention is ERROR_&lt;group&gt;_&lt;error&gt;, for example
ERROR_client_invalid_id.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Result variables should <strong>only</strong> be accessed if the function returned
<a class="reference internal" href="../errors.html#c.Ts3ErrorType.ERROR_ok" title="ERROR_ok"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_ok</span></code></a>. Otherwise the state of the result variable is undefined.</p>
</div>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Some Server Lib functions dynamically allocate memory which has to be
freed by the caller using <a class="reference internal" href="../server_api.html#c.ts3server_freeMemory" title="ts3server_freeMemory"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_freeMemory()</span></code></a>.
It is important to <strong>only</strong> access and release the memory if the
function returned <a class="reference internal" href="../errors.html#c.Ts3ErrorType.ERROR_ok" title="ERROR_ok"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_ok</span></code></a>. Should the function return an error, the
result variable is uninitialized, so freeing or accessing it will
likely result in a segmentation fault.</p>
</div>
<p>See the section <a class="reference internal" href="intro.html#s-calling"><span class="std std-ref">Calling Server Lib functions</span></a> for
additional notes and examples.</p>
<p>A printable error string for a specific error code can be queried with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getGlobalErrorMessage</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">globalErrorCode</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get a human readable error description string for an error code </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>globalErrorCode</strong> the error code to retrieve the description for. One of the values from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum. </p></li>
<li><p><strong>result</strong> address of a variable to receive the error description as a utf8 encoded c string. Memory is allocated by the server library and must be freed by caller using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="examples">
<h3>Examples<a class="headerlink" href="#examples" title="Link to this heading"></a></h3>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">;</span>
<span class="linenos"> 2</span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">welcomeMsg</span><span class="p">;</span>
<span class="linenos"> 3</span>
<span class="linenos"> 4</span><span class="cm">/* welcomeMsg memory is allocated if error is ERROR_ok */</span>
<span class="linenos"> 5</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3server_getVirtualServerVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">VIRTUALSERVER_WELCOMEMESSAGE</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">welcomeMsg</span><span class="p">);</span>
<span class="linenos"> 6</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">error</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 7</span><span class="w"> </span><span class="cm">/* Handle error */</span>
<span class="linenos"> 8</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos"> 9</span><span class="p">}</span>
<span class="linenos">10</span><span class="cm">/* Use welcomeMsg... */</span>
<span class="linenos">11</span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">welcomeMsg</span><span class="p">);</span><span class="w"> </span><span class="cm">/* Release memory *only* if function did not return an error */</span>
</pre></div>
</div>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">;</span>
<span class="linenos"> 2</span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">version</span><span class="p">;</span>
<span class="linenos"> 3</span>
<span class="linenos"> 4</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3server_getServerLibVersion</span><span class="p">(</span><span class="o">&amp;</span><span class="n">version</span><span class="p">);</span><span class="w"> </span><span class="cm">/* Calling some Server Lib function */</span>
<span class="linenos"> 5</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">error</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">errorMsg</span><span class="p">;</span>
<span class="linenos"> 7</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_getGlobalErrorMessage</span><span class="p">(</span><span class="n">error</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">errorMsg</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="cm">/* Query printable error */</span>
<span class="linenos"> 8</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error querying client ID: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">errorMsg</span><span class="p">);</span>
<span class="linenos"> 9</span><span class="w"> </span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">errorMsg</span><span class="p">);</span><span class="w"> </span><span class="cm">/* Release memory only if function succeeded */</span>
<span class="linenos">10</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">11</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="intro.html" class="btn btn-neutral float-left" title="Introduction" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="list-items.html" class="btn btn-neutral float-right" title="List available clients, channels, servers" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,283 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Advanced channel creation &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Moving channels" href="channel-move.html" />
<link rel="prev" title="Creating a new channel" href="channel-create.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="channels.html">Managing channels</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="channel-list.html">List channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create.html">Creating a new channel</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Advanced channel creation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#obtain-a-channel-creation-structure">Obtain a channel creation structure</a></li>
<li class="toctree-l3"><a class="reference internal" href="#setting-basic-channel-properties">Setting basic channel properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="#setting-additional-channel-properties">Setting additional channel properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="#actually-create-the-channel">Actually create the channel</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="channel-move.html">Moving channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-delete.html">Deleting channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="channels.html">Managing channels</a></li>
<li class="breadcrumb-item active">Advanced channel creation</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="advanced-channel-creation">
<h1>Advanced channel creation<a class="headerlink" href="#advanced-channel-creation" title="Link to this heading"></a></h1>
<p>There is an alternative API available for channel creation, similar to the <a class="reference internal" href="advanced-create.html#s-server-create-advanced"><span class="std std-ref">alternative virtual server creation
API</span></a>. The idea is to create a
<code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3ChannelCreationParams</span></code> structure, query the attached <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3Variables</span></code> structure, fill
it with desired parameters and finally call <a class="reference internal" href="#c.ts3server_createChannel" title="ts3server_createChannel"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_createChannel()</span></code></a>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>For a complete example please see the “server_creation_params” sample
code in the SDK package.</p>
</div>
<section id="obtain-a-channel-creation-structure">
<h2>Obtain a channel creation structure<a class="headerlink" href="#obtain-a-channel-creation-structure" title="Link to this heading"></a></h2>
<p>First we need to create a <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3ChannelCreationParams</span></code> struct using</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_makeChannelCreationParams</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3ChannelCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Create a structure that defines channel properties for use with <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a>. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>result</strong> address of a variable to receive a pointer to the structure. Pointer must not be freed! After receiving the structure pointer, it must be filled using <a class="reference internal" href="../server_api.html#serverlib_8h_1aa902981e442f7f3eba09518e70b19268"><span class="std std-ref">ts3server_setChannelCreationParams</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Do not free or dispose of the structure, it must be valid as long
as the channel exists.
The server lib will take care of cleaning up the structure at an
appropriate time.</p>
</div>
<p>Once we have a <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3ChannelCreationParams</span></code> struct for this channel, we can
start to fill it in two steps. Step 1 is setting the essential data,
step 2 is setting additional data.</p>
</section>
<section id="setting-basic-channel-properties">
<h2>Setting basic channel properties<a class="headerlink" href="#setting-basic-channel-properties" title="Link to this heading"></a></h2>
<p>Essential parameters are channel parent ID and channel ID. These are specified using</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setChannelCreationParams</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3ChannelCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">channelCreationParams</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelParentID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Specify mandatory details of a channel to be created at server creation using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a>. </p>
<p>Must be called after <a class="reference internal" href="../server_api.html#serverlib_8h_1a43b890922f8f205e9b725e79c104abd2"><span class="std std-ref">ts3server_getVirtualServerCreationParamsChannelCreationParams</span></a> to set basic properties of a channel. After this call you may set additional channel properties by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a9377f425b1bba45358cd97c579dc9512"><span class="std std-ref">ts3server_getChannelCreationParamsVariables</span></a> and <a class="reference internal" href="../server_api.html#serverlib_8h_1a08ad40944701d279e0d417f30bebb035"><span class="std std-ref">ts3server_setVariableAsInt</span></a>, <a class="reference internal" href="../server_api.html#serverlib_8h_1ad3245ab7544e8444f76156f35575e84d"><span class="std std-ref">ts3server_setVariableAsUInt64</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a1b584647b5c91c42707494ab631c9213"><span class="std std-ref">ts3server_setVariableAsString</span></a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>channelCreationParams</strong> defines the channel for which we set basic properties. Obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a43b890922f8f205e9b725e79c104abd2"><span class="std std-ref">ts3server_getVirtualServerCreationParamsChannelCreationParams</span></a></p></li>
<li><p><strong>channelParentID</strong> the id of the channel that this channel is a sub channel of. Pass 0 to make this channel a root channel. </p></li>
<li><p><strong>channelID</strong> the id this channel should have. Pass 0 to have the server lib assign a free ID. This is used to identify the channel in other calls to the client and server library. Must be unique across all virtual servers during the lifetime of the server library. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="setting-additional-channel-properties">
<h2>Setting additional channel properties<a class="headerlink" href="#setting-additional-channel-properties" title="Link to this heading"></a></h2>
<p>After setting the essential parameters, we can set additional
channel parameters.</p>
<p>To do so we first need to retrieve the <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3Variables</span></code> for this channel and
fill it.</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelCreationParamsVariables</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3ChannelCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">channelCreationParams</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3Variables</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Allows settings optional channel properties for channels to be created either at server creation using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> or using <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a>. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>channelCreationParams</strong> defines which channel to set variables for. Address of the structure obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a43b890922f8f205e9b725e79c104abd2"><span class="std std-ref">ts3server_getVirtualServerCreationParamsChannelCreationParams</span></a> when the channel is to be created at server creation (using <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a>) or obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a1eebf07588b2f72c4fe7d77442382e26"><span class="std std-ref">ts3server_makeChannelCreationParams</span></a> when using with <a class="reference internal" href="../server_api.html#serverlib_8h_1a04c949dd9f95b3d4a56bf843fcf826ba"><span class="std std-ref">ts3server_createChannel</span></a></p></li>
<li><p><strong>result</strong> address of a variable to receive a pointer that is to be filled using <a class="reference internal" href="../server_api.html#serverlib_8h_1a08ad40944701d279e0d417f30bebb035"><span class="std std-ref">ts3server_setVariableAsInt</span></a>, <a class="reference internal" href="../server_api.html#serverlib_8h_1ad3245ab7544e8444f76156f35575e84d"><span class="std std-ref">ts3server_setVariableAsUInt64</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a1b584647b5c91c42707494ab631c9213"><span class="std std-ref">ts3server_setVariableAsString</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>Once we have the <code class="xref c c-struct docutils literal notranslate"><span class="pre">TS3Variables</span></code> we can set them by calling <a class="reference internal" href="advanced-create.html#c.ts3server_setVariableAsInt" title="ts3server_setVariableAsInt"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVariableAsInt()</span></code></a>,
<a class="reference internal" href="advanced-create.html#c.ts3server_setVariableAsUInt64" title="ts3server_setVariableAsUInt64"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVariableAsUInt64()</span></code></a> or <a class="reference internal" href="advanced-create.html#c.ts3server_setVariableAsString" title="ts3server_setVariableAsString"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setVariableAsString()</span></code></a>.
You can also get the current value using <a class="reference internal" href="advanced-create.html#c.ts3server_getVariableAsInt" title="ts3server_getVariableAsInt"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_getVariableAsInt()</span></code></a>, <a class="reference internal" href="advanced-create.html#c.ts3server_getVariableAsUInt64" title="ts3server_getVariableAsUInt64"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_getVariableAsUInt64()</span></code></a>
and <a class="reference internal" href="advanced-create.html#c.ts3server_getVariableAsString" title="ts3server_getVariableAsString"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_getVariableAsString()</span></code></a>.</p>
</section>
<section id="actually-create-the-channel">
<h2>Actually create the channel<a class="headerlink" href="#actually-create-the-channel" title="Link to this heading"></a></h2>
<p>Finally, after setting up channel parameters, create the channel in one
step with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_createChannel</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">TS3ChannelCreationParams</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">channelCreationParams</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../server_api.html#c.ChannelCreateFlags" title="ChannelCreateFlags"><span class="n"><span class="pre">ChannelCreateFlags</span></span></a><span class="w"> </span><span class="n"><span class="pre">flags</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>create a new channel on an existing virtual server. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which to create the channel. </p></li>
<li><p><strong>channelCreationParams</strong> defines channel properties. Address of the structure obtained by calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a1eebf07588b2f72c4fe7d77442382e26"><span class="std std-ref">ts3server_makeChannelCreationParams</span></a> Must have been filled using <a class="reference internal" href="../server_api.html#serverlib_8h_1aa902981e442f7f3eba09518e70b19268"><span class="std std-ref">ts3server_setChannelCreationParams</span></a> before this call. </p></li>
<li><p><strong>flags</strong> defines how certain information is presented in the channelCreationParams. Combination of the values from the <a class="reference internal" href="../server_api.html#serverlib_8h_1a8c51f552b923268b6fb5d67e95c39f78"><span class="std std-ref">ChannelCreateFlags</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the channel id of the newly created channel. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="channel-create.html" class="btn btn-neutral float-left" title="Creating a new channel" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="channel-move.html" class="btn btn-neutral float-right" title="Moving channels" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,295 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Creating a new channel &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Advanced channel creation" href="channel-create-adv.html" />
<link rel="prev" title="List channels" href="channel-list.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="channels.html">Managing channels</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="channel-list.html">List channels</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Creating a new channel</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#actually-create-the-channel">Actually create the channel</a></li>
<li class="toctree-l3"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="channel-create-adv.html">Advanced channel creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-move.html">Moving channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-delete.html">Deleting channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="channels.html">Managing channels</a></li>
<li class="breadcrumb-item active">Creating a new channel</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="creating-a-new-channel">
<h1>Creating a new channel<a class="headerlink" href="#creating-a-new-channel" title="Link to this heading"></a></h1>
<p>Creating a channel is done in a similar fashion as editing a channel.</p>
<p>First you set all the properties of the channel on channel ID 0 which
will indicate that you intend to create a new channel.
Use the appropriate function for the property you are setting:</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setChannelVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><span class="n"><span class="pre">ChannelProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the variable of a channel to a new value. </p>
<p>Call <a class="reference internal" href="../server_api.html#serverlib_8h_1ac4eb0eaedc70cfef1d3ceccfebcfd971"><span class="std std-ref">ts3server_flushChannelVariable</span></a> after having set all variables you need to change.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the channel is located on </p></li>
<li><p><strong>channelID</strong> specifies the channel on which to change the variable </p></li>
<li><p><strong>flag</strong> specifies which variable to change. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1ab1d8599705a3a954dc5dce71774488fc"><span class="std std-ref">ChannelProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setChannelVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><span class="n"><span class="pre">ChannelProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set a channel variable </p>
<p>Call <a class="reference internal" href="../server_api.html#serverlib_8h_1ac4eb0eaedc70cfef1d3ceccfebcfd971"><span class="std std-ref">ts3server_flushChannelVariable</span></a> after having set all variables you need to change.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the id of the channel to set the variable for </p></li>
<li><p><strong>flag</strong> specifies which variable to set. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1ab1d8599705a3a954dc5dce71774488fc"><span class="std std-ref">ChannelProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setChannelVariableAsString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><span class="n"><span class="pre">ChannelProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Call <a class="reference internal" href="../server_api.html#serverlib_8h_1ac4eb0eaedc70cfef1d3ceccfebcfd971"><span class="std std-ref">ts3server_flushChannelVariable</span></a> after having set all variables you need to change. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the id of the channel to set the variable for </p></li>
<li><p><strong>flag</strong> specifies which variable to set. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1ab1d8599705a3a954dc5dce71774488fc"><span class="std std-ref">ChannelProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="actually-create-the-channel">
<h2>Actually create the channel<a class="headerlink" href="#actually-create-the-channel" title="Link to this heading"></a></h2>
<p>To actually create the channel you will then call</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_flushChannelCreation</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelParentID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>After setting the channel properties on a new channel, call this function to publish the channel to clients. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which to create the channel </p></li>
<li><p><strong>channelParentID</strong> the id of the parent channel for the new channel </p></li>
<li><p><strong>result</strong> address of a variable to receive the channel id of the newly created channel </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Once the channel has been created the <a class="reference internal" href="../server_api.html#c.ServerLibFunctions.onChannelCreated" title="ServerLibFunctions.onChannelCreated"><code class="xref c c-func docutils literal notranslate"><span class="pre">ServerLibFunctions.onChannelCreated()</span></code></a> callback is called.</p>
</div>
</section>
<section id="example">
<h2>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h2>
<p>Example code to create a channel:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="cp">#define CHECK_ERROR(x) if ((error = x) != ERROR_ok) { goto on_error; }</span>
<span class="linenos"> 2</span>
<span class="linenos"> 3</span><span class="kt">int</span><span class="w"> </span><span class="nf">createChannel</span><span class="p">(</span><span class="n">uint64</span><span class="w"> </span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">uint64</span><span class="w"> </span><span class="n">parentChannelID</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">name</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">topic</span><span class="p">,</span>
<span class="linenos"> 4</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">description</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">password</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">codec</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">codecQuality</span><span class="p">,</span>
<span class="linenos"> 5</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">maxClients</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">familyMaxClients</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">order</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">perm</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">semiperm</span><span class="p">,</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="k">default</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 7</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">;</span>
<span class="linenos"> 8</span><span class="w"> </span><span class="n">uint64</span><span class="w"> </span><span class="n">newChannelID</span><span class="p">;</span>
<span class="linenos"> 9</span>
<span class="linenos">10</span><span class="w"> </span><span class="cm">/* Set channel data, pass 0 as channel ID */</span>
<span class="linenos">11</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_NAME</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">));</span>
<span class="linenos">12</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_TOPIC</span><span class="p">,</span><span class="w"> </span><span class="n">topic</span><span class="p">));</span>
<span class="linenos">13</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_DESCRIPTION</span><span class="p">,</span><span class="w"> </span><span class="n">description</span><span class="p">));</span>
<span class="linenos">14</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_PASSWORD</span><span class="p">,</span><span class="w"> </span><span class="n">password</span><span class="p">));</span>
<span class="linenos">15</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsInt</span><span class="w"> </span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_CODEC</span><span class="p">,</span><span class="w"> </span><span class="n">codec</span><span class="p">));</span>
<span class="linenos">16</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsInt</span><span class="w"> </span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_CODEC_QUALITY</span><span class="p">,</span><span class="w"> </span><span class="n">codecQuality</span><span class="p">));</span>
<span class="linenos">17</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsInt</span><span class="w"> </span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_MAXCLIENTS</span><span class="p">,</span><span class="w"> </span><span class="n">maxClients</span><span class="p">));</span>
<span class="linenos">18</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsInt</span><span class="w"> </span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_MAXFAMILYCLIENTS</span><span class="p">,</span><span class="w"> </span><span class="n">familyMaxClients</span><span class="p">));</span>
<span class="linenos">19</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsInt</span><span class="w"> </span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_ORDER</span><span class="p">,</span><span class="w"> </span><span class="n">order</span><span class="p">));</span>
<span class="linenos">20</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsInt</span><span class="w"> </span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_FLAG_PERMANENT</span><span class="p">,</span><span class="w"> </span><span class="n">perm</span><span class="p">));</span>
<span class="linenos">21</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsInt</span><span class="w"> </span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_FLAG_SEMI_PERMANENT</span><span class="p">,</span><span class="w"> </span><span class="n">semiperm</span><span class="p">));</span>
<span class="linenos">22</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsInt</span><span class="w"> </span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_FLAG_DEFAULT</span><span class="p">,</span><span class="w"> </span><span class="k">default</span><span class="p">));</span>
<span class="linenos">23</span>
<span class="linenos">24</span><span class="w"> </span><span class="cm">/* Flush changes to server */</span>
<span class="linenos">25</span><span class="w"> </span><span class="n">CHECK_ERROR</span><span class="p">(</span><span class="n">ts3server_flushChannelCreation</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">parentChannelID</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">newChannelID</span><span class="p">));</span>
<span class="linenos">26</span>
<span class="linenos">27</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Created new channel with ID: %u</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">newChannelID</span><span class="p">);</span>
<span class="linenos">28</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Success */</span>
<span class="linenos">29</span>
<span class="linenos">30</span><span class="nl">on_error</span><span class="p">:</span>
<span class="linenos">31</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error creating channel: %d</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">error</span><span class="p">);</span>
<span class="linenos">32</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Failure */</span>
<span class="linenos">33</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="channel-list.html" class="btn btn-neutral float-left" title="List channels" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="channel-create-adv.html" class="btn btn-neutral float-right" title="Advanced channel creation" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,195 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Deleting channels &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Managing clients" href="clients.html" />
<link rel="prev" title="Moving channels" href="channel-move.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="channels.html">Managing channels</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="channel-list.html">List channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create.html">Creating a new channel</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create-adv.html">Advanced channel creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-move.html">Moving channels</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Deleting channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="channels.html">Managing channels</a></li>
<li class="breadcrumb-item active">Deleting channels</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="deleting-channels">
<h1>Deleting channels<a class="headerlink" href="#deleting-channels" title="Link to this heading"></a></h1>
<p>A channel can be deleted by the server by calling</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_channelDelete</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">force</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>delete a channel </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the id of the channel to delete </p></li>
<li><p><strong>force</strong> boolean flag, 1 = delete even if there are clients or sub channels in the channel. 0 = fail if there are sub channels or clients in the channel or sub channels. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>After successfully deleting a channel, the <code class="xref c c-func docutils literal notranslate"><span class="pre">ServerLibFuntions.onChannelDeleted()</span></code> callback
is called for every deleted channel.</p>
</div>
<p>When specifying the <cite>force</cite> parameter as 1, all clients in this channel and all the sub channels of this
channel will be kicked out of the channel first. The server will then go ahead and recursively delete all
the sub channels and finally the channel specified.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The call will fail on the first channel that cannot be deleted. However some channels may have been deleted despite that.
Use the <a class="reference internal" href="../server_api.html#c.ServerLibFunctions.onChannelDeleted" title="ServerLibFunctions.onChannelDeleted"><code class="xref c c-func docutils literal notranslate"><span class="pre">ServerLibFunctions.onChannelDeleted()</span></code></a> callback to know which have been deleted.</p>
</div>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="channel-move.html" class="btn btn-neutral float-left" title="Moving channels" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="clients.html" class="btn btn-neutral float-right" title="Managing clients" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,237 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>List channels &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Creating a new channel" href="channel-create.html" />
<link rel="prev" title="Managing channels" href="channels.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="channels.html">Managing channels</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">List channels</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="channel-create.html">Creating a new channel</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create-adv.html">Advanced channel creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-move.html">Moving channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-delete.html">Deleting channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="channels.html">Managing channels</a></li>
<li class="breadcrumb-item active">List channels</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="list-channels">
<h1>List channels<a class="headerlink" href="#list-channels" title="Link to this heading"></a></h1>
<p>A list of all channels currently available on the specified virtual
server can be queried with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>list all channels on the server </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server to get the list of channels on </p></li>
<li><p><strong>result</strong> address of a variable to receive a zero terminted array of channel ids. Like {4, 65, 23, …, 0} Memory is allocated by the server library and caller must free the array using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>To query the current channel of a client use</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelOfClient</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the id of the clients current channel </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> the client to get the channel of </p></li>
<li><p><strong>result</strong> address of a variable to receive the channel id </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>Get the parent channel of a given channel with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getParentChannelOfChannel</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the parent channel of a channel </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the channel of which to get the parent channel </p></li>
<li><p><strong>result</strong> address of a variable to receive the parent channel id </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="example">
<h2>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h2>
<p>Example to print a list of all channels on a virtual server:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="n">uint64</span><span class="o">*</span><span class="w"> </span><span class="n">channels</span><span class="p">;</span>
<span class="linenos">2</span>
<span class="linenos">3</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_getChannelList</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">channels</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">4</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">channels</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">5</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Channel ID: %u</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">channels</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
<span class="linenos">6</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">7</span><span class="w"> </span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">channels</span><span class="p">);</span>
<span class="linenos">8</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="channels.html" class="btn btn-neutral float-left" title="Managing channels" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="channel-create.html" class="btn btn-neutral float-right" title="Creating a new channel" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,188 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Moving channels &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Deleting channels" href="channel-delete.html" />
<link rel="prev" title="Advanced channel creation" href="channel-create-adv.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="channels.html">Managing channels</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="channel-list.html">List channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create.html">Creating a new channel</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create-adv.html">Advanced channel creation</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Moving channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-delete.html">Deleting channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="channels.html">Managing channels</a></li>
<li class="breadcrumb-item active">Moving channels</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="moving-channels">
<h1>Moving channels<a class="headerlink" href="#moving-channels" title="Link to this heading"></a></h1>
<p>To move a channel to a new parent channel, making it appear in a
different location in the channel structure, call this function:</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_channelMove</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">newChannelParentID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">newOrder</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>move a channel within the tree, make it a sub channel or root channel. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which to move a channel </p></li>
<li><p><strong>channelID</strong> the channel to move </p></li>
<li><p><strong>newChannelParentID</strong> id of the parent channel to move this channel into. Set to 0 to make this channel a root channel. </p></li>
<li><p><strong>newOrder</strong> id of the channel below which this channel is to be sorted. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>After the channel has been moved, the event <a class="reference internal" href="../server_api.html#c.ServerLibFunctions.onChannelEdited" title="ServerLibFunctions.onChannelEdited"><code class="xref c c-func docutils literal notranslate"><span class="pre">onChannelEdited()</span></code></a> callback is called.</p>
</div>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="channel-create-adv.html" class="btn btn-neutral float-left" title="Advanced channel creation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="channel-delete.html" class="btn btn-neutral float-right" title="Deleting channels" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,199 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Managing channels &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="List channels" href="channel-list.html" />
<link rel="prev" title="Bandwidth and Traffic" href="info-bandwidth.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Managing channels</a><ul>
<li class="toctree-l2"><a class="reference internal" href="channel-list.html">List channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create.html">Creating a new channel</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create-adv.html">Advanced channel creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-move.html">Moving channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-delete.html">Deleting channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Managing channels</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="managing-channels">
<h1>Managing channels<a class="headerlink" href="#managing-channels" title="Link to this heading"></a></h1>
<p>The Server Lib offers a subset of client-side functionality to create,
move and delete channels directly on the server.
It is also possible to query and modify channel properties from the server side.
This chapter will describe how to do all these things.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="channel-list.html">List channels</a><ul>
<li class="toctree-l2"><a class="reference internal" href="channel-list.html#example">Example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="channel-create.html">Creating a new channel</a><ul>
<li class="toctree-l2"><a class="reference internal" href="channel-create.html#actually-create-the-channel">Actually create the channel</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create.html#example">Example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="channel-create-adv.html">Advanced channel creation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="channel-create-adv.html#obtain-a-channel-creation-structure">Obtain a channel creation structure</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create-adv.html#setting-basic-channel-properties">Setting basic channel properties</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create-adv.html#setting-additional-channel-properties">Setting additional channel properties</a></li>
<li class="toctree-l2"><a class="reference internal" href="channel-create-adv.html#actually-create-the-channel">Actually create the channel</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="channel-move.html">Moving channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="channel-delete.html">Deleting channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="info-channel.html">Channel information</a><ul>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html#query-channel-information">Query channel information</a><ul>
<li class="toctree-l3"><a class="reference internal" href="info-channel.html#examples">Examples</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html#setting-channel-information">Setting channel information</a><ul>
<li class="toctree-l3"><a class="reference internal" href="info-channel.html#id1">Examples</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="info-bandwidth.html" class="btn btn-neutral float-left" title="Bandwidth and Traffic" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="channel-list.html" class="btn btn-neutral float-right" title="List channels" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,187 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>List clients &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">List clients</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="list-clients">
<h1>List clients<a class="headerlink" href="#list-clients" title="Link to this heading"></a></h1>
<p>A list of all clients currently online on the specified virtual server
can be queried with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getClientList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get a list of all clients connected to a server </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server on which to get the list of clients </p></li>
<li><p><strong>result</strong> address of a variable to receive the zero terminated list of clients, like {1, 2, 50, …, 0} Memory is allocated by the server library and caller must free the array using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>To get a list of all clients currently in the specified channel</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelClientList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get list of clients in a channel </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the channel of which to get the list of clients </p></li>
<li><p><strong>result</strong> address of a variable to receive a zero terminated array of client ids in the channel. Like {3, 5, 39, …, 0} Memory is allocated by the server library and caller must free the array using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,489 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Managing clients &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Whisper lists" href="whisper.html" />
<link rel="prev" title="Deleting channels" href="channel-delete.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Managing clients</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#list-clients">List clients</a></li>
<li class="toctree-l2"><a class="reference internal" href="#moving-clients">Moving clients</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#kicking-clients">Kicking Clients</a></li>
<li class="toctree-l2"><a class="reference internal" href="#client-information">Client information</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#query-client-information">Query client information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">Example</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#setting-client-information">Setting client information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#examples">Examples</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Managing clients</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="managing-clients">
<h1>Managing clients<a class="headerlink" href="#managing-clients" title="Link to this heading"></a></h1>
<p>While in a traditional TeamSpeak setup, clients are moving themselves by joining
channels, and clients can request to move other clients, the server is also able
to perform these actions using the functions described in this chapter.</p>
<section id="list-clients">
<h2>List clients<a class="headerlink" href="#list-clients" title="Link to this heading"></a></h2>
<p>A list of all clients currently online on the specified virtual server
can be queried with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getClientList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get a list of all clients connected to a server </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server on which to get the list of clients </p></li>
<li><p><strong>result</strong> address of a variable to receive the zero terminated list of clients, like {1, 2, 50, …, 0} Memory is allocated by the server library and caller must free the array using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>To get a list of all clients currently in the specified channel</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelClientList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get list of clients in a channel </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the channel of which to get the list of clients </p></li>
<li><p><strong>result</strong> address of a variable to receive a zero terminated array of client ids in the channel. Like {3, 5, 39, …, 0} Memory is allocated by the server library and caller must free the array using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="moving-clients">
<h2>Moving clients<a class="headerlink" href="#moving-clients" title="Link to this heading"></a></h2>
<p>Clients can be moved server-side to another channel, in addition to the
client-side functionality offered by the Client Lib. To move one or
multiple clients to a new channel, call:</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_clientMove</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">newChannelID</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">clientIDArray</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Move one or more clients to a different channel. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is connected to </p></li>
<li><p><strong>newChannelID</strong> the id of the channel to move the client(s) to </p></li>
<li><p><strong>clientIDArray</strong> zero terminated array of client ids to move. Like {4, 9, …, 0} </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="example">
<h3>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h3>
<p>Example to move a single client to another channel:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="n">anyID</span><span class="w"> </span><span class="n">clientIDArray</span><span class="p">[</span><span class="mi">2</span><span class="p">];</span><span class="w"> </span><span class="cm">/* One client plus terminating zero as end-marker */</span>
<span class="linenos"> 2</span><span class="n">uint64</span><span class="w"> </span><span class="n">newChannelID</span><span class="p">;</span>
<span class="linenos"> 3</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">;</span>
<span class="linenos"> 4</span>
<span class="linenos"> 5</span><span class="n">clientIDArray</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">clientID</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Client to move */</span>
<span class="linenos"> 6</span><span class="n">clientIDArray</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="cm">/* End marker */</span>
<span class="linenos"> 7</span>
<span class="linenos"> 8</span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3server_clientMove</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">newChannelID</span><span class="p">,</span><span class="w"> </span><span class="n">channelIDArray</span><span class="p">))</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 9</span><span class="w"> </span><span class="cm">/* Handle error */</span>
<span class="linenos">10</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos">11</span><span class="p">}</span>
<span class="linenos">12</span>
<span class="linenos">13</span><span class="cm">/* Client moved successfully */</span>
</pre></div>
</div>
</section>
</section>
<section id="kicking-clients">
<h2>Kicking Clients<a class="headerlink" href="#kicking-clients" title="Link to this heading"></a></h2>
<p>In additions to the client side feature, the server can also kick clients from the server
itself using</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_clientsKickFromServer</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">clientIDArray</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">kickReason</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">failOnClientError</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>kick one or more clients from the server, terminating their connection. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server the client(s) are connected to </p></li>
<li><p><strong>clientIDArray</strong> zero terminated array of client ids to kick. Like {4, 3, 12, …, 0} </p></li>
<li><p><strong>kickReason</strong> utf8 encoded c string describing the reason for the kick. Pass an empty string if unused. </p></li>
<li><p><strong>failOnClientError</strong> boolean flag. If 1 the function will fail if clients to be kicked are not on the server. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="client-information">
<h2>Client information<a class="headerlink" href="#client-information" title="Link to this heading"></a></h2>
<p>Information about the clients currently connected to the virtual server
can be retrieved and modified.</p>
<p>Available variables are listed in the <a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><code class="xref c c-enum docutils literal notranslate"><span class="pre">ClientProperties</span></code></a> enum.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The server always has all the information about all clients as long as they are
connected to the server.</p>
<p>Limitations regarding availability mentioned for the variables are thus of no concern for the server.</p>
</div>
<section id="query-client-information">
<h3>Query client information<a class="headerlink" href="#query-client-information" title="Link to this heading"></a></h3>
<p>To query client related information, use one of the following functions depending on the
type of the variable you are going to query.</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getClientVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a client variable as integer. </p>
<p>Not all variables are available as integer, some are only available as string or unsigned 64 bit integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the variable queried. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getClientVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a client variable as unsigned 64 bit integer. </p>
<p>Not all variables are available as unsigned 64 bit integer, some are only available as string or integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the variable queried. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getClientVariableAsString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of the client variable as string </p>
<p>Not all variables are available as string, some are only available as unsigned 64 bit integer or integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the variable queried. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="id1">
<h4>Example<a class="headerlink" href="#id1" title="Link to this heading"></a></h4>
<p>Query nickname of client with ID 123:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">;</span>
<span class="linenos"> 2</span><span class="n">anyID</span><span class="w"> </span><span class="n">clientID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">123</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Client ID in our example */</span>
<span class="linenos"> 3</span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">nickname</span><span class="p">;</span>
<span class="linenos"> 4</span>
<span class="linenos"> 5</span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3server_getClientVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_NICKNAME</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">nickname</span><span class="p">))</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error querying client nickname: %d</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">error</span><span class="p">);</span>
<span class="linenos"> 7</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos"> 8</span><span class="p">}</span>
<span class="linenos"> 9</span>
<span class="linenos">10</span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Client nickname is: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">nickname</span><span class="p">);</span>
<span class="linenos">11</span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">nickname</span><span class="p">);</span>
</pre></div>
</div>
</section>
</section>
<section id="setting-client-information">
<h3>Setting client information<a class="headerlink" href="#setting-client-information" title="Link to this heading"></a></h3>
<p>Client information can be modified with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setClientVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the value of a client variable. </p>
<p>Not all variables can be set as integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setClientVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the value of a client variable. </p>
<p>Not all variables can be set as unsigned 64 bit integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setClientVariableAsString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the value of a client variable. </p>
<p>Not all variables can be set as string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>After modifying one or more client variables, you <strong>must</strong> flush the
changes using <a class="reference internal" href="../server_api.html#c.ts3server_flushClientVariable" title="ts3server_flushClientVariable"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_flushClientVariable()</span></code></a>.</p>
</div>
<p>The idea behind flushing is, one can modify multiple values by calling
<a class="reference internal" href="#c.ts3server_setClientVariableAsString" title="ts3server_setClientVariableAsString"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setClientVariableAsString()</span></code></a>, <a class="reference internal" href="#c.ts3server_setClientVariableAsInt" title="ts3server_setClientVariableAsInt"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setClientVariableAsInt()</span></code></a> and
<a class="reference internal" href="#c.ts3server_setClientVariableAsUInt64" title="ts3server_setClientVariableAsUInt64"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setClientVariableAsUInt64()</span></code></a> for a client and then apply all changes in one step.</p>
<section id="examples">
<h4>Examples<a class="headerlink" href="#examples" title="Link to this heading"></a></h4>
<p>To change the nickname of the client with ID 55 to “Joe”:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="n">anyID</span><span class="w"> </span><span class="n">clientID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">55</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Client ID in our example */</span>
<span class="linenos"> 2</span>
<span class="linenos"> 3</span><span class="cm">/* Modifiy data */</span>
<span class="linenos"> 4</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setClientVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_NICKNAME</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;Joe&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 5</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error setting client nickname</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos"> 7</span><span class="p">}</span>
<span class="linenos"> 8</span>
<span class="linenos"> 9</span><span class="cm">/* Flush changes */</span>
<span class="linenos">10</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_flushClientVariable</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">11</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error flushing client variable</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">12</span><span class="p">}</span>
</pre></div>
</div>
<p>Changing multiple variables is as simple as:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="n">anyID</span><span class="w"> </span><span class="n">clientID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">66</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Client ID in our example */</span>
<span class="linenos"> 2</span>
<span class="linenos"> 3</span><span class="cm">/* Modify data 1 */</span>
<span class="linenos"> 4</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setClientVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_NICKNAME</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;bob&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 5</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error setting nickname</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos"> 7</span><span class="p">}</span>
<span class="linenos"> 8</span>
<span class="linenos"> 9</span><span class="cm">/* Modify data 2 */</span>
<span class="linenos">10</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setClientVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_META_DATA</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;some data&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">11</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error setting meta data</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">12</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos">13</span><span class="p">}</span>
<span class="linenos">14</span>
<span class="linenos">15</span><span class="cm">/* Flush changes */</span>
<span class="linenos">16</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_flushClientVariable</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">17</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error flushing client variable&quot;</span><span class="p">);</span>
<span class="linenos">18</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="channel-delete.html" class="btn btn-neutral float-left" title="Deleting channels" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="whisper.html" class="btn btn-neutral float-right" title="Whisper lists" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,284 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Disabling protocol commands &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Filetransfer" href="filetransfer.html" />
<link rel="prev" title="Security salts and hashes" href="security-salt.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Disabling protocol commands</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Disabling protocol commands</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="disabling-protocol-commands">
<h1>Disabling protocol commands<a class="headerlink" href="#disabling-protocol-commands" title="Link to this heading"></a></h1>
<p>SDK users can opt to disable specific protocol commands in a TeamSpeak
server instance, so clients are unable to use these commands. The
server can still issue disabled commands by calling the appropriate
Server Lib functions.</p>
<p>Commands that can be disabled are described in the <a class="reference internal" href="../enumerations.html#c.ClientCommand" title="ClientCommand"><code class="xref c c-enum docutils literal notranslate"><span class="pre">ClientCommand</span></code></a> enum.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>By default all commands are allowed, unless explicitly disabled.</p>
</div>
<p>To disable protocol commands for all clients call</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_disableClientCommand</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">clientCommand</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Prevents clients from performing certain actions. SDK only. </p>
<p>Use this to disable certain features for clients, e.g. deleting channels or moving clients so that the server has authority over these matters and is the only entity who can do so. To disable multiple commands, call this function once for each command you would like to disable for clients.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>clientCommand</strong> the command to disable. One of the values from the <a class="reference internal" href="../enumerations.html#public__definitions_8h_1a018ea5b8dcbbf3852163d9a8b17bb311"><span class="std std-ref">ClientCommand</span></a> enum </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>To disable multiple commands, call this function once per command to disable.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is no way to enable commands again once disabled.</p>
<p>To enable all disabled commands again you will have to destroy
and initialize the server lib again.</p>
</div>
<section id="example">
<h2>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h2>
<p>For example, an SDK user may decide that clients should not be able to
create channels on a TeamSpeak server and implement this action only on the
Server side.</p>
<p>Any client call to <a class="reference internal" href="../client/channel-create.html#c.ts3client_flushChannelCreation" title="ts3client_flushChannelCreation"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3client_flushChannelCreation()</span></code></a> will be rejected by the server.</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;teamspeak/clientlib.h&gt;</span>
<span class="linenos"> 2</span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;teamspeak/serverlib.h&gt;</span>
<span class="linenos"> 3</span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;teamspeak/public_definitions.h&gt;</span>
<span class="linenos"> 4</span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;teamspeak/public_errors.h&gt;</span>
<span class="linenos"> 5</span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;stdio.h&gt;</span><span class="c1"> // printf</span>
<span class="linenos"> 6</span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;string.h&gt;</span><span class="c1"> // memset</span>
<span class="linenos"> 7</span>
<span class="linenos"> 8</span><span class="kt">void</span><span class="w"> </span><span class="nf">onConnect</span><span class="p">(</span><span class="n">uint64</span><span class="w"> </span><span class="n">schid</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">status</span><span class="p">,</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 9</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">status</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">STATUS_CONNECTION_ESTABLISHING</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">10</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Creating channel...</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">11</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">err</span><span class="p">;</span>
<span class="linenos">12</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3client_setChannelVariableAsString</span><span class="p">(</span><span class="n">schid</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_NAME</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;TestChannel&quot;</span><span class="p">))</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">13</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed to set channel variable: 0x%04X</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">err</span><span class="p">);</span>
<span class="linenos">14</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos">15</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">16</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3client_setChannelVariableAsInt</span><span class="p">(</span><span class="n">schid</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_FLAG_PERMANENT</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">))</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">17</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed to set channel variable: 0x%04X</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">err</span><span class="p">);</span>
<span class="linenos">18</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos">19</span><span class="w"> </span><span class="p">}</span>
<span class="hll"><span class="linenos">20</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3client_flushChannelCreation</span><span class="p">(</span><span class="n">schid</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;sdk-channel-create&quot;</span><span class="p">))</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
</span><span class="linenos">21</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed to set channel variable: 0x%04X</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">err</span><span class="p">);</span>
<span class="linenos">22</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos">23</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">24</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">25</span><span class="p">}</span>
<span class="linenos">26</span>
<span class="linenos">27</span><span class="kt">void</span><span class="w"> </span><span class="nf">onError</span><span class="p">(</span><span class="n">uint64</span><span class="w"> </span><span class="n">schid</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">message</span><span class="p">,</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">returnCode</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">extra</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">28</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Connection %llu has error 0x%04X&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">schid</span><span class="p">,</span><span class="w"> </span><span class="n">error</span><span class="p">);</span>
<span class="linenos">29</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">returnCode</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">30</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot; for call %s&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">returnCode</span><span class="p">);</span>
<span class="linenos">31</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">32</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">33</span><span class="p">}</span>
<span class="linenos">34</span>
<span class="linenos">35</span><span class="kt">void</span><span class="w"> </span><span class="nf">onChannelCreated</span><span class="p">(</span><span class="n">uint64</span><span class="w"> </span><span class="n">schid</span><span class="p">,</span><span class="w"> </span><span class="n">uint64</span><span class="w"> </span><span class="n">channelId</span><span class="p">,</span><span class="w"> </span><span class="n">uint64</span><span class="w"> </span><span class="n">parentId</span><span class="p">,</span><span class="w"> </span><span class="n">anyID</span><span class="w"> </span><span class="n">invokerId</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">invokerName</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">invokerUid</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">36</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Channel %llu created by %s as a child of %llu on connection %llu</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">channelId</span><span class="p">,</span><span class="w"> </span><span class="n">invokerName</span><span class="p">,</span><span class="w"> </span><span class="n">parentId</span><span class="p">,</span><span class="w"> </span><span class="n">schid</span><span class="p">);</span>
<span class="linenos">37</span><span class="p">}</span>
<span class="linenos">38</span>
<span class="linenos">39</span><span class="kt">int</span><span class="w"> </span><span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">40</span><span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">ServerLibFunctions</span><span class="w"> </span><span class="n">sf</span><span class="p">;</span>
<span class="linenos">41</span><span class="w"> </span><span class="n">memset</span><span class="p">(</span><span class="o">&amp;</span><span class="n">sf</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="k">sizeof</span><span class="w"> </span><span class="n">sf</span><span class="p">);</span>
<span class="linenos">42</span><span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">ClientUIFunctions</span><span class="w"> </span><span class="n">cf</span><span class="p">;</span>
<span class="linenos">43</span><span class="w"> </span><span class="n">memset</span><span class="p">(</span><span class="o">&amp;</span><span class="n">cf</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="k">sizeof</span><span class="w"> </span><span class="n">cf</span><span class="p">);</span>
<span class="linenos">44</span><span class="w"> </span><span class="n">cf</span><span class="p">.</span><span class="n">onConnectStatusChangeEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">onConnect</span><span class="p">;</span>
<span class="linenos">45</span><span class="w"> </span><span class="n">cf</span><span class="p">.</span><span class="n">onServerErrorEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">onError</span><span class="p">;</span>
<span class="linenos">46</span><span class="w"> </span><span class="n">cf</span><span class="p">.</span><span class="n">onNewChannelCreatedEvent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">onChannelCreated</span><span class="p">;</span>
<span class="linenos">47</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3client_initClientLib</span><span class="p">(</span><span class="o">&amp;</span><span class="n">cf</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">LogType_NONE</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="p">);</span>
<span class="linenos">48</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">49</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed to init lib: 0x%04X</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">err</span><span class="p">);</span>
<span class="linenos">50</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
<span class="linenos">51</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">52</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3server_initServerLib</span><span class="p">(</span><span class="o">&amp;</span><span class="n">sf</span><span class="p">,</span><span class="w"> </span><span class="n">LogType_NONE</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="p">))</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">53</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed to init server lib: 0x%04X</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">err</span><span class="p">);</span>
<span class="linenos">54</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span>
<span class="linenos">55</span><span class="w"> </span><span class="p">}</span>
<span class="hll"><span class="linenos">56</span><span class="w"> </span><span class="n">ts3server_disableClientCommand</span><span class="p">(</span><span class="n">CLIENT_COMMAND_flushChannelCreation</span><span class="p">);</span>
</span><span class="linenos">57</span><span class="w"> </span><span class="n">uint64</span><span class="w"> </span><span class="n">serverId</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="linenos">58</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3server_createVirtualServer</span><span class="p">(</span><span class="mi">9987</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;127.0.0.1&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;TestServer&quot;</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">serverId</span><span class="p">))</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">59</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed to create server: 0x%04X</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">err</span><span class="p">);</span>
<span class="linenos">60</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span>
<span class="linenos">61</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">62</span>
<span class="linenos">63</span><span class="w"> </span><span class="n">uint64</span><span class="w"> </span><span class="n">clientTab</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="linenos">64</span><span class="w"> </span><span class="n">ts3client_spawnNewServerConnectionHandler</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">clientTab</span><span class="p">);</span>
<span class="linenos">65</span>
<span class="linenos">66</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">ident</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span>
<span class="linenos">67</span><span class="w"> </span><span class="n">ts3client_createIdentity</span><span class="p">(</span><span class="o">&amp;</span><span class="n">ident</span><span class="p">);</span>
<span class="linenos">68</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3client_startConnection</span><span class="p">(</span><span class="n">clientTab</span><span class="p">,</span><span class="w"> </span><span class="n">ident</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;127.0.0.1&quot;</span><span class="p">,</span><span class="w"> </span><span class="mi">9987</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;TestUser&quot;</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="p">))</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">69</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed to connect: 0x%04X</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">err</span><span class="p">);</span>
<span class="linenos">70</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
<span class="linenos">71</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">72</span>
<span class="linenos">73</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Press Enter to terminate</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">74</span><span class="w"> </span><span class="n">getchar</span><span class="p">();</span>
<span class="linenos">75</span>
<span class="linenos">76</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Terminating...</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">77</span><span class="w"> </span><span class="n">ts3client_stopConnection</span><span class="p">(</span><span class="n">clientTab</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;bye&quot;</span><span class="p">);</span>
<span class="linenos">78</span><span class="w"> </span><span class="n">ts3server_stopVirtualServer</span><span class="p">(</span><span class="n">serverId</span><span class="p">);</span>
<span class="linenos">79</span><span class="w"> </span><span class="n">ts3client_destroyServerConnectionHandler</span><span class="p">(</span><span class="n">clientTab</span><span class="p">);</span>
<span class="linenos">80</span><span class="w"> </span><span class="n">ts3client_destroyClientLib</span><span class="p">();</span>
<span class="linenos">81</span><span class="w"> </span><span class="n">ts3server_destroyServerLib</span><span class="p">();</span>
<span class="linenos">82</span>
<span class="linenos">83</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="linenos">84</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="security-salt.html" class="btn btn-neutral float-left" title="Security salts and hashes" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="filetransfer.html" class="btn btn-neutral float-right" title="Filetransfer" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,261 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Custom encryption &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Custom passwords" href="passwords.html" />
<link rel="prev" title="Whisper lists" href="whisper.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Custom encryption</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#encryption">Encryption</a></li>
<li class="toctree-l2"><a class="reference internal" href="#decryption">Decryption</a></li>
<li class="toctree-l2"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Custom encryption</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="custom-encryption">
<h1>Custom encryption<a class="headerlink" href="#custom-encryption" title="Link to this heading"></a></h1>
<p>As an optional feature, the TeamSpeak 3 SDK allows users to implement
custom encryption and decryption for all network traffic. Custom
encryption replaces the default AES encryption implemented by the
TeamSpeak 3 SDK. A possible reason to apply own encryption might be to
make ones TeamSpeak 3 client/server incompatible to other SDK
implementations.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Custom encryption must be implemented the same way in both the client
and server.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you do not want to use this feature, just dont implement the two
encryption callbacks.</p>
</div>
<section id="encryption">
<h2>Encryption<a class="headerlink" href="#encryption" title="Link to this heading"></a></h2>
<p>To encrypt outgoing data, implement the callback</p>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">onCustomPacketEncryptEvent</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">dataToSend</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">sizeOfData</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a packet needs to be encrypted to be sent over the wire. </p>
<p>Used to implement custom encryption of server communication. This needs to be implemented the same in the client and server, otherwise clients cannot communicate with the server. Only implement this callback when you need custom encryption.</p>
<dl class="field-list simple">
<dt class="field-odd">Param dataToSend<span class="colon">:</span></dt>
<dd class="field-odd"><p>pointer to an array of bytes that need to be encrypted. Must not be freed. Encrypt the data in place in this array if the size of your encrypted data is smaller than indicated in the sizeOfData parameter. Otherwise allocate your own memory and replace the pointer to point to your own allocated memory. In this case you need to take care of freeing the memory. </p>
</dd>
<dt class="field-even">Param sizeOfData<span class="colon">:</span></dt>
<dd class="field-even"><p>size in byte of the dataToSend array. </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>The original memory pointed to by dataToSend must not be freed regardless
of whether or not you replace the pointer!</p>
</div>
</section>
<section id="decryption">
<h2>Decryption<a class="headerlink" href="#decryption" title="Link to this heading"></a></h2>
<p>To decrypt incoming data, implement the callback</p>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">onCustomPacketDecryptEvent</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">dataReceived</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">dataReceivedSize</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a packet needs to be decrypted after it has been received. </p>
<p>Used to implement custom encryption of server communication. This needs to be implemented the same in the client and server, otherwise clients cannot communicate with the server. Only implement this callback when you need custom encryption.</p>
<dl class="field-list simple">
<dt class="field-odd">Param dataReceived<span class="colon">:</span></dt>
<dd class="field-odd"><p>pointer to an array of bytes that need to be decrypted. Must not be freed. Decrypt the data in place in this array if the size of your decrypted data is smaller than indicated by the dataReceivedSize parameter. Otherwise allocate your own memory and replace the pointer to point to your own allocated memory. In this case you need to take care of freeing the memory </p>
</dd>
<dt class="field-even">Param dataReceivedSize<span class="colon">:</span></dt>
<dd class="field-even"><p>size in byte of the dataReceived array. </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>The original memory pointed to by dataReceived must not be freed regardless
of whether or not you replace the pointer!</p>
</div>
</section>
<section id="example">
<h2>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h2>
<p>Example code implementing a very simple XOR custom encryption and
decryption (also see the SDK examples):</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kt">void</span><span class="w"> </span><span class="nf">onCustomPacketEncryptEvent</span><span class="p">(</span><span class="kt">char</span><span class="o">**</span><span class="w"> </span><span class="n">dataToSend</span><span class="p">,</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="o">*</span><span class="w"> </span><span class="n">sizeOfData</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 2</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="p">;</span>
<span class="linenos"> 3</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">sizeOfData</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 4</span><span class="w"> </span><span class="p">(</span><span class="o">*</span><span class="n">dataToSend</span><span class="p">)[</span><span class="n">i</span><span class="p">]</span><span class="w"> </span><span class="o">^=</span><span class="w"> </span><span class="n">CUSTOM_CRYPT_KEY</span><span class="p">;</span>
<span class="linenos"> 5</span><span class="w"> </span><span class="p">}</span>
<span class="linenos"> 6</span><span class="p">}</span>
<span class="linenos"> 7</span>
<span class="linenos"> 8</span><span class="kt">void</span><span class="w"> </span><span class="nf">onCustomPacketDecryptEvent</span><span class="p">(</span><span class="kt">char</span><span class="o">**</span><span class="w"> </span><span class="n">dataReceived</span><span class="p">,</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="o">*</span><span class="w"> </span><span class="n">dataReceivedSize</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 9</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="p">;</span>
<span class="linenos">10</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">dataReceivedSize</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">11</span><span class="w"> </span><span class="p">(</span><span class="o">*</span><span class="n">dataReceived</span><span class="p">)[</span><span class="n">i</span><span class="p">]</span><span class="w"> </span><span class="o">^=</span><span class="w"> </span><span class="n">CUSTOM_CRYPT_KEY</span><span class="p">;</span>
<span class="linenos">12</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">13</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="whisper.html" class="btn btn-neutral float-left" title="Whisper lists" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="passwords.html" class="btn btn-neutral float-right" title="Custom passwords" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,261 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FAQ &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Introduction" href="../client/intro.html" />
<link rel="prev" title="Filetransfer" href="filetransfer.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">FAQ</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#unable-to-start-multiple-virtual-servers-processes">Unable to start multiple virtual servers / processes</a></li>
<li class="toctree-l2"><a class="reference internal" href="#configure-the-maximum-number-of-clients-on-a-server">Configure the maximum number of clients on a server</a></li>
<li class="toctree-l2"><a class="reference internal" href="#i-get-accounting-sid-1-is-running-initializing-shutdown-in-the-log">I get “Accounting | | sid=1 is running initializing shutdown” in the log</a></li>
<li class="toctree-l2"><a class="reference internal" href="#implementing-a-name-password-authentication">Implementing a name/password authentication</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">FAQ</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="faq">
<h1>FAQ<a class="headerlink" href="#faq" title="Link to this heading"></a></h1>
<section id="unable-to-start-multiple-virtual-servers-processes">
<h2>Unable to start multiple virtual servers / processes<a class="headerlink" href="#unable-to-start-multiple-virtual-servers-processes" title="Link to this heading"></a></h2>
<p>You dont have a valid license key in the correct location. The file
<cite>licensekey.dat</cite> needs to be placed in the same directory as the
server executable.
Without a license key or an expired / invalid one the following restrictions are
in place:</p>
<ul class="simple">
<li><p>Only one server process per machine</p></li>
<li><p>Only one virtual server per process</p></li>
<li><p>Up to 32 slots</p></li>
</ul>
<p>Please contact <a class="reference external" href="mailto:sales&#37;&#52;&#48;teamspeakusa&#46;com">sales<span>&#64;</span>teamspeakusa<span>&#46;</span>com</a> for license key inquiries or to
obtain a valid license.</p>
</section>
<section id="configure-the-maximum-number-of-clients-on-a-server">
<h2>Configure the maximum number of clients on a server<a class="headerlink" href="#configure-the-maximum-number-of-clients-on-a-server" title="Link to this heading"></a></h2>
<p>The number of slots per virtual server can be changed by setting the
virtual server property <a class="reference internal" href="../properties.html#c.VirtualServerProperties.VIRTUALSERVER_MAXCLIENTS" title="VIRTUALSERVER_MAXCLIENTS"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">VIRTUALSERVER_MAXCLIENTS</span></code></a></p>
<p>Example to set 100 slots on the specified virtual server:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">ts3server_setVirtualServerVariableAsInt</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">VIRTUALSERVER_MAXCLIENTS</span><span class="p">,</span><span class="w"> </span><span class="mi">100</span><span class="p">);</span><span class="w"> </span><span class="c1">// Set value</span>
<span class="n">ts3server_flushVirtualServerVariable</span><span class="p">(</span><span class="n">serverID</span><span class="p">);</span><span class="w"> </span><span class="c1">// Flush changes</span>
</pre></div>
</div>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Please note that you probably do not have unlimited slots allowed by
your license, so dont set this arbitrarily.</p>
</div>
</section>
<section id="i-get-accounting-sid-1-is-running-initializing-shutdown-in-the-log">
<h2>I get “Accounting | | sid=1 is running initializing shutdown” in the log<a class="headerlink" href="#i-get-accounting-sid-1-is-running-initializing-shutdown-in-the-log" title="Link to this heading"></a></h2>
<p>This error happens because you are running more than one virtual server
with the same server keypair.</p>
<p>When creating a new virtual server, a keypair must be passed to
<a class="reference internal" href="vserver-manage.html#c.ts3server_createVirtualServer" title="ts3server_createVirtualServer"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_createVirtualServer()</span></code></a>. It is important to store the used
keypair and reuse it when restarting this virtual server later instead
of creating a new key. See the server sample within the SDK for an example.</p>
<p>However, this problem can happen if the virtual server is started with
a stored keypair, then the entire folder including the stored keypair is
copied to another PC and also started there with the <strong>same</strong> key. In this
case the licensing server will notice the same key is used more than
once and shutdown the most recently started server which tried to steal
the identity of an already running server.</p>
<p>The fix, in the server sample case, would be to delete the keypair_*.txt
files from the copied directory before starting the second server, that
way a new key would be generated and the licensing server would see the
two servers as two valid different entities. The accounting server would
now only complain if the number of simultaneously running servers
exceeds your number of slots.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Each key pair should only be used for the same virtual server.
It must not be re-used for multiple virtual servers.</p>
<p>However it is also important to not generate a new key pair
every time you start the virtual server again.</p>
</div>
</section>
<section id="implementing-a-name-password-authentication">
<h2>Implementing a name/password authentication<a class="headerlink" href="#implementing-a-name-password-authentication" title="Link to this heading"></a></h2>
<p>Although TeamSpeak 3 offers an authentication system based on
public/private keys, an often made request is to use an additional
username / password mechanism to authenticate clients with the TeamSpeak 3
server. Here we will suggest a possibility to implement this
authentication on top of the existing public / private key mechanism.</p>
<p>When connecting to the TeamSpeak 3 server, a client might make use of
the <a class="reference internal" href="../properties.html#c.ClientProperties.CLIENT_META_DATA" title="CLIENT_META_DATA"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CLIENT_META_DATA</span></code></a> property and fill this with a username / password
combination, to let the server validate this this data in the servers
<a class="reference internal" href="../server_api.html#c.ServerLibFunctions.onClientConnected" title="ServerLibFunctions.onClientConnected"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ServerLibFunctions.onClientConnected</span></code></a> callback.
This callback allows to set an error value to block this clients connection.</p>
<p>The client-side code:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="c1">// In the client, set CLIENT_META_DATA before connecting</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3client_setClientSelfVariableAsString</span><span class="p">(</span><span class="n">scHandlerID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_META_DATA</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;NAME#PASSWORD&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed setting client meta data</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
<span class="c1">// Call ts3client_startConnection</span>
</pre></div>
</div>
<p>In the server implement the onClientConnected callback, which validates
the name/password meta data and refuses the connection if not validated:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kt">void</span><span class="w"> </span><span class="nf">onClientConnected</span><span class="p">(</span><span class="n">uint64</span><span class="w"> </span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">anyID</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">uint64</span><span class="w"> </span><span class="n">channelID</span><span class="p">,</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="o">*</span><span class="w"> </span><span class="n">removeClientError</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 2</span><span class="w"> </span><span class="c1">// Query CLIENT_META_DATA</span>
<span class="linenos"> 3</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">metaData</span><span class="p">;</span>
<span class="linenos"> 4</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_getClientVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_META_DATA</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">metaData</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 5</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Failed querying client meta data</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="o">*</span><span class="n">removeClientError</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ERROR_client_not_logged_in</span><span class="p">;</span><span class="w"> </span><span class="c1">// Block client</span>
<span class="linenos"> 7</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos"> 8</span><span class="w"> </span><span class="p">}</span>
<span class="linenos"> 9</span>
<span class="linenos">10</span><span class="w"> </span><span class="c1">// Validate name/password</span>
<span class="linenos">11</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">validateNamePassword</span><span class="p">(</span><span class="n">metaData</span><span class="p">))</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">12</span><span class="w"> </span><span class="o">*</span><span class="n">removeClientError</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ERROR_client_not_logged_in</span><span class="p">;</span><span class="w"> </span><span class="c1">// Block client</span>
<span class="linenos">13</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">14</span><span class="w"> </span><span class="c1">// Client is allowed to connect if removeClientError is not changed (defaults is ERROR_ok)</span>
<span class="linenos">15</span><span class="w"> </span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">metaData</span><span class="p">);</span><span class="w"> </span><span class="c1">// Release previously allocated memory</span>
<span class="linenos">16</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="filetransfer.html" class="btn btn-neutral float-left" title="Filetransfer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="../client/intro.html" class="btn btn-neutral float-right" title="Introduction" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,498 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Filetransfer &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="FAQ" href="faq.html" />
<link rel="prev" title="Disabling protocol commands" href="disable-commands.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Filetransfer</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#enable-file-transfer">Enable file transfer</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#c.ts3server_enableFileManager"><code class="docutils literal notranslate"><span class="pre">ts3server_enableFileManager()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#callbacks">Callbacks</a></li>
<li class="toctree-l2"><a class="reference internal" href="#rewriting-the-path-on-the-server">Rewriting the path on the server</a></li>
<li class="toctree-l2"><a class="reference internal" href="#permissions">Permissions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Filetransfer</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="filetransfer">
<h1>Filetransfer<a class="headerlink" href="#filetransfer" title="Link to this heading"></a></h1>
<p>The TeamSpeak SDK includes the ability to support filetransfer, like the
regular TeamSpeak server and client offer. The server can function as a
file storage, which can be accessed by clients who can up- and download
files. Files are stored on the filesystem where the server is running.</p>
<section id="enable-file-transfer">
<h2>Enable file transfer<a class="headerlink" href="#enable-file-transfer" title="Link to this heading"></a></h2>
<p>The availability of filetransfer in the TeamSpeak server can be
controlled by the following function, which should be called right after
<a class="reference internal" href="basic.html#c.ts3server_initServerLib" title="ts3server_initServerLib"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_initServerLib()</span></code></a> to initialize filetransfer.</p>
<dl class="c function">
<dt class="sig sig-object c" id="c.ts3server_enableFileManager">
<span class="target" id="serverlib_8h_1a4f013fc7cccb234a34fdecf5081bdc3e"></span><span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_enableFileManager</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">filebase</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">ips</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">port</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">downloadBandwidth</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">uploadBandwidth</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.ts3server_enableFileManager" title="Link to this definition"></a><br /></dt>
<dd><p>Initialize the file transfer subsystem. Allows clients to store files on the machine the server is running on and download them. </p>
<p>If you want to support file transfer functionality, then call this function after calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a4eb2277bdac2e16f0d0fa2620fa73ecd"><span class="std std-ref">ts3server_initServerLib</span></a> If you dont call this function file transfer features will not be available. The server library will create the directories necessary for storing files as needed, however directories will not be cleaned up by the server library. Instead it is the responsibility of the application to clean up these directories when theyre no longer needed (e.g. after a virtual server was deleted)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filebase</strong> path to where the server library will create necessary directories and store files uploaded by clients. </p></li>
<li><p><strong>ips</strong> zero terminated array of IP addresses to listen on for file transfer connections. IPv4 and IPv6 addresses are supported, do NOT pass host names. If set to 0, it will be treated as if you passed { “0.0.0.0”, “::”, 0 } </p></li>
<li><p><strong>port</strong> the TCP port to listen on for file transfer connections. </p></li>
<li><p><strong>downloadBandwidth</strong> limit in bytes per second which is available for downloading files from the server. Speed across all transfers will be limited to this number. Specify BANDWIDTH_LIMIT_UNLIMITED for no limit. </p></li>
<li><p><strong>uploadBandwidth</strong> limit in bytes per second which is available for uploading files to the server. Speed across all transfers will be limited to this number. Specify BANDWIDTH_LIMIT_UNLIMITED for no limit. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>The filebase directory will be created by the server lib. The individual
files will be in a sub directory of the filebase called virtualserver_x
where x is the id of the virtual server. Individual channel files will be
in a directory channel_y within their respective server directory
where y is the channel id of the channel.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>These directories will automatically be created by the server if
they do not exist. It is the responsibility of the application
(not serverlib) to delete these directories when they are no
longer needed.</p>
</div>
</section>
<section id="callbacks">
<h2>Callbacks<a class="headerlink" href="#callbacks" title="Link to this heading"></a></h2>
<p>The server lib notifies about ongoing file transfers by optionally
calling a defined callback, which is called everytime a file upload
or download has finished.</p>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">onFileTransferEvent</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.FileTransferCallbackExport" title="FileTransferCallbackExport"><span class="n"><span class="pre">FileTransferCallbackExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called whenever a file transfer is done </p>
<dl class="field-list simple">
<dt class="field-odd">Param data<span class="colon">:</span></dt>
<dd class="field-odd"><p>pointer to a structure describing the file transfer that completed. See <a class="reference internal" href="../enumerations.html#struct_file_transfer_callback_export"><span class="std std-ref">FileTransferCallbackExport</span></a> for details. </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">FileTransferCallbackExport</span></span></span><br /></dt>
<dd><div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">clientID</span></span></span><br /></dt>
<dd><p>the client who started the file transfer </p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">transferID</span></span></span><br /></dt>
<dd><p>local identifier of the transfer that has completed </p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">remoteTransferID</span></span></span><br /></dt>
<dd><p>remote identifier of the transfer that has completed </p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">status</span></span></span><br /></dt>
<dd><p>status of the transfer. One of the values from the <a class="reference internal" href="../enumerations.html#public__definitions_8h_1aead4d4dfd9de00d5daaeeff10189dc76"><span class="std std-ref">FileTransferState</span></a> enum </p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">statusMessage</span></span></span><br /></dt>
<dd><p>utf8 encoded c string containing a human readable description of the status </p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">remotefileSize</span></span></span><br /></dt>
<dd><p>size in bytes of the complete file to be transferred </p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">bytes</span></span></span><br /></dt>
<dd><p>number of bytes transferred. Same as remotefileSize when the transfer completed entirely. </p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">isSender</span></span></span><br /></dt>
<dd><p>boolean. 1 if the server is sending the file. 0 if the server is receiving the file. </p>
</dd></dl>
</div>
</dd></dl>
</section>
<section id="rewriting-the-path-on-the-server">
<h2>Rewriting the path on the server<a class="headerlink" href="#rewriting-the-path-on-the-server" title="Link to this heading"></a></h2>
<p id="s-rewrite-path">The SDK allows users to control where files are stored on the server as well
as the file name the files have on the server side file system.
The intended file name and path is already set in the parameters of this
callback when it is called.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This feature is optional. If you dont need to rewrite file system paths
or file names, simply do not implement this callback.</p>
</div>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">onTransformFilePath</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">invokerClientID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.TransformFilePathExport" title="TransformFilePathExport"><span class="n"><span class="pre">TransformFilePathExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">original</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.TransformFilePathExportReturns" title="TransformFilePathExportReturns"><span class="n"><span class="pre">TransformFilePathExportReturns</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>Allows to rewrite the file path and name of the file to be transfered. Called when a transfer starts. </p>
<p>If you dont need to control server side file name and path then dont implement this callback. The parameters are already filled with the default values intended by the client starting the transfer. These can be changed as required. When the callback exits with <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> the transfer is started with the values present in the result struct. <p>See the <a class="reference internal" href="#s-rewrite-path"><span class="std std-ref">SDK documentation</span></a> for further details.</p>
</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param invokerClientID<span class="colon">:</span></dt>
<dd class="field-even"><p>the client which started the file transfer </p>
</dd>
<dt class="field-odd">Param original<span class="colon">:</span></dt>
<dd class="field-odd"><p>the original file path and name desired by the client </p>
</dd>
<dt class="field-even">Param result<span class="colon">:</span></dt>
<dd class="field-even"><p>the values from this struct will be used by the server when the callback exits. Already filled with a copy of original. Change the values in this struct as needed. </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p>a value from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum. Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to start the transfer with the values in the result struct. When returning an error code the file transfer is not started. </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>The length of the values present in the result <a class="reference internal" href="../enumerations.html#c.TransformFilePathExportReturns" title="TransformFilePathExportReturns"><code class="xref c c-struct docutils literal notranslate"><span class="pre">TransformFilePathExportReturns</span></code></a>
are limited and must not exceed the original length!</p>
</div>
</section>
<section id="permissions">
<h2>Permissions<a class="headerlink" href="#permissions" title="Link to this heading"></a></h2>
<p>The callbacks should return <a class="reference internal" href="../errors.html#c.Ts3ErrorType.ERROR_ok" title="ERROR_ok"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_ok</span></code></a> to allow the action or
<code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_permission</span></code> to deny it.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>If a callback is not implemented, the action will be allowed by default.</p>
</div>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferInitUpload</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftinitupload" title="ts3sc_ftinitupload"><span class="n"><span class="pre">ts3sc_ftinitupload</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a file is to be uploaded. Allows you to deny a client from uploading files, files above a certain size, etc. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client that attempts to upload the file. </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be uploaded. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferInitDownload</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftinitdownload" title="ts3sc_ftinitdownload"><span class="n"><span class="pre">ts3sc_ftinitdownload</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a file is to be downloaded. Allows you to deny a client from downloading files, files above a certain size, etc. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client that attempts to download the file </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be downloaded. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferGetFileInfo</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftgetfileinfo" title="ts3sc_ftgetfileinfo"><span class="n"><span class="pre">ts3sc_ftgetfileinfo</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client requests file information using <a class="reference internal" href="../client_api.html#clientlib_8h_1ae8c0b60065102c7010517b09769692af"><span class="std std-ref">ts3client_requestFileInfo</span></a>. Allows to deny clients from getting file information. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to get information of the file. </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file that information is requested for. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferGetFileList</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftgetfilelist" title="ts3sc_ftgetfilelist"><span class="n"><span class="pre">ts3sc_ftgetfilelist</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client requests a directory listing using <a class="reference internal" href="../client_api.html#clientlib_8h_1a2f4af115935ecae757bdbcb8443de7db"><span class="std std-ref">ts3client_requestFileList</span></a>. Allows to deny listing files and directories in channels / directories. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferDeleteFile</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftdeletefile" title="ts3sc_ftdeletefile"><span class="n"><span class="pre">ts3sc_ftdeletefile</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client attempts to delete one or more files using <a class="reference internal" href="../client_api.html#clientlib_8h_1ad51a44944e06592bea370599ba282f44"><span class="std std-ref">ts3client_requestDeleteFile</span></a>. Allows denying clients deleting files. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to delete the file </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be deleted </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferCreateDirectory</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftcreatedir" title="ts3sc_ftcreatedir"><span class="n"><span class="pre">ts3sc_ftcreatedir</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a directory is to be created using <a class="reference internal" href="../client_api.html#clientlib_8h_1af5c0dbb932a7f25b11d19602a4f70cf7"><span class="std std-ref">ts3client_requestCreateDirectory</span></a>. Allows to deny creating certain directories. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to create the directory </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the directory to create. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferRenameFile</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftrenamefile" title="ts3sc_ftrenamefile"><span class="n"><span class="pre">ts3sc_ftrenamefile</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a file is to be renamed or moved using <a class="reference internal" href="../client_api.html#clientlib_8h_1ab13be97ad87ab9b10c38f75d5ad74c41"><span class="std std-ref">ts3client_requestRenameFile</span></a>. Allows to deny moving files or even renaming files. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to rename or move the file. </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be renamed or moved, and where the file should be moved to if its being moved. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="disable-commands.html" class="btn btn-neutral float-left" title="Disabling protocol commands" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="faq.html" class="btn btn-neutral float-right" title="FAQ" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,216 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Bandwidth and Traffic &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Managing channels" href="channels.html" />
<link rel="prev" title="Server information" href="info-server.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="info.html">Retrieve and store information</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="info-client.html">Client information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-server.html">Server information</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Bandwidth and Traffic</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#query-values">Query values</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="info.html">Retrieve and store information</a></li>
<li class="breadcrumb-item active">Bandwidth and Traffic</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="bandwidth-and-traffic">
<h1>Bandwidth and Traffic<a class="headerlink" href="#bandwidth-and-traffic" title="Link to this heading"></a></h1>
<p>The server offers information about the currently used bandwidth by the server
as well as for file transfers.</p>
<p>The available variables to be queried are specified in the <a class="reference internal" href="../properties.html#c.ConnectionProperties" title="ConnectionProperties"><code class="xref c c-enum docutils literal notranslate"><span class="pre">ConnectionProperties</span></code></a> and <code class="xref c c-enum docutils literal notranslate"><span class="pre">ConnectionPropertiesSDK</span></code> enums.</p>
<p>However only the following values can be queried server side:
<a class="reference internal" href="../properties.html#c.ConnectionProperties.CONNECTION_PACKETS_SENT_TOTAL" title="CONNECTION_PACKETS_SENT_TOTAL"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CONNECTION_PACKETS_SENT_TOTAL</span></code></a>
<a class="reference internal" href="../properties.html#c.ConnectionProperties.CONNECTION_BYTES_SENT_TOTAL" title="CONNECTION_BYTES_SENT_TOTAL"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CONNECTION_BYTES_SENT_TOTAL</span></code></a>
<a class="reference internal" href="../properties.html#c.ConnectionProperties.CONNECTION_PACKETS_RECEIVED_TOTAL" title="CONNECTION_PACKETS_RECEIVED_TOTAL"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CONNECTION_PACKETS_RECEIVED_TOTAL</span></code></a>
<a class="reference internal" href="../properties.html#c.ConnectionProperties.CONNECTION_BYTES_RECEIVED_TOTAL" title="CONNECTION_BYTES_RECEIVED_TOTAL"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CONNECTION_BYTES_RECEIVED_TOTAL</span></code></a>
<a class="reference internal" href="../properties.html#c.ConnectionProperties.CONNECTION_BANDWIDTH_SENT_LAST_SECOND_TOTAL" title="CONNECTION_BANDWIDTH_SENT_LAST_SECOND_TOTAL"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CONNECTION_BANDWIDTH_SENT_LAST_SECOND_TOTAL</span></code></a>
<a class="reference internal" href="../properties.html#c.ConnectionProperties.CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_TOTAL" title="CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_TOTAL"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_TOTAL</span></code></a>
<a class="reference internal" href="../properties.html#c.ConnectionProperties.CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_TOTAL" title="CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_TOTAL"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_TOTAL</span></code></a>
<a class="reference internal" href="../properties.html#c.ConnectionProperties.CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_TOTAL" title="CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_TOTAL"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_TOTAL</span></code></a></p>
<section id="query-values">
<h2>Query values<a class="headerlink" href="#query-values" title="Link to this heading"></a></h2>
<p>To query these values use the following functions based on the type of information you want to receive:</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVirtualServerConnectionVariableAsDouble</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ConnectionProperties" title="ConnectionProperties"><span class="n"><span class="pre">ConnectionProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">double</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get value of server connection properties as double </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> which server to get connection properties of </p></li>
<li><p><strong>flag</strong> specifies which value to get. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a050954dff4a89322d463770f688b1f65"><span class="std std-ref">ConnectionProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the connection property. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVirtualServerConnectionVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ConnectionProperties" title="ConnectionProperties"><span class="n"><span class="pre">ConnectionProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get value of server connection properties as unsigned integer. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> which server to get connection properties of </p></li>
<li><p><strong>flag</strong> specifies which property to get the value of. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a050954dff4a89322d463770f688b1f65"><span class="std std-ref">ConnectionProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the connection property </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="info-server.html" class="btn btn-neutral float-left" title="Server information" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="channels.html" class="btn btn-neutral float-right" title="Managing channels" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,348 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Channel information &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Server information" href="info-server.html" />
<link rel="prev" title="Client information" href="info-client.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="info.html">Retrieve and store information</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="info-client.html">Client information</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Channel information</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#query-channel-information">Query channel information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#examples">Examples</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#setting-channel-information">Setting channel information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">Examples</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="info-server.html">Server information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-bandwidth.html">Bandwidth and Traffic</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="info.html">Retrieve and store information</a></li>
<li class="breadcrumb-item active">Channel information</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="channel-information">
<h1>Channel information<a class="headerlink" href="#channel-information" title="Link to this heading"></a></h1>
<p>Querying and modifying information related to channels is similar to
dealing with clients.</p>
<p>Available properties are described in the <a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><code class="xref c c-enum docutils literal notranslate"><span class="pre">ChannelProperties</span></code></a> enum.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The server always has all the information about all channels.</p>
<p>Limitations regarding availability mentioned for the variables are thus of no concern for the server.</p>
</div>
<section id="query-channel-information">
<h2>Query channel information<a class="headerlink" href="#query-channel-information" title="Link to this heading"></a></h2>
<p>To query channel information use one of the following functions, depending
on the type of the information you want to query.</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><span class="n"><span class="pre">ChannelProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get value of a channel variable as integer. </p>
<p>Not all variables are available as integer, some are only available as string or unsigned 64 bit integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the channel is located on </p></li>
<li><p><strong>channelID</strong> the id of the channel to get the variable for </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1ab1d8599705a3a954dc5dce71774488fc"><span class="std std-ref">ChannelProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the queried variable. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><span class="n"><span class="pre">ChannelProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get value of a channel variable as unsigned 64 bit integer. </p>
<p>Not all variables are available as unsigned 64 bit integer, some are only available as string or integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the channel is located on </p></li>
<li><p><strong>channelID</strong> the id of the channel to get the variable for </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1ab1d8599705a3a954dc5dce71774488fc"><span class="std std-ref">ChannelProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the queried variable. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelVariableAsString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><span class="n"><span class="pre">ChannelProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get value of a channel variable as string. </p>
<p>Not all variables are available as string, some are only available as integer or unsigned 64 bit integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the channel is located on </p></li>
<li><p><strong>channelID</strong> the id of the channel to get the variable for </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1ab1d8599705a3a954dc5dce71774488fc"><span class="std std-ref">ChannelProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the queried variable. Memory is allocated by the server library and caller must free it using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="examples">
<h3>Examples<a class="headerlink" href="#examples" title="Link to this heading"></a></h3>
<p>Query topic of channel with ID 123:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="n">uint64</span><span class="w"> </span><span class="n">channelID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">123</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Channel ID in our exampel */</span>
<span class="linenos">2</span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">topic</span><span class="p">;</span>
<span class="linenos">3</span>
<span class="linenos">4</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_getChannelVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">channel</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_TOPIC</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">topic</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">5</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Topic of channel %u is: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">channelID</span><span class="p">,</span><span class="w"> </span><span class="n">topic</span><span class="p">);</span>
<span class="linenos">6</span><span class="w"> </span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">topic</span><span class="p">);</span>
<span class="linenos">7</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
<section id="setting-channel-information">
<h2>Setting channel information<a class="headerlink" href="#setting-channel-information" title="Link to this heading"></a></h2>
<p>Channel properties can be modified with:</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setChannelVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><span class="n"><span class="pre">ChannelProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the variable of a channel to a new value. </p>
<p>Call <a class="reference internal" href="../server_api.html#serverlib_8h_1ac4eb0eaedc70cfef1d3ceccfebcfd971"><span class="std std-ref">ts3server_flushChannelVariable</span></a> after having set all variables you need to change.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the channel is located on </p></li>
<li><p><strong>channelID</strong> specifies the channel on which to change the variable </p></li>
<li><p><strong>flag</strong> specifies which variable to change. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1ab1d8599705a3a954dc5dce71774488fc"><span class="std std-ref">ChannelProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setChannelVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><span class="n"><span class="pre">ChannelProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set a channel variable </p>
<p>Call <a class="reference internal" href="../server_api.html#serverlib_8h_1ac4eb0eaedc70cfef1d3ceccfebcfd971"><span class="std std-ref">ts3server_flushChannelVariable</span></a> after having set all variables you need to change.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the id of the channel to set the variable for </p></li>
<li><p><strong>flag</strong> specifies which variable to set. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1ab1d8599705a3a954dc5dce71774488fc"><span class="std std-ref">ChannelProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setChannelVariableAsString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ChannelProperties" title="ChannelProperties"><span class="n"><span class="pre">ChannelProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Call <a class="reference internal" href="../server_api.html#serverlib_8h_1ac4eb0eaedc70cfef1d3ceccfebcfd971"><span class="std std-ref">ts3server_flushChannelVariable</span></a> after having set all variables you need to change. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the id of the channel to set the variable for </p></li>
<li><p><strong>flag</strong> specifies which variable to set. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1ab1d8599705a3a954dc5dce71774488fc"><span class="std std-ref">ChannelProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>After modifying one or more channel variables, you <strong>must</strong> flush the
changes using <a class="reference internal" href="../server_api.html#c.ts3server_flushChannelVariable" title="ts3server_flushChannelVariable"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_flushChannelVariable()</span></code></a>.</p>
</div>
<p>The idea behind flushing is, one can modify multiple values by calling
<a class="reference internal" href="channel-create.html#c.ts3server_setChannelVariableAsString" title="ts3server_setChannelVariableAsString"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setChannelVariableAsString()</span></code></a>, <a class="reference internal" href="channel-create.html#c.ts3server_setChannelVariableAsInt" title="ts3server_setChannelVariableAsInt"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setChannelVariableAsInt()</span></code></a> and
<a class="reference internal" href="channel-create.html#c.ts3server_setChannelVariableAsUInt64" title="ts3server_setChannelVariableAsUInt64"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setChannelVariableAsUInt64()</span></code></a> multiple times for a channel and then apply all changes in one step.</p>
<section id="id1">
<h3>Examples<a class="headerlink" href="#id1" title="Link to this heading"></a></h3>
<p>Change the channel name and topic:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="cm">/* Modify channel name */</span>
<span class="linenos"> 2</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">channelID</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_NAME</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;New channel name&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 3</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error setting channel name</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos"> 4</span><span class="p">}</span>
<span class="linenos"> 5</span>
<span class="linenos"> 6</span><span class="cm">/* Modify channel topic */</span>
<span class="linenos"> 7</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setChannelVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">channelID</span><span class="p">,</span><span class="w"> </span><span class="n">CHANNEL_TOPIC</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;New channel topic&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 8</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error setting channel topic</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos"> 9</span><span class="p">}</span>
<span class="linenos">10</span>
<span class="linenos">11</span><span class="cm">/* Flush changes */</span>
<span class="linenos">12</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_flushChannelVariable</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">channelID</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">13</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error flushing channel variable</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">14</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="info-client.html" class="btn btn-neutral float-left" title="Client information" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="info-server.html" class="btn btn-neutral float-right" title="Server information" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,373 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Client information &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Channel information" href="info-channel.html" />
<link rel="prev" title="Retrieve and store information" href="info.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="info.html">Retrieve and store information</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">Client information</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#query-client-information">Query client information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#setting-client-information">Setting client information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#examples">Examples</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-server.html">Server information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-bandwidth.html">Bandwidth and Traffic</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="info.html">Retrieve and store information</a></li>
<li class="breadcrumb-item active">Client information</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="client-information">
<h1>Client information<a class="headerlink" href="#client-information" title="Link to this heading"></a></h1>
<p>Information about the clients currently connected to the virtual server
can be retrieved and modified.</p>
<p>Available variables are listed in the <a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><code class="xref c c-enum docutils literal notranslate"><span class="pre">ClientProperties</span></code></a> enum.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The server always has all the information about all clients as long as they are
connected to the server.</p>
<p>Limitations regarding availability mentioned for the variables are thus of no concern for the server.</p>
</div>
<section id="query-client-information">
<h2>Query client information<a class="headerlink" href="#query-client-information" title="Link to this heading"></a></h2>
<p>To query client related information, use one of the following functions depending on the
type of the variable you are going to query.</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getClientVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a client variable as integer. </p>
<p>Not all variables are available as integer, some are only available as string or unsigned 64 bit integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the variable queried. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getClientVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a client variable as unsigned 64 bit integer. </p>
<p>Not all variables are available as unsigned 64 bit integer, some are only available as string or integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the variable queried. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getClientVariableAsString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of the client variable as string </p>
<p>Not all variables are available as string, some are only available as unsigned 64 bit integer or integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>result</strong> address of a variable to receive the value of the variable queried. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="example">
<h3>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h3>
<p>Query nickname of client with ID 123:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">error</span><span class="p">;</span>
<span class="linenos"> 2</span><span class="n">anyID</span><span class="w"> </span><span class="n">clientID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">123</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Client ID in our example */</span>
<span class="linenos"> 3</span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">nickname</span><span class="p">;</span>
<span class="linenos"> 4</span>
<span class="linenos"> 5</span><span class="k">if</span><span class="w"> </span><span class="p">((</span><span class="n">error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ts3server_getClientVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_NICKNAME</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">nickname</span><span class="p">))</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error querying client nickname: %d</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">error</span><span class="p">);</span>
<span class="linenos"> 7</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos"> 8</span><span class="p">}</span>
<span class="linenos"> 9</span>
<span class="linenos">10</span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Client nickname is: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">nickname</span><span class="p">);</span>
<span class="linenos">11</span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">nickname</span><span class="p">);</span>
</pre></div>
</div>
</section>
</section>
<section id="setting-client-information">
<h2>Setting client information<a class="headerlink" href="#setting-client-information" title="Link to this heading"></a></h2>
<p>Client information can be modified with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setClientVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the value of a client variable. </p>
<p>Not all variables can be set as integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setClientVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the value of a client variable. </p>
<p>Not all variables can be set as unsigned 64 bit integer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setClientVariableAsString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.ClientProperties" title="ClientProperties"><span class="n"><span class="pre">ClientProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set the value of a client variable. </p>
<p>Not all variables can be set as string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> which client to query </p></li>
<li><p><strong>flag</strong> specifies which variable to retrieve. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1a107aa6e685b210b43b62c6227252bb01"><span class="std std-ref">ClientProperties</span></a> enum. </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>After modifying one or more client variables, you <strong>must</strong> flush the
changes using <a class="reference internal" href="../server_api.html#c.ts3server_flushClientVariable" title="ts3server_flushClientVariable"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_flushClientVariable()</span></code></a>.</p>
</div>
<p>The idea behind flushing is, one can modify multiple values by calling
<a class="reference internal" href="clients.html#c.ts3server_setClientVariableAsString" title="ts3server_setClientVariableAsString"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setClientVariableAsString()</span></code></a>, <a class="reference internal" href="clients.html#c.ts3server_setClientVariableAsInt" title="ts3server_setClientVariableAsInt"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setClientVariableAsInt()</span></code></a> and
<a class="reference internal" href="clients.html#c.ts3server_setClientVariableAsUInt64" title="ts3server_setClientVariableAsUInt64"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setClientVariableAsUInt64()</span></code></a> for a client and then apply all changes in one step.</p>
<section id="examples">
<h3>Examples<a class="headerlink" href="#examples" title="Link to this heading"></a></h3>
<p>To change the nickname of the client with ID 55 to “Joe”:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="n">anyID</span><span class="w"> </span><span class="n">clientID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">55</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Client ID in our example */</span>
<span class="linenos"> 2</span>
<span class="linenos"> 3</span><span class="cm">/* Modifiy data */</span>
<span class="linenos"> 4</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setClientVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_NICKNAME</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;Joe&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 5</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error setting client nickname</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos"> 7</span><span class="p">}</span>
<span class="linenos"> 8</span>
<span class="linenos"> 9</span><span class="cm">/* Flush changes */</span>
<span class="linenos">10</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_flushClientVariable</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">11</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error flushing client variable</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">12</span><span class="p">}</span>
</pre></div>
</div>
<p>Changing multiple variables is as simple as:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="n">anyID</span><span class="w"> </span><span class="n">clientID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">66</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Client ID in our example */</span>
<span class="linenos"> 2</span>
<span class="linenos"> 3</span><span class="cm">/* Modify data 1 */</span>
<span class="linenos"> 4</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setClientVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_NICKNAME</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;bob&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 5</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error setting nickname</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos"> 7</span><span class="p">}</span>
<span class="linenos"> 8</span>
<span class="linenos"> 9</span><span class="cm">/* Modify data 2 */</span>
<span class="linenos">10</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setClientVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">,</span><span class="w"> </span><span class="n">CLIENT_META_DATA</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;some data&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">11</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error setting meta data</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">12</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos">13</span><span class="p">}</span>
<span class="linenos">14</span>
<span class="linenos">15</span><span class="cm">/* Flush changes */</span>
<span class="linenos">16</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_flushClientVariable</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">clientID</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">17</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error flushing client variable&quot;</span><span class="p">);</span>
<span class="linenos">18</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="info.html" class="btn btn-neutral float-left" title="Retrieve and store information" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="info-channel.html" class="btn btn-neutral float-right" title="Channel information" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,334 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Server information &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Bandwidth and Traffic" href="info-bandwidth.html" />
<link rel="prev" title="Channel information" href="info-channel.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="info.html">Retrieve and store information</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="info-client.html">Client information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Server information</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#query-server-information">Query server information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#change-server-information">Change server information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">Example</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="info-bandwidth.html">Bandwidth and Traffic</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="info.html">Retrieve and store information</a></li>
<li class="breadcrumb-item active">Server information</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="server-information">
<h1>Server information<a class="headerlink" href="#server-information" title="Link to this heading"></a></h1>
<p>Information related to a virtual server can be queried and modified.</p>
<p>Available server properties are described in <a class="reference internal" href="../properties.html#c.VirtualServerProperties" title="VirtualServerProperties"><code class="xref c c-enum docutils literal notranslate"><span class="pre">VirtualServerProperties</span></code></a> and <code class="xref c c-enum docutils literal notranslate"><span class="pre">VirtualServerPropertiesSDK</span></code>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The server always has all the information about all servers that exist.</p>
<p>Limitations regarding availability mentioned for the variables are thus of no concern for the server.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Servers that are stopped using <a class="reference internal" href="vserver-manage.html#c.ts3server_stopVirtualServer" title="ts3server_stopVirtualServer"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_stopVirtualServer()</span></code></a> no longer exist within the
server library and querying them will thus fail.</p>
</div>
<section id="query-server-information">
<h2>Query server information<a class="headerlink" href="#query-server-information" title="Link to this heading"></a></h2>
<p>To query server information use one of the following functions, depending
on the type of the information you want to query.</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVirtualServerVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.VirtualServerProperties" title="VirtualServerProperties"><span class="n"><span class="pre">VirtualServerProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a server variable </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server of which to get a variable value </p></li>
<li><p><strong>flag</strong> specifies for which variable to get the value. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the result </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVirtualServerVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.VirtualServerProperties" title="VirtualServerProperties"><span class="n"><span class="pre">VirtualServerProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a server variable </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server of which to get a variable value </p></li>
<li><p><strong>flag</strong> specifies for which variable to get the value. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive the result. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVirtualServerVariableAsString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.VirtualServerProperties" title="VirtualServerProperties"><span class="n"><span class="pre">VirtualServerProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the value of a server variable </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server of which to get a variable value </p></li>
<li><p><strong>flag</strong> specifies for which variable to get the value. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>result</strong> address of a variable to receive a utf8 encoded c string containing the value. Memory is allocated by the server library and must be freed by the caller using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="example">
<h3>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h3>
<p>Example checking the number of clients online, obviously an integer
value:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="kt">int</span><span class="w"> </span><span class="n">clientsOnline</span><span class="p">;</span>
<span class="linenos">2</span>
<span class="linenos">3</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_getVirtualServerVariableAsInt</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">VIRTUALSERVER_CLIENTS_ONLINE</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">clientsOnline</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">4</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;There are %d clients online</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">clientsOnline</span><span class="p">);</span>
<span class="linenos">5</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
<section id="change-server-information">
<h2>Change server information<a class="headerlink" href="#change-server-information" title="Link to this heading"></a></h2>
<p>Server information can be modified using</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setVirtualServerVariableAsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.VirtualServerProperties" title="VirtualServerProperties"><span class="n"><span class="pre">VirtualServerProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set a new value for a server variable </p>
<p>After youre done setting all the variables you need to change, a call to <a class="reference internal" href="../server_api.html#serverlib_8h_1a5e65abfcdaf9a5c9b70c4fe97200935b"><span class="std std-ref">ts3server_flushVirtualServerVariable</span></a> is necessary to publish the changes</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies which server to set the variable on </p></li>
<li><p><strong>flag</strong> specifies which server variable to set. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setVirtualServerVariableAsUInt64</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.VirtualServerProperties" title="VirtualServerProperties"><span class="n"><span class="pre">VirtualServerProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set a new value for a server variable </p>
<p>After youre done setting all the variables you need to change, a call to <a class="reference internal" href="../server_api.html#serverlib_8h_1a5e65abfcdaf9a5c9b70c4fe97200935b"><span class="std std-ref">ts3server_flushVirtualServerVariable</span></a> is necessary to publish the changes</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies which server to set the variable on </p></li>
<li><p><strong>flag</strong> specifies which server variable to set. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setVirtualServerVariableAsString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="k"><span class="pre">enum</span></span><span class="w"> </span><a class="reference internal" href="../properties.html#c.VirtualServerProperties" title="VirtualServerProperties"><span class="n"><span class="pre">VirtualServerProperties</span></span></a><span class="w"> </span><span class="n"><span class="pre">flag</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set a new value for a server variable </p>
<p>After youre done setting all the variables you need to change, a call to <a class="reference internal" href="../server_api.html#serverlib_8h_1a5e65abfcdaf9a5c9b70c4fe97200935b"><span class="std std-ref">ts3server_flushVirtualServerVariable</span></a> is necessary to publish the changes</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies which server to set the variable on </p></li>
<li><p><strong>flag</strong> specifies which server variable to set. One of the values from the <a class="reference internal" href="../properties.html#public__definitions_8h_1adcce9c82f0123acf4ab8f75ef5be93f9"><span class="std std-ref">VirtualServerProperties</span></a> enum </p></li>
<li><p><strong>value</strong> the new value to set </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>After modifying one or more server variables, you <strong>must</strong> flush the
changes using <a class="reference internal" href="../server_api.html#c.ts3server_flushVirtualServerVariable" title="ts3server_flushVirtualServerVariable"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_flushVirtualServerVariable()</span></code></a>.</p>
</div>
<section id="id1">
<h3>Example<a class="headerlink" href="#id1" title="Link to this heading"></a></h3>
<p>Example: Change the servers welcome message:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_setVirtualServerVariableAsString</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">VIRTUALSERVER_WELCOMEMESSAGE</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;New welcome message&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">2</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error setting server welcomemessage</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">3</span><span class="w"> </span><span class="k">return</span><span class="p">;</span>
<span class="linenos">4</span><span class="p">}</span>
<span class="linenos">5</span>
<span class="linenos">6</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_flushVirtualServerVariable</span><span class="p">(</span><span class="n">serverID</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">7</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Error flushing server variable</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="linenos">8</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="info-channel.html" class="btn btn-neutral float-left" title="Channel information" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="info-bandwidth.html" class="btn btn-neutral float-right" title="Bandwidth and Traffic" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,192 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Retrieve and store information &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Client information" href="info-client.html" />
<link rel="prev" title="Advanced virtual server creation" href="advanced-create.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Retrieve and store information</a><ul>
<li class="toctree-l2"><a class="reference internal" href="info-client.html">Client information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html">Channel information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-server.html">Server information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-bandwidth.html">Bandwidth and Traffic</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Retrieve and store information</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="retrieve-and-store-information">
<h1>Retrieve and store information<a class="headerlink" href="#retrieve-and-store-information" title="Link to this heading"></a></h1>
<p>The Server Lib stores various pieces of information, which is made
available to the user. This chapter covers how to query and
store data in the Server Lib.</p>
<p>All strings passed to and from the Server Lib need to be encoded in
UTF-8 format.</p>
<p>Many variables are read only and cannot be changed directly using the functions discussed
in this chapter.</p>
<p>See the <a class="reference internal" href="../properties.html#x-properties"><span class="std std-ref">Properties</span></a> page for information on what
is available when and which function to use to query or set (if available) each property.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="info-client.html">Client information</a><ul>
<li class="toctree-l2"><a class="reference internal" href="info-client.html#query-client-information">Query client information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-client.html#setting-client-information">Setting client information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="info-channel.html">Channel information</a><ul>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html#query-channel-information">Query channel information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-channel.html#setting-channel-information">Setting channel information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="info-server.html">Server information</a><ul>
<li class="toctree-l2"><a class="reference internal" href="info-server.html#query-server-information">Query server information</a></li>
<li class="toctree-l2"><a class="reference internal" href="info-server.html#change-server-information">Change server information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="info-bandwidth.html">Bandwidth and Traffic</a><ul>
<li class="toctree-l2"><a class="reference internal" href="info-bandwidth.html#query-values">Query values</a></li>
</ul>
</li>
</ul>
</div>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="advanced-create.html" class="btn btn-neutral float-left" title="Advanced virtual server creation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="info-client.html" class="btn btn-neutral float-right" title="Client information" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,245 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Introduction &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Getting started" href="basic.html" />
<link rel="prev" title="TeamSpeak Server Functions" href="../server_api.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Introduction</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#system-requirements">System requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="#usage">Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="#calling-server-lib-functions">Calling Server lib functions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Introduction</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="introduction">
<h1>Introduction<a class="headerlink" href="#introduction" title="Link to this heading"></a></h1>
<p>This document describes server-side programming with the TeamSpeak 3
SDK. The SDK user will be able to create a custom TeamSpeak 3 server
binary using the provided server API and library.</p>
<section id="system-requirements">
<h2>System requirements<a class="headerlink" href="#system-requirements" title="Link to this heading"></a></h2>
<p>For developing third-party servers with the TeamSpeak 3 Server Lib the
following system requirements apply:</p>
<ul class="simple">
<li><p>Windows 7, 8.1, 10</p></li>
<li><p>Mac OS X 10.6 and above</p></li>
<li><p>Any recent Linux distribution with libstdc++ 6</p></li>
</ul>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>The calling convention used in the functions exported by the shared
TeamSpeak 3 SDK libaries is <strong>cdecl</strong>. You must not use another calling
convention, like stdcall on Windows, when declaring function pointers
to the TeamSpeak 3 SDK libraries. Otherwise stack corruption at
runtime may occur.</p>
</div>
</section>
<section id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Link to this heading"></a></h2>
<p>All the required files are located in the <cite>bin</cite> directory of the
TeamSpeak 3 SDK distribution.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The license file <cite>licensekey.dat</cite> needs to be located in the same
folder as your server executable.</p>
</div>
<p>If no license key is present, the server will run with the following
limitations:</p>
<ul class="simple">
<li><p>One server process per machine</p></li>
<li><p>One virtual server per process</p></li>
<li><p>Limited to 32 slots maximum</p></li>
</ul>
<p>For more detailed information about licensing of TeamSpeak 3 servers or
to obtain a license, please contact <a class="reference external" href="mailto:sales&#37;&#52;&#48;teamspeakusa&#46;com">sales<span>&#64;</span>teamspeakusa<span>&#46;</span>com</a>.</p>
</section>
<section id="calling-server-lib-functions">
<span id="s-calling"></span><h2>Calling Server lib functions<a class="headerlink" href="#calling-server-lib-functions" title="Link to this heading"></a></h2>
<p>Server library functions follow a common pattern. They always return a value
from the <a class="reference internal" href="../errors.html#c.Ts3ErrorType" title="Ts3ErrorType"><code class="xref c c-enum docutils literal notranslate"><span class="pre">Ts3ErrorType</span></code></a> enum, which indicates success (<a class="reference internal" href="../errors.html#c.Ts3ErrorType.ERROR_ok" title="ERROR_ok"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_ok</span></code></a>) or an error.
If there is a result variable, it is always the last variable in the
parameter list.</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">ERROR</span><span class="w"> </span><span class="nf">ts3server_FUNCNAME</span><span class="p">(</span><span class="n">arg1</span><span class="p">,</span><span class="w"> </span><span class="n">arg2</span><span class="p">,</span><span class="w"> </span><span class="p">...,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">result</span><span class="p">);</span>
</pre></div>
</div>
<p>Result variables should <strong>only</strong> be accessed if the function returned
<a class="reference internal" href="../errors.html#c.Ts3ErrorType.ERROR_ok" title="ERROR_ok"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_ok</span></code></a>. Otherwise the state of the result variable is undefined.</p>
<p>In those cases where the result variable is a basic type (int, float
etc.), the memory for the result variable has to be declared by the
caller. Simply pass the address of the variable to the Server Lib
function <a class="reference internal" href="../server_api.html#c.ts3server_freeMemory" title="ts3server_freeMemory"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_freeMemory()</span></code></a>.</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">int</span><span class="w"> </span><span class="n">result</span><span class="p">;</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_XXX</span><span class="p">(</span><span class="n">arg1</span><span class="p">,</span><span class="w"> </span><span class="n">arg2</span><span class="p">,</span><span class="w"> </span><span class="p">...,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">result</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="cm">/* Use result variable */</span>
<span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="cm">/* Handle error, result variable is undefined */</span>
<span class="p">}</span>
</pre></div>
</div>
<p>If the result variable is a pointer type (C strings, arrays etc.), the
memory is allocated by the Server Lib function. In this case, the caller
has to release the allocated memory later by using <a class="reference internal" href="../server_api.html#c.ts3server_freeMemory" title="ts3server_freeMemory"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_freeMemory()</span></code></a> except when stated otherwise.</p>
<p>It is important to <strong>only</strong> access and release the memory if the function
returned <a class="reference internal" href="../errors.html#c.Ts3ErrorType.ERROR_ok" title="ERROR_ok"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_ok</span></code></a>. Should the function return an error, the result variable
is uninitialized, so freeing or accessing it could crash the application.</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">result</span><span class="p">;</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_XXX</span><span class="p">(</span><span class="n">arg1</span><span class="p">,</span><span class="w"> </span><span class="n">arg2</span><span class="p">,</span><span class="w"> </span><span class="p">...,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">result</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="cm">/* Use result variable */</span>
<span class="w"> </span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">result</span><span class="p">);</span><span class="w"> </span><span class="cm">/* Release result variable */</span>
<span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="cm">/* Handle error, result variable is undefined. Do not access or release it. */</span>
<span class="p">}</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Server Lib functions are <strong>thread-safe</strong>. It is possible to access the
Server Lib from several threads at the same time.</p>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="../server_api.html" class="btn btn-neutral float-left" title="TeamSpeak Server Functions" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="basic.html" class="btn btn-neutral float-right" title="Getting started" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,318 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>List available clients, channels, servers &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Create and stop virtual servers" href="vserver-manage.html" />
<link rel="prev" title="Getting started" href="basic.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">List available clients, channels, servers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#list-servers">List servers</a></li>
<li class="toctree-l2"><a class="reference internal" href="#list-clients">List clients</a></li>
<li class="toctree-l2"><a class="reference internal" href="#list-channels">List channels</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#examples">Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">List available clients, channels, servers</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="list-available-clients-channels-servers">
<h1>List available clients, channels, servers<a class="headerlink" href="#list-available-clients-channels-servers" title="Link to this heading"></a></h1>
<section id="list-servers">
<h2>List servers<a class="headerlink" href="#list-servers" title="Link to this heading"></a></h2>
<p>A list of all virtual servers can be queried with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVirtualServerList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get a list of virtual servers in this instance </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>result</strong> address of a variable to receive a zero terminated array of virtual server ids. Like {4, 8, …, 0} Memory is allocated by the server library and caller must free the array using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Unless specified otherwise using <a class="reference internal" href="advanced-create.html#s-server-create-advanced"><span class="std std-ref">advanced server creation</span></a> the
first virtual server has ID 1.</p>
</div>
</section>
<section id="list-clients">
<h2>List clients<a class="headerlink" href="#list-clients" title="Link to this heading"></a></h2>
<p>A list of all clients currently online on the specified virtual server
can be queried with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getClientList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get a list of all clients connected to a server </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server on which to get the list of clients </p></li>
<li><p><strong>result</strong> address of a variable to receive the zero terminated list of clients, like {1, 2, 50, …, 0} Memory is allocated by the server library and caller must free the array using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>To get a list of all clients currently in the specified channel</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelClientList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get list of clients in a channel </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the channel of which to get the list of clients </p></li>
<li><p><strong>result</strong> address of a variable to receive a zero terminated array of client ids in the channel. Like {3, 5, 39, …, 0} Memory is allocated by the server library and caller must free the array using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="list-channels">
<h2>List channels<a class="headerlink" href="#list-channels" title="Link to this heading"></a></h2>
<p>A list of all channels currently available on the specified virtual
server can be queried with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>list all channels on the server </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server to get the list of channels on </p></li>
<li><p><strong>result</strong> address of a variable to receive a zero terminted array of channel ids. Like {4, 65, 23, …, 0} Memory is allocated by the server library and caller must free the array using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>To query the current channel of a client use</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getChannelOfClient</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the id of the clients current channel </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies the server the client is on </p></li>
<li><p><strong>clientID</strong> the client to get the channel of </p></li>
<li><p><strong>result</strong> address of a variable to receive the channel id </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>Get the parent channel of a given channel with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getParentChannelOfChannel</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>get the parent channel of a channel </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which the channel is located </p></li>
<li><p><strong>channelID</strong> the channel of which to get the parent channel </p></li>
<li><p><strong>result</strong> address of a variable to receive the parent channel id </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<section id="example">
<h3>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h3>
<p>Example to print a list of all channels on a virtual server:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="n">uint64</span><span class="o">*</span><span class="w"> </span><span class="n">channels</span><span class="p">;</span>
<span class="linenos">2</span>
<span class="linenos">3</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_getChannelList</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">channels</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">4</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">channels</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">5</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Channel ID: %u</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">channels</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
<span class="linenos">6</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">7</span><span class="w"> </span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">channels</span><span class="p">);</span>
<span class="linenos">8</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
<section id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Link to this heading"></a></h2>
<p>Example to print all clients who are member of the channel with ID 123:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="n">uint64</span><span class="w"> </span><span class="n">channelID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">123</span><span class="p">;</span><span class="w"> </span><span class="cm">/* ID in our example */</span>
<span class="linenos">2</span><span class="n">anyID</span><span class="o">*</span><span class="w"> </span><span class="n">clients</span><span class="p">;</span>
<span class="linenos">3</span>
<span class="linenos">4</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">ts3server_getChannelClientList</span><span class="p">(</span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="n">channelID</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">clients</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">5</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">clients</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos">6</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Client ID: %u</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">clients</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
<span class="linenos">7</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">8</span><span class="w"> </span><span class="n">ts3server_freeMemory</span><span class="p">(</span><span class="n">clients</span><span class="p">);</span>
<span class="linenos">9</span><span class="p">}</span>
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="basic.html" class="btn btn-neutral float-left" title="Getting started" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="vserver-manage.html" class="btn btn-neutral float-right" title="Create and stop virtual servers" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,286 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Custom passwords &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Permission checks" href="permissions.html" />
<link rel="prev" title="Custom encryption" href="encryption.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Custom passwords</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#password-encryption">Password Encryption</a></li>
<li class="toctree-l2"><a class="reference internal" href="#password-validation">Password validation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#server-password">Server password</a></li>
<li class="toctree-l3"><a class="reference internal" href="#channel-password">Channel password</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Custom passwords</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="custom-passwords">
<h1>Custom passwords<a class="headerlink" href="#custom-passwords" title="Link to this heading"></a></h1>
<p>The TeamSpeak SDK optionally allows you to do custom password handling.
This allows to check TeamSpeak server and channel passwords against an
outside datasources, like LDAP or other databases.</p>
<p>To implement custom passwords, both server and client need to add custom
callbacks, which will be spontaneously called whenever a password check
is done in TeamSpeak. The SDK developer can implement own checks to
validate the password instead of using the TeamSpeak built-in mechanism.</p>
<section id="password-encryption">
<h2>Password Encryption<a class="headerlink" href="#password-encryption" title="Link to this heading"></a></h2>
<p>Both Server and Client Lib can implement the following callback to
encrypt a user password. This function is called in the Server Lib when
a virtual server or channel password is set.</p>
<p>This can be used to hash the password in the same way it is hashed in
the outside data store. Or just copy the password to send the clear text
to the server.</p>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">onClientPasswordEncrypt</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">plaintext</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">encryptedText</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">encryptedTextByteSize</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a server or channel password is set. </p>
<p>Used to hash the password or encrypt it for check with outside sources.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param plaintext<span class="colon">:</span></dt>
<dd class="field-even"><p>the plaintext password to be encrypted. </p>
</dd>
<dt class="field-odd">Param encryptedText<span class="colon">:</span></dt>
<dd class="field-odd"><p>the encrypted/hashed password. Fill with your encrypted password. Must be an utf8 encoded c string not larger than specified by encryptedTextByteSize </p>
</dd>
<dt class="field-even">Param encryptedTextByteSize<span class="colon">:</span></dt>
<dd class="field-even"><p>the maximum number of bytes you may write to encryptedText </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
</section>
<section id="password-validation">
<h2>Password validation<a class="headerlink" href="#password-validation" title="Link to this heading"></a></h2>
<section id="server-password">
<h3>Server password<a class="headerlink" href="#server-password" title="Link to this heading"></a></h3>
<p>Implement this callback in the server to check the password provided
when a client connects to this server against an outside database. The
callback is called whenever a password check is performed, even if no
password is set.</p>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">onCustomServerPasswordCheck</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">password</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client connects to the server. Used to verify the server password when using custom password encryption. </p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client that connects to the server </p>
</dd>
<dt class="field-odd">Param password<span class="colon">:</span></dt>
<dd class="field-odd"><p>utf8 encoded c string containing the password provided by the client. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p>a value from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum. <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> if the password is valid, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bae610d682cebd45a374eb9c70f3ee6d04"><span class="std std-ref">ERROR_server_invalid_password</span></a> if the password is not valid, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba36643fe80c5cd5e60b36174f4d029e4c"><span class="std std-ref">ERROR_parameter_invalid</span></a> if the password is in invalid format. </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
</section>
<section id="channel-password">
<h3>Channel password<a class="headerlink" href="#channel-password" title="Link to this heading"></a></h3>
<p>Implement this callback in the server to check the password provided
when a client enters a password-protected channel against an outside
database. The callback is called whenever a password check is performed,
even if no password is set.</p>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">onCustomChannelPasswordCheck</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">password</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client attempts to enter a password protected channel. Used to verify the channel password when using custom password encryption. </p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client that enters a channel </p>
</dd>
<dt class="field-odd">Param channelID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the channel the client attempts to join </p>
</dd>
<dt class="field-even">Param password<span class="colon">:</span></dt>
<dd class="field-even"><p>utf8 encoded c string containing the password provided by the client. </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p>a value from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum. <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> if the password is valid, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bae610d682cebd45a374eb9c70f3ee6d04"><span class="std std-ref">ERROR_server_invalid_password</span></a> if the password is not valid, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba36643fe80c5cd5e60b36174f4d029e4c"><span class="std std-ref">ERROR_parameter_invalid</span></a> if the password is in invalid format. </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="encryption.html" class="btn btn-neutral float-left" title="Custom encryption" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="permissions.html" class="btn btn-neutral float-right" title="Permission checks" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,296 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>&lt;no title&gt; &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">&lt;no title&gt;</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferInitUpload</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftinitupload" title="ts3sc_ftinitupload"><span class="n"><span class="pre">ts3sc_ftinitupload</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a file is to be uploaded. Allows you to deny a client from uploading files, files above a certain size, etc. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client that attempts to upload the file. </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be uploaded. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferInitDownload</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftinitdownload" title="ts3sc_ftinitdownload"><span class="n"><span class="pre">ts3sc_ftinitdownload</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a file is to be downloaded. Allows you to deny a client from downloading files, files above a certain size, etc. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client that attempts to download the file </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be downloaded. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferGetFileInfo</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftgetfileinfo" title="ts3sc_ftgetfileinfo"><span class="n"><span class="pre">ts3sc_ftgetfileinfo</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client requests file information using <a class="reference internal" href="../client_api.html#clientlib_8h_1ae8c0b60065102c7010517b09769692af"><span class="std std-ref">ts3client_requestFileInfo</span></a>. Allows to deny clients from getting file information. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to get information of the file. </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file that information is requested for. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferGetFileList</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftgetfilelist" title="ts3sc_ftgetfilelist"><span class="n"><span class="pre">ts3sc_ftgetfilelist</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client requests a directory listing using <a class="reference internal" href="../client_api.html#clientlib_8h_1a2f4af115935ecae757bdbcb8443de7db"><span class="std std-ref">ts3client_requestFileList</span></a>. Allows to deny listing files and directories in channels / directories. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferDeleteFile</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftdeletefile" title="ts3sc_ftdeletefile"><span class="n"><span class="pre">ts3sc_ftdeletefile</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client attempts to delete one or more files using <a class="reference internal" href="../client_api.html#clientlib_8h_1ad51a44944e06592bea370599ba282f44"><span class="std std-ref">ts3client_requestDeleteFile</span></a>. Allows denying clients deleting files. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to delete the file </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be deleted </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferCreateDirectory</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftcreatedir" title="ts3sc_ftcreatedir"><span class="n"><span class="pre">ts3sc_ftcreatedir</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a directory is to be created using <a class="reference internal" href="../client_api.html#clientlib_8h_1af5c0dbb932a7f25b11d19602a4f70cf7"><span class="std std-ref">ts3client_requestCreateDirectory</span></a>. Allows to deny creating certain directories. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to create the directory </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the directory to create. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferRenameFile</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftrenamefile" title="ts3sc_ftrenamefile"><span class="n"><span class="pre">ts3sc_ftrenamefile</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a file is to be renamed or moved using <a class="reference internal" href="../client_api.html#clientlib_8h_1ab13be97ad87ab9b10c38f75d5ad74c41"><span class="std std-ref">ts3client_requestRenameFile</span></a>. Allows to deny moving files or even renaming files. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to rename or move the file. </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be renamed or moved, and where the file should be moved to if its being moved. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,685 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Permission checks &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Security salts and hashes" href="security-salt.html" />
<link rel="prev" title="Custom passwords" href="passwords.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Permission checks</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#available-callbacks">Available callbacks</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#standard-permission-callbacks">Standard Permission callbacks</a></li>
<li class="toctree-l3"><a class="reference internal" href="#filetransfer-permission-callbacks">FileTransfer permission callbacks</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#example">Example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Permission checks</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="permission-checks">
<h1>Permission checks<a class="headerlink" href="#permission-checks" title="Link to this heading"></a></h1>
<p>The TeamSpeak SDK offers an optional custom permission system, allowing
SDK users to gain more control over allowed user actions on a
TeamSpeak server. The custom permissions system is implemented in the
Server Lib by adding callback functions which will be called, if
implemented, when a certain user action occurs. In this callback the
developer can allow or deny the action.</p>
<p>The callbacks should return <a class="reference internal" href="../errors.html#c.Ts3ErrorType.ERROR_ok" title="ERROR_ok"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_ok</span></code></a> to allow the action or
<code class="xref c c-enumerator docutils literal notranslate"><span class="pre">ERROR_permission</span></code> to deny it.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>If a callback is not implemented, the action will be allowed by default.</p>
</div>
<section id="available-callbacks">
<h2>Available callbacks<a class="headerlink" href="#available-callbacks" title="Link to this heading"></a></h2>
<section id="standard-permission-callbacks">
<h3>Standard Permission callbacks<a class="headerlink" href="#standard-permission-callbacks" title="Link to this heading"></a></h3>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permClientCanConnect</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client is about to connect. Can be used to deny clients from connecting. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the client on the server, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject the client.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server the client wants to connect to </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>pointer to a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client trying to connect </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permClientCanGetChannelDescription</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client requests channel description of a channel using <a class="reference internal" href="../client_api.html#clientlib_8h_1a806652361900fb894016df2c14bddc6d"><span class="std std-ref">ts3client_requestChannelDescription</span></a>. Can be used to deny access to channel descriptions. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server on which the request was received </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>pointer to a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client requesting the channel description </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permClientUpdate</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clientID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.VariablesExport" title="VariablesExport"><span class="n"><span class="pre">VariablesExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">variables</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client wants to update a clients variables. Used to deny or allow updating certain client variables </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param clientID<span class="colon">:</span></dt>
<dd class="field-even"><p>the client for which the variables are attempted to be changed. </p>
</dd>
<dt class="field-odd">Param variables<span class="colon">:</span></dt>
<dd class="field-odd"><p>pointer to a <a class="reference internal" href="../enumerations.html#struct_variables_export"><span class="std std-ref">VariablesExport</span></a> containing the variables, new and old values of the client. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permClientKickFromChannel</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">toKickCount</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">toKickClients</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">reasonText</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called before a client is kicked from the channel. Allows you to control whether clients are allowed to kick another client </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>pointer to a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client attempting to kick another client. </p>
</dd>
<dt class="field-odd">Param toKickCount<span class="colon">:</span></dt>
<dd class="field-odd"><p>number of clients that are supposed to be kicked </p>
</dd>
<dt class="field-even">Param toKickClients<span class="colon">:</span></dt>
<dd class="field-even"><p>array of <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the clients to be kicked </p>
</dd>
<dt class="field-odd">Param reasonText<span class="colon">:</span></dt>
<dd class="field-odd"><p>utf8 encoded c string containing the reason for the kick provided. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permClientKickFromServer</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">toKickCount</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">toKickClients</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">reasonText</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called before a client is kicked from the server. Allows you to control whether clients are allowed to kick another client </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>pointer to a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client attempting to kick another client. </p>
</dd>
<dt class="field-odd">Param toKickCount<span class="colon">:</span></dt>
<dd class="field-odd"><p>number of clients that are supposed to be kicked </p>
</dd>
<dt class="field-even">Param toKickClients<span class="colon">:</span></dt>
<dd class="field-even"><p>array of <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the clients to be kicked </p>
</dd>
<dt class="field-odd">Param reasonText<span class="colon">:</span></dt>
<dd class="field-odd"><p>utf8 encoded c string containing the provided reason for the kick. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permClientMove</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">toMoveCount</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">toMoveClients</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">newChannel</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">reasonText</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client requests to move one or more other clients. Allows you to control whether a client can move the clients. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server on which the move is attempted. </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>pointer to a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client attempting to move the client(s). </p>
</dd>
<dt class="field-odd">Param toMoveCount<span class="colon">:</span></dt>
<dd class="field-odd"><p>number of clients that are being moved. </p>
</dd>
<dt class="field-even">Param toMoveClients<span class="colon">:</span></dt>
<dd class="field-even"><p>array of <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing which clients are being moved. </p>
</dd>
<dt class="field-odd">Param newChannel<span class="colon">:</span></dt>
<dd class="field-odd"><p>id of the channel the clients are to be moved in to. </p>
</dd>
<dt class="field-even">Param reasonText<span class="colon">:</span></dt>
<dd class="field-even"><p>utf8 encoded c string containing the reason provided for the move. </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permChannelMove</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">newParentChannelID</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client attempts to move a channel. Allows you to control whether the client is allowed to move the channel. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client attempting to move the channel. </p>
</dd>
<dt class="field-odd">Param channelID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the channel to be moved. </p>
</dd>
<dt class="field-even">Param newParentChannelID<span class="colon">:</span></dt>
<dd class="field-even"><p>the new parent channel of the channel </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permSendTextMessage</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">targetMode</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">targetClientOrChannel</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">textMessage</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client tries to send a message. Allows you to control whether the client is allowed to send the message. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client attempting to send the message </p>
</dd>
<dt class="field-odd">Param targetMode<span class="colon">:</span></dt>
<dd class="field-odd"><p>describing the type of message attempting to be sent. One of the values from the <a class="reference internal" href="../enumerations.html#public__definitions_8h_1a2773a2b8004cd45e398baa89bb2acef8"><span class="std std-ref">TextMessageTargetMode</span></a> enum </p>
</dd>
<dt class="field-even">Param targetClientOrChannel<span class="colon">:</span></dt>
<dd class="field-even"><p>id of the channel or client (depending of the targetMode) that the message is sent to. </p>
</dd>
<dt class="field-odd">Param textMessage<span class="colon">:</span></dt>
<dd class="field-odd"><p>utf8 encoded c string containing the message to be sent. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permServerRequestConnectionInfo</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when server connection information is requested using <a class="reference internal" href="../client_api.html#clientlib_8h_1a20a6cc2a8dba1a0faf5f031a27ad4102"><span class="std std-ref">ts3client_requestServerConnectionInfo</span></a>. Can be used to deny access. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client requesting the action </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permSendConnectionInfo</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">mayViewIpPort</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">targetClient</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client attempts to request another clients connection variables using <a class="reference internal" href="../client_api.html#clientlib_8h_1a70dbf9fbdae6bb1c85da531a57a85273"><span class="std std-ref">ts3client_requestConnectionInfo</span></a></p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client requesting the other clients information </p>
</dd>
<dt class="field-odd">Param mayViewIpPort<span class="colon">:</span></dt>
<dd class="field-odd"><p>pointer to a variable that controls whether the IP and port of the target client may be seen by the client. Set to 1 to allow the requesting client to see the IP and port. Set to 0 to deny IP and port. </p>
</dd>
<dt class="field-even">Param targetClient<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client that the connection information is requested for. </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permChannelCreate</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">parentChannelID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.VariablesExport" title="VariablesExport"><span class="n"><span class="pre">VariablesExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">variables</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client attempts to create a channel. Allows you to control whether or not the client may create the desired channel. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server on which the client attempts to create the channel </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client trying to create a channel </p>
</dd>
<dt class="field-odd">Param parentChannelID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the channel that is the parent channel of the channel to be created. 0 if the channel to be created will be a root channel. </p>
</dd>
<dt class="field-even">Param variables<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="../enumerations.html#struct_variables_export"><span class="std std-ref">VariablesExport</span></a> struct that describes the channel to be created. </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permChannelEdit</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.VariablesExport" title="VariablesExport"><span class="n"><span class="pre">VariablesExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">variables</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a channel is about to be edited by a client. Allows you to prevent channel edits. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client trying to edit the channel </p>
</dd>
<dt class="field-odd">Param parentChannelID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the channel that is to be edited. </p>
</dd>
<dt class="field-even">Param variables<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="../enumerations.html#struct_variables_export"><span class="std std-ref">VariablesExport</span></a> struct that describes the channel after the edit. </p>
</dd>
<dt class="field-odd">Return<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permChannelDelete</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called before a channel is deleted by a client. Allows you to deny a client deleting channels. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server on which the channel is to be deleted </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client trying to delete the channel </p>
</dd>
<dt class="field-odd">Param channelID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the channel that is to be deleted </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permChannelSubscribe</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">channelID</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client requests to subscribe a channel. Allows you to deny subscribing to a channel. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server on which the client attempts to subscribe to the channel. </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>a <a class="reference internal" href="../enumerations.html#struct_client_mini_export"><span class="std std-ref">ClientMiniExport</span></a> describing the client trying to subscribe the channel </p>
</dd>
<dt class="field-odd">Param channelID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the channel that is to be subscribed </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
</section>
<section id="filetransfer-permission-callbacks">
<h3>FileTransfer permission callbacks<a class="headerlink" href="#filetransfer-permission-callbacks" title="Link to this heading"></a></h3>
<dl class="c struct">
<dt class="sig sig-object c">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ServerLibFunctions</span></span></span><br /></dt>
<dd><p>Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferInitUpload</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftinitupload" title="ts3sc_ftinitupload"><span class="n"><span class="pre">ts3sc_ftinitupload</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a file is to be uploaded. Allows you to deny a client from uploading files, files above a certain size, etc. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client that attempts to upload the file. </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be uploaded. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferInitDownload</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftinitdownload" title="ts3sc_ftinitdownload"><span class="n"><span class="pre">ts3sc_ftinitdownload</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a file is to be downloaded. Allows you to deny a client from downloading files, files above a certain size, etc. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client that attempts to download the file </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be downloaded. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferGetFileInfo</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftgetfileinfo" title="ts3sc_ftgetfileinfo"><span class="n"><span class="pre">ts3sc_ftgetfileinfo</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client requests file information using <a class="reference internal" href="../client_api.html#clientlib_8h_1ae8c0b60065102c7010517b09769692af"><span class="std std-ref">ts3client_requestFileInfo</span></a>. Allows to deny clients from getting file information. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to get information of the file. </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file that information is requested for. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferGetFileList</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftgetfilelist" title="ts3sc_ftgetfilelist"><span class="n"><span class="pre">ts3sc_ftgetfilelist</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client requests a directory listing using <a class="reference internal" href="../client_api.html#clientlib_8h_1a2f4af115935ecae757bdbcb8443de7db"><span class="std std-ref">ts3client_requestFileList</span></a>. Allows to deny listing files and directories in channels / directories. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferDeleteFile</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftdeletefile" title="ts3sc_ftdeletefile"><span class="n"><span class="pre">ts3sc_ftdeletefile</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a client attempts to delete one or more files using <a class="reference internal" href="../client_api.html#clientlib_8h_1ad51a44944e06592bea370599ba282f44"><span class="std std-ref">ts3client_requestDeleteFile</span></a>. Allows denying clients deleting files. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to delete the file </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be deleted </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferCreateDirectory</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftcreatedir" title="ts3sc_ftcreatedir"><span class="n"><span class="pre">ts3sc_ftcreatedir</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a directory is to be created using <a class="reference internal" href="../client_api.html#clientlib_8h_1af5c0dbb932a7f25b11d19602a4f70cf7"><span class="std std-ref">ts3client_requestCreateDirectory</span></a>. Allows to deny creating certain directories. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to create the directory </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the directory to create. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">permFileTransferRenameFile</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ClientMiniExport" title="ClientMiniExport"><span class="n"><span class="pre">ClientMiniExport</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="../enumerations.html#c.ts3sc_ftrenamefile" title="ts3sc_ftrenamefile"><span class="n"><span class="pre">ts3sc_ftrenamefile</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">)</span></span><br /></dt>
<dd><p>called when a file is to be renamed or moved using <a class="reference internal" href="../client_api.html#clientlib_8h_1ab13be97ad87ab9b10c38f75d5ad74c41"><span class="std std-ref">ts3client_requestRenameFile</span></a>. Allows to deny moving files or even renaming files. </p>
<p>Return <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow the action, or <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to reject it.</p>
<dl class="field-list simple">
<dt class="field-odd">Param serverID<span class="colon">:</span></dt>
<dd class="field-odd"><p>the server for which the callback was called </p>
</dd>
<dt class="field-even">Param client<span class="colon">:</span></dt>
<dd class="field-even"><p>describes the client attempting to rename or move the file. </p>
</dd>
<dt class="field-odd">Param params<span class="colon">:</span></dt>
<dd class="field-odd"><p>describes the file to be renamed or moved, and where the file should be moved to if its being moved. </p>
</dd>
<dt class="field-even">Return<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7ba21e7fdf5a31623bfa8042865df880a9d"><span class="std std-ref">ERROR_ok</span></a> to allow, <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7bacd0d64c660d7e6009b05bbba5631607d"><span class="std std-ref">ERROR_permissions</span></a> to deny </p>
</dd>
</dl>
</dd></dl>
</div>
</dd></dl>
</section>
</section>
<section id="example">
<h2>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h2>
<p>Example code to check if a client can connect to the server:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="c1">// Create the function pointer passed to ts3server_initServerLib</span>
<span class="linenos"> 2</span><span class="n">funcs</span><span class="p">.</span><span class="n">permClientCanConnect</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">onPermClientCanConnect</span><span class="p">;</span>
<span class="linenos"> 3</span>
<span class="linenos"> 4</span><span class="c1">// Custom callback</span>
<span class="linenos"> 5</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">onPermClientCanConnect</span><span class="p">(</span><span class="n">uint64</span><span class="w"> </span><span class="n">serverID</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">ClientMiniExport</span><span class="o">*</span><span class="w"> </span><span class="n">client</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 6</span><span class="w"> </span><span class="c1">// Forbid client with nickname &quot;client&quot; to connect</span>
<span class="linenos"> 7</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">strcmp</span><span class="p">(</span><span class="n">client</span><span class="o">-&gt;</span><span class="n">nickname</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;client&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="linenos"> 8</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">ERROR_permissions</span><span class="p">;</span><span class="w"> </span><span class="c1">// Deny</span>
<span class="linenos"> 9</span><span class="w"> </span><span class="p">}</span>
<span class="linenos">10</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">ERROR_ok</span><span class="p">;</span><span class="w"> </span><span class="c1">// Allow</span>
<span class="linenos">11</span><span class="p">}</span>
</pre></div>
</div>
<p>Please see the <cite>server_permissions</cite> example for a demonstration of
this mechanism.</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="passwords.html" class="btn btn-neutral float-left" title="Custom passwords" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="security-salt.html" class="btn btn-neutral float-right" title="Security salts and hashes" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,218 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Security salts and hashes &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Disabling protocol commands" href="disable-commands.html" />
<link rel="prev" title="Permission checks" href="permissions.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Security salts and hashes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#creating-a-channel-salt">Creating a channel salt</a></li>
<li class="toctree-l2"><a class="reference internal" href="#creating-a-client-hash">Creating a client hash</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Security salts and hashes</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="security-salts-and-hashes">
<h1>Security salts and hashes<a class="headerlink" href="#security-salts-and-hashes" title="Link to this heading"></a></h1>
<p>As an optional security feature, the TeamSpeak SDK offers to restrict
access of clients to specific channels by using a salt and hash
mechanism. The motivation here is to enforce clients to use a specific
identity, nickname and metadata when they connect to the TeamSpeak
server.</p>
<p>In the server, a security salt is created over a clients unique data by
calling <a class="reference internal" href="#c.ts3server_createSecuritySalt" title="ts3server_createSecuritySalt"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_createSecuritySalt()</span></code></a>.</p>
<p>This salt is then attached to a channel during channel creation or by editing existing
channels by setting the channel variable <a class="reference internal" href="../properties.html#c.ChannelProperties.CHANNEL_SECURITY_SALT" title="CHANNEL_SECURITY_SALT"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CHANNEL_SECURITY_SALT</span></code></a>.</p>
<p>When a client attempts to enter such a channel, the clients <a class="reference internal" href="../properties.html#c.ClientProperties.CLIENT_SECURITY_HASH" title="CLIENT_SECURITY_HASH"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CLIENT_SECURITY_HASH</span></code></a>
variable is checked against the clients data (unique id, optionally nickname and meta_data) using the salt.
If the hash is not correct, the client is not allowed to enter the channel.</p>
<p>The clients hash value is calculated by the server using <a class="reference internal" href="#c.ts3server_calculateSecurityHash" title="ts3server_calculateSecurityHash"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_calculateSecurityHash()</span></code></a>.
This security hash has to be transmitted to the client by ways outside of the TeamSpeak SDK. The
client will set the hash in its <a class="reference internal" href="../properties.html#c.ClientProperties.CLIENT_SECURITY_HASH" title="CLIENT_SECURITY_HASH"><code class="xref c c-enumerator docutils literal notranslate"><span class="pre">CLIENT_SECURITY_HASH</span></code></a> variable.</p>
<section id="creating-a-channel-salt">
<h2>Creating a channel salt<a class="headerlink" href="#creating-a-channel-salt" title="Link to this heading"></a></h2>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_createSecuritySalt</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">options</span></span>, <span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">salt</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">saltByteSize</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">securitySalt</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>Create a security salt to lock channel to identities. See the :ref:SDK Documentation&lt;<code class="docutils literal notranslate"><span class="pre">channel_security_salt</span></code>&gt; on the topic for more in depth explanation. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>options</strong> specifies which parameters to include in the security salt. A combination of values from the <a class="reference internal" href="../enumerations.html#public__definitions_8h_1a33449bae9acaa426cceb4a8d52d6eed2"><span class="std std-ref">SecuritySaltOptions</span></a> enum. </p></li>
<li><p><strong>salt</strong> pointer to random data of cryptographic quality. </p></li>
<li><p><strong>saltByteSize</strong> number of bytes of random data to use. Larger is better but slower. </p></li>
<li><p><strong>securitySalt</strong> address of a variable to receive the security salt. Memory is allocated by the server library and needs to be freed by caller using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="creating-a-client-hash">
<h2>Creating a client hash<a class="headerlink" href="#creating-a-client-hash" title="Link to this heading"></a></h2>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_calculateSecurityHash</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">securitySalt</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">clientUniqueIdentifier</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">clientNickName</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">clientMetaData</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">securityHash</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>create a hash for a specific client from a security salt to lock an identity to a channel. See the :ref:SDK Documentation&lt;<code class="docutils literal notranslate"><span class="pre">channel_security_salt</span></code>&gt; on the topic for more in depth explanation. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>securitySalt</strong> the security salt of a channel as generated by <a class="reference internal" href="../server_api.html#serverlib_8h_1a718c03b28330e46df2de3a96a083e316"><span class="std std-ref">ts3server_createSecuritySalt</span></a></p></li>
<li><p><strong>clientUniqueIdentifier</strong> public identity of a client to generate a security hash for </p></li>
<li><p><strong>clientNickName</strong> nickname of the client to include in the hash if specified by the salt. </p></li>
<li><p><strong>clientMetaData</strong> meta data of the client to include in the hash if specified by the salt. </p></li>
<li><p><strong>securityHash</strong> address of a variable to receive the security hash. Memory is allocated by the server library and must be freed by caller using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="permissions.html" class="btn btn-neutral float-left" title="Permission checks" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="disable-commands.html" class="btn btn-neutral float-right" title="Disabling protocol commands" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,280 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Create and stop virtual servers &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Advanced virtual server creation" href="advanced-create.html" />
<link rel="prev" title="List available clients, channels, servers" href="list-items.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Create and stop virtual servers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#query-keypair-for-future-reuse">Query Keypair for future reuse</a></li>
<li class="toctree-l2"><a class="reference internal" href="#stopping-a-virtual-server">Stopping a virtual server</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Create and stop virtual servers</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="create-and-stop-virtual-servers">
<h1>Create and stop virtual servers<a class="headerlink" href="#create-and-stop-virtual-servers" title="Link to this heading"></a></h1>
<p>A new virtual server can be created within the current server process by
calling</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_createVirtualServer</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">serverPort</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">serverIp</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">serverName</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">serverKeyPair</span></span>, <span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">serverMaxClients</span></span>, <span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>create a new virtual server. The server is started automatically after being created. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverPort</strong> the UDP port to listen for client connections on </p></li>
<li><p><strong>serverIp</strong> comma separated list of IP address(es) to listen for client connections on. IPv4 and IPv6 addresses are supported. </p></li>
<li><p><strong>serverName</strong> display name of the server. </p></li>
<li><p><strong>serverKeyPair</strong> Key pair for encryption. Must be unique for each virtual server. Pass an empty string when originally creating a new server, query the generated encryption key with <a class="reference internal" href="../server_api.html#serverlib_8h_1ad40026c9644902e2e02b50ea18166609"><span class="std std-ref">ts3server_getVirtualServerKeyPair</span></a>, store it and use it on subsequent start ups. </p></li>
<li><p><strong>serverMaxClients</strong> maximum number of clients that can be connected simultaneously at any given time </p></li>
<li><p><strong>result</strong> address of a variable that will receive the virtual server ID that can be used to specify this server in future calls to server library functions. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<p>The server name and server slots can later be modified using the
<code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setServerVariableAsString()</span></code> and <code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_setServerVariableAsInt()</span></code>
function calls if need be, without having to recreate the server.</p>
<p>On success, the created virtual server will be automatically started.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>You should <strong>not</strong> create a virtual server with an empty keypair except
for the first time. If the server crashes, license problems
might occur when using “throw-away” keypairs, as the license systems
may deem you to be running more virtual servers than you actually are.</p>
<p>Instead query the keypair the first time the virtual server was
started, save it to a file and reuse it when creating a new virtual
server. This way licensing issues will not occur.</p>
<p>See the server sample which is included in the TeamSpeak 3 SDK for an
example on how to save and restore keypairs.</p>
</div>
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p>When a virtual server is started, it will register itself at a
TeamSpeak licensing server reporting the maximum client count to
ensure the server is operating within the license limits. On
shutdown, the virtual server will deregister with the licensing server.</p>
<p>This leads to two important things to keep in mind:</p>
<p>1) Dont just kill your server with Ctrl-C, instead ensure its
shutdown properly calling <a class="reference internal" href="#c.ts3server_stopVirtualServer" title="ts3server_stopVirtualServer"><code class="xref c c-func docutils literal notranslate"><span class="pre">ts3server_stopVirtualServer()</span></code></a>. If killed
too often, the licensing server might reject this server instance
because the license seems to be exceeded as client slots are only
added but never removed.</p>
<p>2) Dont start a virtual server too frequently. This may raise an
error <em>“virtualserver started too many times in a certain time
period”</em>. Contacting the licensing server will be prevented to
protect our backend services from getting spammed with frequent
server updates for the same server.</p>
<p>The trigger conditions for this error are very specific and are as
follows:</p>
<ul class="simple">
<li><p>You start a server instance and then stop the same instance within
5 seconds of it being started.</p></li>
<li><p>The above happens more than 3 times in a 41 minute window.</p></li>
</ul>
<p>After you triggered this error, you will be prevented from starting
any server instance using the affected license for a period of 12
minutes.</p>
<p>You should first investigate how you managed to trigger this error
and change your scripts to avoid triggering the conditions above.
Then you must not start any server instance for the 12 minute grace
period mentioned above. After this wait, you should be able to start
your instance normally.</p>
</div>
<section id="query-keypair-for-future-reuse">
<h2>Query Keypair for future reuse<a class="headerlink" href="#query-keypair-for-future-reuse" title="Link to this heading"></a></h2>
<p>To query the keypair of a virtual server, use</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_getVirtualServerKeyPair</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>retrieve the encryption keys used by the virtual server. </p>
<p>Store these and use them on subsequent process startup to recreate this server when calling <a class="reference internal" href="../server_api.html#serverlib_8h_1a5175258df0d2a5ab39b36f35f55cc6c2"><span class="std std-ref">ts3server_createVirtualServer</span></a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server for which to get the key pair. </p></li>
<li><p><strong>result</strong> address of a variable to receive a utf8 encoded c string containing the key pair. Memory is allocated by the server library and must be freed by caller using <a class="reference internal" href="../server_api.html#serverlib_8h_1a6993000e98ccfa4ecf0a6f3d92406e5e"><span class="std std-ref">ts3server_freeMemory</span></a></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
<section id="stopping-a-virtual-server">
<h2>Stopping a virtual server<a class="headerlink" href="#stopping-a-virtual-server" title="Link to this heading"></a></h2>
<p>A virtual server can be stopped with</p>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_stopVirtualServer</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>deletes a virtual server. All clients will be disconnected and no more connections are accepted. You need to recreate the server using <a class="reference internal" href="../server_api.html#serverlib_8h_1a5175258df0d2a5ab39b36f35f55cc6c2"><span class="std std-ref">ts3server_createVirtualServer</span></a> or <a class="reference internal" href="../server_api.html#serverlib_8h_1a2cbaee21d0dc163d23ebcc4d15065fbe"><span class="std std-ref">ts3server_createVirtualServer2</span></a> to make it available again. </p>
<p>You may want to save the state of the virtual server if you need persistence.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> specifies which server to stop </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Nothing of the virtual server remains after it has stopped.
You will need to recreate the virtual server afterwards.
If you need to save state (e.g. channels on the server) you
need to do so before stopping the virtual server.</p>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="list-items.html" class="btn btn-neutral float-left" title="List available clients, channels, servers" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="advanced-create.html" class="btn btn-neutral float-right" title="Advanced virtual server creation" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
@@ -0,0 +1,184 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Whisper lists &mdash; TeamSpeak SDK documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=7f41d439"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Custom encryption" href="encryption.html" />
<link rel="prev" title="Managing clients" href="clients.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
TeamSpeak SDK
<img src="../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../errors.html">TeamSpeak Error Codes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../properties.html">Property Enums</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enumerations.html">Structures &amp; Enumerations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client_api.html">TeamSpeak Client Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../server_api.html">TeamSpeak Server Functions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Server</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="list-items.html">List available clients, channels, servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="vserver-manage.html">Create and stop virtual servers</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-create.html">Advanced virtual server creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="channels.html">Managing channels</a></li>
<li class="toctree-l1"><a class="reference internal" href="clients.html">Managing clients</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="permissions.html">Permission checks</a></li>
<li class="toctree-l1"><a class="reference internal" href="security-salt.html">Security salts and hashes</a></li>
<li class="toctree-l1"><a class="reference internal" href="disable-commands.html">Disabling protocol commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Client</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../client/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/basic.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/connections.html">Managing server connections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/audio.html">Client Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/wave-files.html">Playing wave files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/3dsound.html">3D Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/whisper.html">Whisper lists</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/voice-encryption.html">Channel voice data encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/info.html">Retrieve and store information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/channels.html">Channel Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-list.html">List clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/client-kick.html">Kicking clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/local-mute.html">Muting other clients</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/textmessages.html">Text chat</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/filetransfer.html">Filetransfer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/encryption.html">Custom encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/passwords.html">Custom passwords</a></li>
<li class="toctree-l1"><a class="reference internal" href="../client/faq.html">FAQ</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">TeamSpeak SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Whisper lists</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="whisper-lists">
<h1>Whisper lists<a class="headerlink" href="#whisper-lists" title="Link to this heading"></a></h1>
<p>A client with a whisper list set can talk to the specified clients and
channels. Whisper lists can be defined for individual clients. A whisper
list consists of an array of client IDs and/or an array of channel IDs.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Setting a whisper list will stop regular voice transmission to the current channel
of the client.</p>
<p>Clients that have a whisper list set will <strong>only</strong> be heard by the clients
specified in the whisper list.</p>
</div>
<dl class="c function">
<dt class="sig sig-object c">
<span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ts3server_setClientWhisperList</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="n"><span class="pre">serverID</span></span>, <span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="n"><span class="pre">clID</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">uint64</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">channelID</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">anyID</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">clientID</span></span><span class="sig-paren">)</span><br /></dt>
<dd><p>set a clients whisper list. Will stop transmitting that clients voice to their current channel. </p>
<p>The client will still receive voice from their current channel, however their voice will not be transmitted to their current channel anymore. The voice data of the specified client will be transmitted to all specified channels and all the specified clients. Pass 0 to both channelID and clientID to restore default behavior of transmitting voice to current channel.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>serverID</strong> the server on which to set the whisper list </p></li>
<li><p><strong>clID</strong> the client for which to set the whisper list </p></li>
<li><p><strong>channelID</strong> zero terminated array of channel ids to add to the whisper list. Pass nullptr to reset. Like { 3, 94, 84, …, 0 } </p></li>
<li><p><strong>clientID</strong> zero terminated array of client ids to add to the whisper list. Pass nullptr to reset. Like { 1, 4, …, 0 } </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>An Error code from the <a class="reference internal" href="../errors.html#public__errors_8h_1a0bcf1e0a5e32989890f6e85064327f7b"><span class="std std-ref">Ts3ErrorType</span></a> enum indicating either success or the failure reason </p>
</dd>
</dl>
</dd></dl>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="clients.html" class="btn btn-neutral float-left" title="Managing clients" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="encryption.html" class="btn btn-neutral float-right" title="Custom encryption" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, TeamSpeak Systems GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>