So I have tried to use the sample code in the back of the server documentation for sdk 3.0.2 for implementing a name password authentication. When I check the client metadata on the server side it is still blank in the onClientConnected() callback.

Here is my client side code:

/* set password to login */
if ((error = ts3client_setClientSelfVariableAsString(serverConn ectionHandlerID, CLIENT_META_DATA, "test123")) != ERROR_ok) {
printf("Error setting user password: %d\n", error);
return;
}

if ((error = ts3client_flushClientSelfUpdates(serverConnectionH andlerID, nil)) != ERROR_ok) {
printf("Error flushing client updates.\n");
return;
}

if((error = ts3client_startConnection(serverConnectionHandlerI D, identity, kServerHost, kServerPort, [self.connectName UTF8String], NULL, "", "secret")) != ERROR_ok)
{
printf("Error connecting to server: %d\n", error);
return;
}


and here is the server side code (inside the onClientConnected callback):

char *metaData;
if ((error = ts3server_getClientVariableAsString(serverID, clientID, CLIENT_META_DATA, &metaData)) != ERROR_ok) {
printf("Could not query client's login info. %d\n", error);
*removeClientError = ERROR_client_not_logged_in;
return;
}

if (strcmp(metaData, "test123") != 0) {
printf("User not authenticated. %s and test123\n", metaData);
*removeClientError = ERROR_client_not_logged_in;
return;
}
ts3server_freeMemory(metaData);

I can't figure out why the client meta_data isn't updated by the time the server callback gets called