Application crashes
Hello, im using the library for quite a while now, but now its not working anymore. i now commented everything except 1 query and the login out, so i can analyze the problem. but not even the first query works. ` var rc = new TeamSpeakClient("185.230.160.62", 10011); // Create rich client instance await rc.Connect(); // connect to the server await rc.Login("serveradmin", "ddddddd"); // login to do some stuff that requires permission await rc.UseServer(1); // Use the server with id '1'
var currentClients = await rc.GetClients();
foreach (var c in currentClients)
{
if (c.DatabaseId == 5)
{
await rc.PokeClient(c.DatabaseId, "Der RCon Server wurde gestartet");
}
` Visual studio says it begins at the foreach loop.
the error is:
TeamSpeak3QueryApi.Net.QueryException
HResult=0x80131500
Nachricht = An error occurred during the query.
Quelle = mscorlib
Stapelüberwachung:
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
bei TeamSpeak3QueryApi.Net.QueryClient.<Send>d__27.MoveNext()
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei TCPServer.Program.
One more thing to note: i had to enable "just my code" because before that it said "AsyncMethodBuilder.cs not found". i followed this tutorial for that: https://stackoverflow.com/questions/39167352/debugging-source-not-found-asyncextensions-cs-not-found
i have no clue whats going on cuz it worked before. i hope you can help. Alex
edit: yatqa says that there was an query connection, so it connects but still crashes.
edit 2: I found the issue. rc.pokeclient() is just not working, i dont know why
Hey,
you used the DatabaseId from the Client in the PokeClient function. I butty sure you need the use the ClientId (clid)
clientpoke clid={clientID} msg={text}
hey, thanks for the reply. i tried it with the clientid, but it still doesn't work. it worked with dbid before, its so weird. i just use some other query now, but still thanks for the reply
Since the exception seems to be a QueryException, the response was valid but the server responded with an error code != 0.
Could you inspect the exception? It has an error property which contains the data the server sent: https://github.com/nikeee/TeamSpeak3QueryAPI/blob/master/src/TeamSpeak3QueryApi/QueryException.cs#L12
The AsyncMethodBuilder is compiler generated code that wraps async/await and doesn't seem to be relevant in this case.