Information related to a virtual server can be queried with::
unsigned int ts3server_getVirtualServerVariableAsInt( | serverID, | |
flag, | ||
result) ; |
uint64 serverID
;VirtualServerProperties flag
;int* result
;
unsigned int ts3server_getVirtualServerVariableAsString( | serverID, | |
flag, | ||
result) ; |
uint64 serverID
;VirtualServerProperties flag
;char** result
;serverID
ID of the virtual server of which the property is queried.
flag
Virtual server propery to query, see below.
result
Address of a variable which receives the result value as int or string, depending on which function is used. In case of a string, memory must be released using ts3server_freeMemory
, unless an error occured.
Returns ERROR_ok
on success, otherwise an error code as defined in public_errors.h
. For the string version: If an error has occured, the result string is uninitialized and must not be released.
The parameter flag
specifies the type of queried information. It is defined by the enum VirtualServerProperties:
enum VirtualServerProperties { VIRTUALSERVER_UNIQUE_IDENTIFIER = 0, //available when connected, can be used to identify this particular //server installation VIRTUALSERVER_NAME, //available and always up-to-date when connected VIRTUALSERVER_WELCOMEMESSAGE, //available when connected, not updated while connected VIRTUALSERVER_PLATFORM, //available when connected VIRTUALSERVER_VERSION, //available when connected VIRTUALSERVER_MAXCLIENTS, //only available on request (=> requestServerVariables), stores the //maximum number of clients that may currently join the server VIRTUALSERVER_PASSWORD, //not available to clients, the server password VIRTUALSERVER_CLIENTS_ONLINE, //only available on request (=> requestServerVariables), VIRTUALSERVER_CHANNELS_ONLINE, //only available on request (=> requestServerVariables), VIRTUALSERVER_CREATED, //available when connected, stores the time when the server was created VIRTUALSERVER_UPTIME, //only available on request (=> requestServerVariables), the time //since the server was started VIRTUALSERVER_CODEC_ENCRYPTION_MODE, //available and always up-to-date when connected VIRTUALSERVER_ENCRYPTION_CIPHERS, //SDK only: list of ciphers that can be used for encryption VIRTUALSERVER_ENDMARKER, };
VIRTUALSERVER_UNIQUE_IDENTIFIER
Unique ID for this virtual server. Stays the same after restarting the server application.
VIRTUALSERVER_NAME
Name of this virtual server.
VIRTUALSERVER_WELCOMEMESSAGE
Optional welcome message sent to the client on login.
VIRTUALSERVER_PLATFORM
Operating system used by this server.
VIRTUALSERVER_VERSION
Application version of this server.
VIRTUALSERVER_MAXCLIENTS
Defines maximum number of clients which may connect to this server.
VIRTUALSERVER_PASSWORD
Optional password of this server.
VIRTUALSERVER_CLIENTS_ONLINE
VIRTUALSERVER_CHANNELS_ONLINE
Number of clients and channels currently on this virtual server.
VIRTUALSERVER_CREATED
Time when this virtual server was created.
VIRTUALSERVER_UPTIME
Uptime of this virtual server.
VIRTUALSERVER_CODEC_ENCRYPTION_MODE
Defines if voice data encryption is configured per channel, globally forced on or globally forced off for this virtual server. The default behaviour is configure per channel, in this case modifying the channel property CHANNEL_CODEC_IS_UNENCRYPTED
defines voice data encryption of individual channels.
Virtual server encryption mode can be set to the following parameters:
enum CodecEncryptionMode { CODEC_ENCRYPTION_PER_CHANNEL = 0, CODEC_ENCRYPTION_FORCED_OFF, CODEC_ENCRYPTION_FORCED_ON, };
This property is always available when connected.
VIRTUALSERVER_ENCRYPTION_CIPHERS
Comma-separated list of ciphers that are used for encrypting the connection. The server uses the left most cipher in VIRTUALSERVER_ENCRYPTION_CIPHERS
that is also defined in CLIENT_ENCRYPTION_CIPHERS
of the connecting client.
Possible values are:
"AES-128" "AES-256"
Default is "AES-256,AES-128".
Example checking the number of clients online, obviously an integer value:
int clientsOnline; if(ts3server_getVirtualServerVariableAsInt(serverID, VIRTUALSERVER_CLIENTS_ONLINE, &clientsOnline) == ERROR_ok) printf("There are %d clients online\n", clientsOnline);
In addition to the virtual server properties in the public_definitions.h
header there are extended properties used for filetransfer found in a seperate header file public_sdk_definitions.h
.
enum VirtualServerPropertiesSDK { VIRTUALSERVER_FILEBASE=24, //not available to clients, stores the folder used for file transfers VIRTUALSERVER_MAX_DOWNLOAD_TOTAL_BANDWIDTH = 29, //only available on request (=> requestServerVariables) VIRTUALSERVER_MAX_UPLOAD_TOTAL_BANDWIDTH= 30, //only available on request (=> requestServerVariables) VIRTUALSERVER_LOG_FILETRANSFER=64, };
VIRTUALSERVER_FILEBASE
Base folder where to the file storage is located on this virtual server, see ts3server_enableFileManager
. The filebase can be queried or set (before initializing filetransfer with ts3server_enableFileManager
) with this property.
VIRTUALSERVER_MAX_DOWNLOAD_TOTAL_BANDWIDTH
Defines the maximum allowed bandwidth for downloadload. Set this property before creating the server with ts3server_initServerLib
.
VIRTUALSERVER_MAX_UPLOAD_TOTAL_BANDWIDTH
Defines the maximum allowed bandwidth for upload. Set this property before creating the server with ts3server_initServerLib
.
VIRTUALSERVER_LOG_FILETRANSFER
Set to true to enable logging filetransfer actions to the logfile.
Change server variables with the following functions:
unsigned int ts3server_setVirtualServerVariableAsInt( | serverID, | |
flag, | ||
value) ; |
uint64 serverID
;ChannelProperties flag
;int value
;
unsigned int ts3server_setVirtualServerVariableAsString( | serverID, | |
flag, | ||
value) ; |
uint64 serverID
;ChannelProperties flag
;const char* value
;serverID
ID of the virtual server of which the property should be changed.
flag
Virtual server propery to change, see above.
value
Value the virtual server property should be changed to.
Returns ERROR_ok
on success, otherwise an error code as defined in public_errors.h
.
![]() | Important | ||
---|---|---|---|
After modifying one or more server variables, you must flush the changes.
uint64 serverID ; |
Example: Change the servers welcome message:
if(ts3server_setVirtualServerVariableAsString(serverID, VIRTUALSERVER_WELCOMEMESSAGE, "New welcome message") != ERROR_ok) { printf("Error setting server welcomemessage\n"); return; } if(ts3server_flushVirtualServerVariable(serverID) != ERROR_ok) { printf("Error flushing server variable\n"); }