Create and stop virtual servers

A new virtual server can be created within the current server process by calling:

unsigned int ts3server_createVirtualServer(serverPort,  
 serverIp,  
 serverName,  
 serverKeyPair,  
 serverMaxClients,  
 result); 
unsigned int serverPort;
const char* serverIp;
const char* serverName;
const char* serverKeyPair;
unsigned int serverMaxClients;
uint64* result;
 

Parameters

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h. On success, the created virtual server will be automatically started.

[Caution]Caution

You should not create a virtual server with an empty keypair except than the first time. If the server should crash, license problems might result when using “throw-away” keypairs, as the license systems might consider you are running more virtual servers than you actually do.

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.

See the server sample which is included in the TeamSpeak 3 SDK for an example on how to save and restore keypairs.

[Note]Note

The TeamSpeak 3 server uses UDP. Support for TCP might be added in the future.


To query the keypair of a virtual server, use:

unsigned int ts3server_getVirtualServerKeyPair(serverID,  
 result); 
uint64 serverID;
char** result;
 

Parameters

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h. If an error has occured, the result string is uninitialized and must not be released.


A virtual server can be stopped with:

unsigned int ts3server_stopVirtualServer(serverID); 
uint64 serverID;
 

Parameters

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h.