348 lines
32 KiB
HTML
348 lines
32 KiB
HTML
|
||||
|
|
|
|||
|
|
<!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 — 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 & 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">&</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">"Topic of channel %u is: %s</span><span class="se">\n</span><span class="s">"</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">"New channel name"</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">"Error setting channel name</span><span class="se">\n</span><span class="s">"</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">"New channel 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"> 8</span><span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"Error setting channel topic</span><span class="se">\n</span><span class="s">"</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">"Error flushing channel variable</span><span class="se">\n</span><span class="s">"</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>© 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>
|