Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crashes #48

Open
realbadidas opened this issue Apr 20, 2020 · 5 comments
Open

Application crashes #48

realbadidas opened this issue Apr 20, 2020 · 5 comments

Comments

@realbadidas
Copy link

realbadidas commented Apr 20, 2020

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.d__27.MoveNext()
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei TCPServer.Program.d__8.MoveNext()
bei System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_1(Object state)
bei System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
bei System.Threading.ThreadPoolWorkQueue.Dispatch()
bei System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

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

@realbadidas
Copy link
Author

edit: yatqa says that there was an query connection, so it connects but still crashes.

@realbadidas
Copy link
Author

edit 2: I found the issue. rc.pokeclient() is just not working, i dont know why

@almdandi
Copy link

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}

@realbadidas
Copy link
Author

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

@nikeee
Copy link
Owner

nikeee commented Apr 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants