Scordo / TS3QueryLib.Net

This library allows you to query team speak 3 servers using the query port. All queries are implemented type safe and the library is written to work with .Net 3.5 SP1 or higher inluding support for silverlight 3.0 or higher and windows phone 7.1.
BSD 3-Clause "New" or "Revised" License
51 stars 15 forks source link

ChannelMessageReceived event not being raised #16

Closed aaroncornet closed 6 years ago

aaroncornet commented 9 years ago

I want to start by saying that this Library is absolutely amazing and it really looks and works great. I'm running into a problem though with the EventHandler for Channel Messages. I've added a event handler for it in the picture below: ts3_1

The problem is that no message in that channel gets printed. The event looks like this: ts3_2

I've added notification registrations and I'm kinda lost at the moment. Is it possible that you could give me a hint in where it might go wrong?

Thanks in advance,

With kind regards,

Aron

XoMEX commented 9 years ago

Works for me... Did you Login? (preferably as serveradmin so you have all rights) was it successfull? Did you select a Server Instance? Is 588 the right Channelid? Is any RegisterForNotifications Erroneous? Is the QueryRunner in the Channel you want to receive messages in? (See 2nd Screenshot. You may consider caching WhoAmI, as well as checking the response)

ts3 channeltext

Here the Target Channel isn't the default channel. ts3 channeltext_2

The channelid in RegisterForNotifications is fully optional. If you leave it blank, you will get Channelmessages from whichever channel the QueryClient is in. You might also check the official TS3 Query Manual for more information, and try to replicate stuff via Putty to test stuff and why/where it may fail. You could also capture/tunnel the traffic of your programm and get more insights in what is happening.

I hope this helps you, XoMEX

aaroncornet commented 9 years ago

Hey XoMEX,

All of the suggested changes where things I did try except for one thing and that was to use a QueryDispatcher. By using it the way you showed in your picture, combined with the example in the library I finally managed to get it working. I want to thank you very much for your help in solving this for me and I hope when I run into more trouble, you can give me some more insight!

With kind regards,

Aron

aaroncornet commented 9 years ago

Hey XoMEX,

I ran into a next problem and I hope you can help me with this one. I wanted to pull the client list from the server as followed: ts3_3

This makes the query hang stuck on the GetClientList() command and eventually the query disconnects or throw a StackOverflowException after a minute. If I dont inpute the true value between the brackets in GetClientList() everything works fine but does not include the serverGroups or Country. What could be the cause of this?

With kind regards,

Aron

XoMEX commented 9 years ago

Hey Aron,

At first the functioncall didn't work for me either. (the function took too long and I stopped debugging, cause I couldn't add breakpoints and couldn't go step by step into the framework...) After Cleaning up the Project (right click on Project) and rebuilding it, it suddently worked.

Make sure you use the current code. Also you could try to call GetClientList(true,true,true,true,true,true,true,true,true) (9 bools), which essentially does the same. You could also check what happens, when you only set one of the nine bools to true. (Maybe one special one is causing an error)

I recommend to compile the lib by yourself. For that Download code, unzip it to some folder and add the TS3Querylib.Core.Framework (existing) Project to your Project Solution image When you do so, you can debug easier, because you can place breakpoints in the framework or while debugging you can go step by step into the framework (second button/F11) image To find the error via source: Place a breakpoint on the line with the GetClientList call. Start debugging and step into(F11) GetClientList. Try to step over(F10) anything, but the return statement. There you step into. If something before the return statement caused the exception, Restart debugging and go into that. (And so on...) Otherwise you step into every line that says return, elso you step over. Then is important to find out where the Exception is thrown or rather where and why the functioncalls loop recusivly.

Again I recommend capturing the traffic. Since Telnet is unencrypted you can easily read it. I'm using an autoit script, which simply listens to port 10012 and redirects every traffic to that port to the ts server (and the other way around). Additionally it prints the traffic. If you choose to use it, don't forget to quit it in the Windows Taskbar, it's a tray icon. Then it would be important to know whether or not the clientlist command is sent or not.

Another thing to mention about the diconnect, after 10 Minutes of idling the query disconnects. So you should think about a timer which periodically sends a whoami command or some serverinformation command.

Regards, XoMEX

aaroncornet commented 9 years ago

Hey XoMEX,

Thanks again for your help. I really appreciate it. I followed your lead and the easy fix of cleaning up and rebuilding doesnt work sadly. I've followed your breakpoint tutorial and found out that it loops endlessly on the DispatchInternal() function in ASyncTcpDispatcher.cs. This isn't the case when I leave the bool out of the brackets. It has to go through the loop a couple of times but eventually will receive a response.

I will look into sniffing the traffic tomorrow but this is what I found so far.

Thanks again and with kind regards,

Aron

XoMEX commented 9 years ago

Are you using the command on a Server with (more or less) a lot of clients connected to it? I had a similar Problem with fetching the channel list on a bigger server, which worked, but took a few seconds, but I got a result. Thought my Pull Request #9 was implemented into this repo, but doesen't seem like it. The problem is Regex checks are slow compared to a simple index of. Maybe it'll help when you apply that fix to your local Framework.

Regards, XoMEX

Edit: Seems to be the same issue like in #15 and #12 is the like the problem I descriebed in this post...

aaroncornet commented 9 years ago

By applying your pull request changes into the local framework everything works like a charm! Instant response from the server. It currently retrieves around 30 clients and I do need to test it when my teamspeak gets some more players later on, but for now it works absolutely perfect and I can't thank you enough for all the help and time you spent into this.

With kind regards,

Aron

Scordo commented 7 years ago

Hi,

can you please validate this for the new release?: https://ts3querylib.codeplex.com/releases/view/628874

Thanks! Scordo