Query virtual servers, clients and channels

A list of all virtual servers can be queried with:

unsigned int ts3server_getVirtualServerList(result); 
uint64** result;
 

Parameters

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

[Note]Note

The default virtual server has an ID of 1.


A list of all clients currently online on the specified virtual server can be queried with:

unsigned int ts3server_getClientList(serverID,  
 result); 
uint64 serverID;
anyID** result;
 

Parameters

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


A list of all channels currently available on the specified virtual server can be queried with:

unsigned int ts3server_getChannelList(serverID,  
 result); 
uint64 serverID;
uint64** result;
 

Parameters

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


To get a list of all clients currently member of the specified channel:

unsigned int ts3server_getChannelClientList(serverID,  
 channelID,  
 result); 
uint64 serverID;
uint64 channelID;
anyID** result;
 

Parameters

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


Query the channel the specified client has currently joined:

unsigned int ts3server_getChannelOfClient(serverID,  
 clientID,  
 result); 
uint64 serverID;
anyID clientID;
uint64* result;
 

Parameters

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


Get the parent channel of a given channel:

unsigned int ts3server_getParentChannelOfChannel(serverID,  
 channelID,  
 result); 
uint64 serverID;
uint64 channelID;
uint64* result;
 

Parameters

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


Example to print a list of all channels on a virtual server:

uint64* channels;

if(ts3server_getChannelList(serverID, &channels) == ERROR_ok) {
    for(int i=0; channels[i] != NULL; i++) {
        printf("Channel ID: %u\n", channels[i]);
    }
    ts3server_freeMemory(channels);
}

Example to print all clients who are member of channel with ID 123:

uint64 channelID = 123;  /* ID in our example */
anyID* clients;

if(ts3server_getChannelClientList(serverID, channelID, &clients) == ERROR_ok) {
    for(int i=0; clients[i] != NULL; i++) {
        printf("Client ID: %u\n", clients[i]);
    }
  ts3server_freeMemory(clients);
}