FAQ
Unable to start multiple virtual servers / processes
You don’t have a valid license key in the correct location. The file licensekey.dat 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:
Only one server process per machine
Only one virtual server per process
Up to 32 slots
Please contact sales@teamspeakusa.com for license key inquiries or to obtain a valid license.
Configure the maximum number of clients on a server
The number of slots per virtual server can be changed by setting the
virtual server property VIRTUALSERVER_MAXCLIENTS
Example to set 100 slots on the specified virtual server:
ts3server_setVirtualServerVariableAsInt(serverID, VIRTUALSERVER_MAXCLIENTS, 100); // Set value
ts3server_flushVirtualServerVariable(serverID); // Flush changes
Important
Please note that you probably do not have unlimited slots allowed by your license, so don’t set this arbitrarily.
I get “Accounting | | sid=1 is running initializing shutdown” in the log
This error happens because you are running more than one virtual server with the same server keypair.
When creating a new virtual server, a keypair must be passed to
ts3server_createVirtualServer()
. 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.
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 same 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.
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.
Important
Each key pair should only be used for the same virtual server. It must not be re-used for multiple virtual servers.
However it is also important to not generate a new key pair every time you start the virtual server again.
Implementing a name/password authentication
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.
When connecting to the TeamSpeak 3 server, a client might make use of
the CLIENT_META_DATA
property and fill this with a username / password
combination, to let the server validate this this data in the servers
ServerLibFunctions.onClientConnected
callback.
This callback allows to set an error value to block this clients connection.
The client-side code:
// In the client, set CLIENT_META_DATA before connecting
if (ts3client_setClientSelfVariableAsString(scHandlerID, CLIENT_META_DATA, "NAME#PASSWORD") != ERROR_ok) {
printf("Failed setting client meta data\n");
return;
}
// Call ts3client_startConnection
In the server implement the onClientConnected callback, which validates the name/password meta data and refuses the connection if not validated:
1void onClientConnected(uint64 serverID, anyID clientID, uint64 channelID, unsigned int* removeClientError) {
2 // Query CLIENT_META_DATA
3 char* metaData;
4 if (ts3server_getClientVariableAsString(serverID, clientID, CLIENT_META_DATA, &metaData) != ERROR_ok) {
5 printf("Failed querying client meta data\n");
6 *removeClientError = ERROR_client_not_logged_in; // Block client
7 return;
8 }
9
10 // Validate name/password
11 if (!validateNamePassword(metaData)) {
12 *removeClientError = ERROR_client_not_logged_in; // Block client
13 }
14 // Client is allowed to connect if removeClientError is not changed (defaults is ERROR_ok)
15 ts3server_freeMemory(metaData); // Release previously allocated memory
16}