I am working on a Teamspeak3 Plugin written in c#(using this base) and I'm working on getting a channel list, this is how to do it in c:
/* Print list of all channels on this server */
char* s;
char msg[1024];
anyID myID;
uint64* ids;
size_t i;
unsigned int error;
if(ts3Functions.getChannelList(serverConnectionHandlerID, &ids) != ERROR_ok) {
ts3Functions.logMessage("Error getting channel list", LogLevel_ERROR, "Plugin", serverConnectionHandlerID);
return;
}
printf("PLUGIN: Available channels:\n");
for(i=0; ids[i]; i++) {
/* Query channel name */
if(ts3Functions.getChannelVariableAsString(serverConnectionHandlerID, ids[i], CHANNEL_NAME, &s) != ERROR_ok) {
ts3Functions.logMessage("Error querying channel name", LogLevel_ERROR, "Plugin", serverConnectionHandlerID);
return;
}
printf("PLUGIN: Channel ID = %llu, name = %s\n", (long long unsigned int)ids[i], s);
ts3Functions.freeMemory(s);
}
ts3Functions.freeMemory(ids); /* Release array */
At for(i=0; ids[i]; i++)
, it states that a uint64*
is being iterated through with a size_t
.
I am wondering how iterating through that works, and what is the closest equivalent in c#?